Invoice layout file generation method

By typing and filling in data according to the type of invoices and the format specified by the tax bureau, the problem of not being able to support multiple types of invoices in the existing technology is solved, and fast and lightweight invoice layout files are achieved, which improves the issuance efficiency of enterprises and Storage savings.

CN119227632APending Publication Date: 2024-12-31大象慧云信息技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411294716.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The existing invoice layout file generation method cannot support multiple types of tickets, resulting in companies being inefficient when issuing invoices, and the generated files are too large, occupying disk resources and network bandwidth.

Method used

Judging the type of invoices based on the invoice issuance request, obtain the corresponding nodes and data items, type in accordance with the format and size specified by the tax bureau, and fill in the data items to generate a lightweight invoice layout file, supporting the unified generation logic of multiple types of invoices. Automatically process paging and signatures.

Benefits of technology

It realizes the rapid generation of multiple invoice layout files, which reduces the adjustment time of enterprises when issuing invoices, and the generated files are less than the original files, saving storage and transmission costs, improving efficiency and simplifying the enterprise's business processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119227632A_ABST
    Figure CN119227632A_ABST
Patent Text Reader

Abstract

The invention provides an invoice layout file generation method, and relates to the field of invoice layout file generation, and the method comprises the steps: judging the type of an invoice according to an invoice issuing request; acquiring nodes for generating an invoice layout file according to the invoice type, and typesetting each node and a data item under each node by taking the size of the invoice layout file as a reference according to an invoice layout file format specified by a tax bureau for the invoice type; and filling corresponding node data for each node, and filling specific data item data for the data item under each node, so that an invoice layout file can be generated. According to the invention, the generation logic of the layout file does not need to be set for each type of invoice, and the generation logic is uniform and simple, so that an enterprise can quickly generate the invoice layout file and issue the corresponding invoice when issuing the invoice.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of invoice format file generation, and in particular to an invoice format file generation method. Background Art

[0002] In the prior art, the invoice format file generation method is relatively chaotic. Different invoices and different invoices use a variety of invoice format file generation methods. Therefore, enterprises often need to adjust the generation method according to different business scenarios during use, which wastes time and energy, is prone to errors, and is inefficient. In addition, the known invoice format file generation solution only performs targeted processing based on specific data, cannot support multiple invoice types, and does not meet the needs of regular business use of enterprises. Summary of the invention

[0003] The present invention is a method for generating an invoice format file, which can solve the technical problem that the invoice format file generation solution in the prior art only performs targeted processing according to specific data, cannot support multiple invoice types, and does not meet the needs of conventional business use of enterprises.

[0004] To achieve the above-mentioned purpose, the present invention provides a method for generating an invoice format file, comprising:

[0005] Determine the invoice type based on the invoice issuance request;

[0006] Obtain the node for generating the invoice layout file according to the invoice type, and typeset each node and the data items under each node according to the invoice layout file format specified by the tax bureau for the invoice type and based on the size of the invoice layout file;

[0007] By filling in the corresponding node data for each of the nodes and filling in the specific data item data for the data items under each node, an invoice format file can be generated.

[0008] Advantageous effects of the present invention: The invoice layout file generation method of the embodiment of the present invention describes the generation logic of the layout files of all types of invoices, determines the type of invoice according to the invoice issuance request, thereby obtaining the node for generating the invoice layout file used for the invoice of this type, and typesets each node and the data items under each node based on the invoice layout file format specified by the tax bureau for the invoice type and the size of the invoice layout file. After typesetting, the node data and data item data are filled in to generate the invoice layout file. There is no need to set the generation logic of the layout file for each type of invoice respectively, and the generation logic is unified and simple, so that the enterprise can quickly generate the invoice layout file and issue a lightweight invoice when issuing an invoice. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] The above and other objects, features and advantages of the present application will become more apparent by describing in detail the exemplary embodiments thereof with reference to the accompanying drawings. The accompanying drawings described below are only some embodiments of the present application, and it is clear to a person skilled in the art that other accompanying drawings can be obtained from these accompanying drawings without creative effort.

[0010] Figure 1 It is a flow chart of a lightweight invoice format file generation method according to an embodiment of the present invention;

[0011] Figure 2 It is a flow chart of generating an invoice format file when an invoice is issued in a non-digital electronic form according to an embodiment of the present invention;

[0012] Figure 3 It is a flow chart of generating an invoice format file when an invoice is issued in digital electronic form according to an embodiment of the present invention;

[0013] Figure 4 This is an example of a VAT electronic general invoice issued in a non-digital electronic invoicing form in an embodiment of the present invention;

[0014] Figure 5 This is an example of an invoice with non-specific elements issued in the form of digital invoicing in an embodiment of the present invention;

[0015] Figure 6 This is an example of an invoice containing specific elements issued in the form of digital invoicing according to an embodiment of the present invention. DETAILED DESCRIPTION

[0016] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this application will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.

[0017] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0018] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices. The flowcharts shown in the accompanying drawings are merely exemplary and do not necessarily include all the contents and operations / steps, nor do they necessarily have to be executed in the order described. For example, some operations / steps may be further decomposed, while some operations / steps may be combined or partially combined, so the actual execution order may change according to the actual situation.

[0019] Those skilled in the art will appreciate that the drawings are merely schematic diagrams of example embodiments, and the modules or processes in the drawings are not necessarily necessary for implementing the present application, and therefore cannot be used to limit the scope of protection of the present application.

[0020] like Figure 1 As shown, in combination with an embodiment of the present invention, a method for generating a lightweight invoice format file is provided, comprising:

[0021] S101: Determine the type of invoice according to the invoice issuance request;

[0022] S102: Obtain nodes for generating invoice layout files according to the invoice type, and typeset each node and data items under each node according to the invoice layout file format specified by the tax bureau for the invoice type and based on the size of the invoice layout file;

[0023] S103: Fill in the corresponding node data for each node, and fill in the specific data item data for each data item under each node, so as to generate an invoice format file.

[0024] The lightweight invoice layout file generation method of the embodiment of the present invention describes the generation logic of the layout files of all types of invoices, determines the type of invoice according to the invoice issuance request, thereby obtaining the node for generating the invoice layout file used for the invoice of the type, and typesets each node and the data items under each node based on the invoice layout file format specified by the tax bureau for the invoice type and the size of the invoice layout file, and fills in the node data and data item data after typesetting, thereby generating the invoice layout file. There is no need to set the generation logic of the layout file for each type of invoice separately, and the generation logic is unified and simple, so that the enterprise can quickly generate the invoice layout file and issue the corresponding invoice when issuing the invoice.

[0025] Furthermore, in S102, obtaining a node for generating an invoice format file according to the invoice type includes:

[0026] S102-1: Obtain node data corresponding to the node for generating the invoice format file according to the invoice type, and clean the node data to form node data that can be converted to each other using different node data of the same node. Because the same type of invoice may have new and old versions, and the expression of the same node may be different, in order to issue the corresponding invoice, the different node data used by the same node are formed into node data that can be converted to each other, so that both the new and old versions of the invoice format files can be generated and issued.

[0027] Furthermore, in S102, according to the invoice layout file format specified by the tax bureau for the invoice type, each node and the data items under each node are laid out based on the size of the invoice layout file, including:

[0028] S102-2: According to the invoice layout file format specified by the tax bureau for the invoice type, the node position is marked for each node based on the size of the invoice layout file, and when the length of the node data corresponding to the node exceeds a first preset length, the node data is wrapped;

[0029] S102-3: According to the invoice file format prescribed by the tax bureau, mark the filling position of the data item under each node;

[0030] Because invoices are mainly composed of nodes and data items under the nodes, when generating an invoice layout file, first mark the node position and the data item mark filling position under the node according to the invoice layout file format and size specified by the tax bureau for this type of invoice, so as to fill in the node data and data item data later, and finally generate a valid invoice to display to the user.

[0031] S102-4: Determine whether to perform paging processing on the node data according to the position of each node, the position of the data items under each node, and the size of the invoice format file.

[0032] Different invoices carry different information, that is, different nodes and data items under nodes. Therefore, some invoices may not be able to carry all the information on one page, so it is necessary to determine whether to perform paging based on the node data itself. Because the paging logic has been determined by this method, when using this method, it is only necessary to determine whether to perform paging based on the invoice format and size specified for the invoice type.

[0033] Furthermore, the lightweight invoice format file generation method further includes:

[0034] S104: After typeset each node and the data items under each node based on the size of the invoice layout file, the lines of the invoice layout file are generated for each page according to the number of pages, and the ticket header and QR code image of the invoice layout file are inserted; after the positions of the nodes and the data items under the nodes are determined, the lines, ticket header and QR code image of the invoice layout file can be automatically inserted to form a complete invoice layout file.

[0035] In S103, the corresponding node data is filled in for each node, and specific data item data is filled in for each data item under the node, so that an invoice format file can be generated, including:

[0036] S103-1: Obtain node data and insert corresponding node data at corresponding positions;

[0037] S102-8: Obtain data item data, and input the data item data into the filling position of the data item under the corresponding node, wherein the data item data includes: invoice main information and invoice detail information. When there are specific elements in the node, the data item data also includes: specific element information.

[0038] Among them, specific elements refer to specific types under the invoice type, which extends the invoice type, such as agricultural products in digital electricity general invoices, or difference invoices, etc. The specific element information mainly includes: refined oil, rare earths, construction services, cargo transportation, real estate sales, real estate leasing, collection of vehicle and vessel use tax, tolls, passenger transportation, medical services, agricultural products, tractors and combine harvesters, motor vehicles, photovoltaic acquisition, and cigarettes.

[0039] After determining the node position and the filling position of the data item data, the node data and data item data are automatically inserted, with simple logic and easy implementation.

[0040] Furthermore, the lightweight invoice format file generation method further includes:

[0041] S104: If the invoice is issued in the form of a digital bill, after determining whether to perform paging processing on the node data based on the position of each node, the position of the data items under each node, and the size of the invoice format file, determine whether the number of remark lines exceeds the default number of remark lines. If so, add a remark page.

[0042] Invoices of different invoicing forms will be different, but there are also similarities. In the invoice layout file, no matter what type of invoice, the same logic can be used to process the same parts, but if there are different or special parts, they need to be processed separately. This can be achieved by following the business logic of the non-common parts set by our party, that is, first build the common business logic of the same parts in the invoice layout files of different invoicing forms and invoice types, and then build the non-common business logic of the different parts. For example, if there are different or special parts: for invoices issued in the form of digital invoices, you also need to pay attention to the remarks line. When the number of remarks lines exceeds the default number of remarks lines, add remarks pages.

[0043] Furthermore, in S102, each node and the data items under each node are typeset based on the size of the invoice format file, including:

[0044] S102-9: If an invoice is issued in the form of a digital bill, when a specific element node exists, the invoice details point is placed before the specific element node. This is a non-universal business logic for building different parts. The specific elements are as described above.

[0045] Furthermore, in S102-8, obtaining data item data and inputting the data item data into the filling position of the data item under the corresponding node includes:

[0046] If a non-digital electronic bill is used to issue an invoice, the invoice details under the invoice details point should be set according to the actual number of invoice detail lines. The invoice detail lines include the invoice details point and the invoice details under the invoice details point.

[0047] If the content of the invoice detail line exceeds the second preset length, if the invoice is an electronic invoice, the content of the invoice detail line will be wrapped, and if the invoice is a paper invoice, the font will be dynamically reduced to ensure that the content of the invoice detail line is in the same invoice detail line.

[0048] Currently, there are invoices issued in non-digital electronic invoice form and digital electronic invoice form. Different invoicing forms have different requirements for setting up invoice detail lines. This is a non-universal business logic for building different parts.

[0049] Furthermore, in S102-8, obtaining data item data and inputting the data item data into the filling position of the data item under the corresponding node includes:

[0050] If the invoice is issued in the form of digital bill, when filling in the invoice details under the invoice details point, set it according to the actual number of invoice detail lines, where the invoice detail lines include the invoice details point and the invoice details under the invoice details point;

[0051] If the content of the invoice detail line exceeds the third preset length, the content of the invoice detail line is wrapped.

[0052] Currently, there are invoices issued in non-digital electronic invoice form and digital electronic invoice form. Different invoicing forms have different requirements for setting up invoice detail lines. This is a non-universal business logic for building different parts.

[0053] Further, in S102-8, the acquiring of data item data and inputting of the data item data into the filling position of the data item under the corresponding node includes:

[0054] If the invoice has more than one page, the discount line and the corresponding discounted line are set on the same page, and the same content of the invoice detail information is set on the same page. This is the common business logic for building the same part.

[0055] Further, S103: filling in corresponding node data for each node, and filling in specific data item data for each data item under each node, can generate an invoice format file, including:

[0056] S103-1: After filling in the corresponding node data for each node and filling in the specific data item data for each data item under the node, when the invoice format file has multiple pages, merging the pages of the invoice format file to reduce the size of the invoice format file; and / or

[0057] S103-2: Delete invalid label data and delete duplicate font data to reduce the invoice format file size.

[0058] By implementing the above two steps separately or together, the size of the invoice layout file can be reduced to generate a lightweight invoice layout file, thereby solving the problem of the invoice layout file generated in the prior art being too large and occupying disk resources and network transmission bandwidth, and providing enterprises with a clear method for generating invoice layout files.

[0059] Further, S103: filling in corresponding node data for each node, and filling in specific data item data for each data item under each node, can generate an invoice format file, including:

[0060] S103-3: After filling in the corresponding node data for each node and filling in the specific data item data for each data item under the node, the entire ticket is electronically signed. This belongs to the general business logic of building the same part.

[0061] Furthermore, in S102, each node and the data items under each node are typeset based on the size of the invoice format file, including:

[0062] S102-10: Use the form of a standard file, and use the size of the invoice format file as a reference to typeset each node and the data items under each node to form a standard invoice format file. The standard file is small, which prevents over-rendering and does not contain excessive redundant data, thus reducing the size of the invoice format file and making the invoice format file a lightweight invoice format file.

[0063] S103: Fill in the corresponding node data for each node, and fill in the specific data item data for each data item under the node, so as to generate an invoice format file, including:

[0064] S103-4: Output the standard invoice format file in the form of a file stream;

[0065] S103-5: Convert the standard invoice format file in the form of a file stream into a visible invoice format file, which is a PDF format invoice format file.

[0066] In summary, the embodiment of the present invention groups and converts a series of node data that conform to the rules, and forms node data that can be converted to each other by different expressions of the same node; all node data are grouped and classified according to the format, and the general module is extracted to construct the general business logic for generating the invoice format file, and the non-general business logic is constructed to form the standard invoice format file. When the enterprise generates the invoice format file, the standard invoice format file is automatically generated and converted into a visible invoice format file, which is an invoice format file in pdf format. The general module refers to the business logic shared by different types of invoices, such as the generation of supervision stamps and QR code generation. The non-shared (non-general) parts are placed in the business layer of each type of invoice for logical processing. In addition, the embodiment of the present invention also describes the logic of how to reduce the size of the invoice format file. The enterprise storage format file solution is optimized, the enterprise disk resource occupation is reduced, the enterprise cost is saved, the format file generation speed is fast, and the generated file is small. Thereby solving the pain point of individuals or enterprises generating invoice format files at high cost.

[0067] 1. Types of Invoices

[0068] Based on a large number of real cases of corporate invoicing, the data is classified based on corporate needs, actual business scenarios of invoicing, invoice types, and specific factors. Invoice types are divided into two categories according to the issuance method:

[0069] One category is non-digital invoice types (that is, invoices issued using invoicing hardware, such as tax control disk, golden tax disk, etc.), namely: special value-added tax invoice, ordinary value-added tax invoice, motor vehicle sales unified invoice, used car sales unified invoice, value-added tax electronic ordinary invoice and value-added tax electronic special invoice, etc.

[0070] The other category is the types of digital invoices, which are: digital invoice (special value-added tax invoice), digital invoice (ordinary invoice), digital invoice (unified invoice for motor vehicle sales), digital invoice (unified invoice for used car sales), digital paper invoice (special value-added tax invoice), digital paper invoice (ordinary invoice), digital paper invoice (unified invoice for motor vehicle sales) and digital paper invoice (unified invoice for used car sales).

[0071] In addition, invoices containing specific elements refer to specific types under the invoice category, which extends the invoice category, such as agricultural products in digital electricity general invoices, or difference invoices, etc. The specific elements mainly include: refined oil, rare earth, construction services, cargo transportation, real estate sales, real estate leasing, collection of vehicle and vessel use taxes, tolls, passenger transportation, medical services, agricultural products, tractors and combine harvesters, motor vehicles, photovoltaic acquisition, and cigarettes.

[0072] 1. Non-digital invoice format files

[0073] When the non-digital electronic format file is generated, the specific elements are displayed in a fixed area between the invoice QR code and the invoice type with fixed labels. Figure 4 The overall layout does not change much. When generating specific element layout files, since some specific elements need to display different data items, it is necessary to differentiate the specific elements of this part, which is more in line with the enterprise usage scenarios. For example, when invoicing specific elements of agricultural products, it is necessary to differentiate the display of commodity tax rates and tax amounts. The tax rate cannot be displayed as 0%, but needs to be displayed according to the actual preferential policies enjoyed. Tax exemption needs to be displayed as tax exemption, and non-taxation needs to be displayed as non-taxation. If the tax amount is 0, it needs to be displayed as *.

[0075] The generation of layout files is based on various data items. Different node data is obtained through invoice types and specific elements. Generally, the data for generating layout files mainly includes the following nodes: invoice master information, invoice detail information, specific element information (storing different specific element data information), etc. For example, when generating layout files for electronic ordinary invoices, electronic special invoices, motor vehicle sales unified invoices, and used car sales unified invoices for enterprises, different layout files are mainly distinguished by invoice types. Different invoice types obtain data from different data nodes. For example, electronic ordinary invoices mainly obtain invoice master information nodes and invoice detail information nodes; motor vehicle sales unified invoices mainly obtain invoice master information nodes, invoice detail information nodes, and motor vehicle information nodes. Then, according to the format and rules specified by the tax bureau, the data is output to the layout file for display.

[0076] Among them, the invoice format and rules stipulated by the tax bureau are summarized as follows:

[0077] Invoice format file size: 210mm long, minimum height 140mm, fixed size, vertically divided into five parts: ticket header, seller and buyer, taxable details and total, remarks and ticket footer. The inner frame size excluding the ticket header and ticket footer is 201mm long and 94mm high.

[0078] When the invoice details do not exceed 8 lines, the invoice height is 140mm. When the invoice details exceed 8 lines, the invoice height is 140mm plus the height of the invoice details exceeding 8 lines.

[0079] Rules for adding ribbons to the right frame of the ticket:

[0080] A gold ribbon (RGB: R246, G237, B225) and a brown ribbon (RGB: R118, G89, B84) are added below the 1 / 2 of the right frame line on the ticket. The height of the ribbons is 0.54mm and the length is 1 / 2 of the right frame line.

[0081] In addition, the shape of the digital invoice supervision stamp is oval, and the display is 100% proportional: 30mm long, 20mm high, fixed size, 1mm high on the outer circle. A thin line is engraved on the inner circle, the font is Kaiti 7 pounds, and the printing color is bright red.

[0082] For the generation of layout files for non-digital electronic invoices, there are many scattered generation schemes that cannot be effectively sorted and merged. In the process of enterprises generating layout files, a large amount of sorting data is required and verified with existing scenarios. In order to facilitate enterprises to quickly generate layout files, the embodiments of the present invention have targeted tax industry layout file generation solutions and implementation logic, as well as corresponding optimization solutions.

[0083] Generation rules: The generation of non-digital electronic format files needs to be based on the format file tickets published by the tax bureau. Different ticket types, different detail lines, and different specific elements have different display styles.

[0084] First determine the ticket type, select the corresponding node data and data item data according to the ticket type, and then layout according to the number of detail lines. If there is a part in the detail line that exceeds the length, it needs to be wrapped. If it is a paper ticket, it does not need to be wrapped, and the font needs to be dynamically reduced. Paginate the data according to the processed data, and ensure that the discount line and the discounted line are on the same page, and ensure that the data of a single detail line is on the same page.

[0085] Combination Figure 2 , generating the invoice layout file is divided into the following steps:

[0086] 1. Clean the node data of the generated layout file to ensure the logical consistency of the subsequent generated layout file. For example, you need to set the default value, format the node data, because the text transmitted by different ticket types is inconsistent, it needs to be converted to a unified text, or the text transmitted in the ticket type needs to be compatible with the old version data due to historical version reasons, and the text description of unified semantics is called A before, and now it is called B, but in order to support A's data, data conversion is required.

[0087] 2. Obtain corresponding node data according to different ticket types.

[0088] 3. Wrap the node data that exceeds the length.

[0089] 4. Perform paging according to the processed node data, plan the node data items to be displayed on each page in advance, and layout the node data and data item data format.

[0090] 5. Generate layout file lines according to the number of pages, insert the node data of the invoice layout file, that is, the default text or fixed text (such as buyer information, seller information and amount, etc.), insert the ticket header of the invoice layout file, insert the QR code image, and enter specific data items, including: invoice main information, invoice detailed information and specific element information.

[0091] 6. Merge the pages of the layout file, delete invalid user tag data (which is the default value when the layout file is generated) and duplicate font data (processed in the business logic, involving the entire business process operation) to reduce the size of the layout file, and electronically sign the entire ticket, that is, the corporate seal, and output it in the form of a file stream to prevent excessive rendering and cause business complexity.

[0092] Examples of VAT electronic general invoices issued in the form of non-digital invoicing are as follows: Figure 4 shown.

[0093] 2. Digital invoice format file

[0094] (I) Invoice format files for non-specific elements of digital

[0095] For enterprises, digital electrical ordinary invoices, digital electrical special invoices, digital electrical motor vehicle sales unified invoices, digital electrical second-hand car sales, etc. are jointly formed into invoice layout files, and the node data is output to the layout files according to fixed formats and rules; in addition, the digital electrical invoice layout files have newly added characteristic stripes to distinguish digital electrical and non-digital electrical invoice layout files, that is, digital electrical invoices have an additional color ribbon to distinguish them from non-digital electrical invoices.

[0096] Specifically, for invoices issued in digital form, the invoice format file needs to be generated according to the format file face published by the tax bureau. Different invoice types and different invoice detail lines have different display styles. Compared with non-digital format files, the electronic signature is removed and an anti-counterfeiting verification ribbon is added to distinguish between new and old format files.

[0097] Generation rules: First determine the invoice type, select the corresponding node data and format according to the invoice type, and then layout according to the number of invoice detail lines. If the invoice detail line exceeds the third preset length, it needs to be wrapped. Paginate the data according to the processed data, and ensure that the discount line and the discounted line are on the same page, and ensure that the data of a single invoice detail line is on the same page. Compared with non-digital invoice layout files, since the tax bureau vigorously promotes digital files, in order to standardize the invoice layout files, the paper invoice removes the logic of reducing the font size of the detail line text display, and standardizes the layout file generation specifications.

[0098] Combination Figure 3 , generating the invoice layout file is divided into the following steps:

[0099] 1. Perform data cleaning based on the node data of the generated layout file to ensure the consistency of the subsequent generated logic rules. For example, you need to set default values ​​and format node data because the text transmitted by different ticket types is inconsistent and needs to be converted to a unified text, or the text transmitted in the ticket type needs to be compatible with the old version data due to historical version reasons and unified semantic text description. It was called A before and is now called B, but in order to support A's data, data conversion is required.

[0100] 2. Obtain corresponding node data according to different ticket types.

[0101] 3. Wrap the node data that exceeds the length.

[0102] 4. Perform paging according to the processed node data, plan the node data items that need to be displayed on each page in advance, and layout the format of node data and data item data.

[0103] 5. Generate layout file lines according to the number of pages, insert the node data of the invoice layout file, that is, the default text or fixed text (such as buyer information, seller information, amount, etc.), insert the ticket header of the invoice layout file, insert the QR code image, and enter specific data items, including: invoice main information, invoice detail information and specific element information.

[0104] 6. Based on the paginated data, determine whether to add a new note page. If the data exceeds the default number of note lines, a new note page needs to be added to display the excess note information.

[0105] 7. Merge the pages of the layout file, delete invalid user tag data (which is the default value when the layout file is generated) and duplicate font data (processed in the business logic and involves the entire business process operation) to reduce the size of the layout file, and electronically sign the entire ticket, that is, the corporate seal, and output it in the form of a file stream to prevent excessive rendering and cause business complexity.

[0106] Examples of invoices with non-specific elements issued in the form of digital invoicing include: Figure 5 shown.

[0107] (II) Invoice format files for specific elements of digital

[0108] Generate template files for enterprises' invoices with specific elements for digital electronics, such as medical services, passenger transportation, etc. The generation of invoice template files is based on the above-mentioned digital electronics non-specific element generation method, but the display styles of different specific element data are different, and they need to be displayed according to fixed business specifications.

[0109] When enterprises generate data, they need to generate it based on fixed business specifications. Specific elements not described in the present invention cannot generate layout files. Specific elements not described in the embodiments of the invention obtain newly appeared specific elements, and customized processing can be performed based on the newly added specific element data.

[0110] Specifically, the invoice template file issued in digital form and containing specific elements needs to be generated according to the invoice template file face of the specific elements published by the tax bureau. Different specific elements and different invoice detail lines are displayed in different styles. Compared with the invoice template file in digital form, some specific elements may require a separate data list to be stored and displayed on the template file. Therefore, the mixed display of multiple data (both the main invoice information and the specific element information) is a major difficulty in generating the invoice template file.

[0111] Generation rules: Prioritize specific elements, select corresponding node data and formats according to specific elements, and then layout according to the number of invoice detail lines or data items corresponding to specific elements. If there is a part of the invoice detail line or data item corresponding to a specific element that exceeds the length, it needs to be wrapped. Pagination is performed based on the data after wrapping. It is necessary to ensure that the discount line and the discounted line are on the same page, and that the data of a single detail line is on the same page. Compared with the digital invoice format file, since the tax bureau vigorously promotes digital files, in order to standardize the format file, the paper ticket removes the logic of reducing the font and standardizes the format file generation specifications.

[0112] Combination Figure 3 , generating the invoice layout file is divided into the following steps:

[0113] 1. Perform data cleaning based on the node data of the generated layout file to ensure the consistency of the subsequent generated logic rules. For example, you need to set default values ​​and format node data because the text transmitted by different ticket types is inconsistent and needs to be converted to a unified text, or the text transmitted in the ticket type needs to be compatible with the old version data due to historical version reasons and unified semantic text description. It was called A before and is now called B, but in order to support A's data, data conversion is required.

[0114] 2. Obtain corresponding node data based on different ticket types and specific elements.

[0115] 3. Wrap the node data that exceeds the length.

[0116] 4. Perform paging processing based on the node data after line break processing, plan the node data items that need to be displayed on each page in advance, and format the data.

[0117] 5. Sort the specific element nodes and the invoice details, and place the invoice details before the specific element data.

[0118] 6. Generate layout file lines according to the number of pages, insert the node data of the invoice layout file, that is, the default text or fixed text (such as buyer information, seller information, amount, etc.), insert the ticket header of the invoice layout file, insert the QR code image, and enter specific data items, including: invoice main information, invoice detail information and specific element information.

[0119] 7. Based on the paginated data, determine whether to add a new note page. If the data exceeds the default number of note lines, a new note page needs to be added to display the excess note information.

[0120] 8. Merge the pages of the layout file, delete invalid user tag data (which is the default value when the layout file is generated) and duplicate font data (processed in the business logic and involves the entire business process operation) to reduce the size of the layout file, and electronically sign the entire ticket, that is, the corporate seal, and output it in the form of a file stream to prevent excessive rendering and cause business complexity.

[0121] An example of an invoice issued in the form of digital invoicing with specific elements is: Figure 6 shown.

[0122] The beneficial technical effects achieved by the embodiments of the present invention are as follows:

[0123] 1. Automatically paginate for different ticket types, specific elements, and detail lines;

[0124] 2. Dynamically adjust the number of detail rows per page when data is generated and output to the layout file;

[0125] 3. Automatically generate layout files to simplify enterprise access;

[0126] 4. Reduce the size of layout files, facilitate enterprise storage and transmission, reduce storage space, reduce network transmission size, greatly save enterprise costs and improve enterprise efficiency;

[0127] 5. Enterprises can access the system easily according to the instruction document, and then use the method of the embodiment of the present invention to automatically fill in data according to the specifications of the tax bureau, without having to pay special attention to different types of invoices, different specific elements, and different detailed lines of data, and generate various required invoice format files. This saves enterprise costs and improves enterprise benefits;

[0128] 6. Based on the method in the embodiment of the present invention, the enterprise can make a secondary expansion design according to the newly added ticket types or node data, and carry out horizontal expansion for the enterprise for the newly added specific elements.

[0129] The exemplary embodiments of the present invention are specifically shown and described above. It should be understood that the present invention is not limited to the detailed structure, configuration or implementation method described herein; on the contrary, the present invention is intended to cover various modifications and equivalent configurations included in the spirit and scope of the appended claims.

Claims

1. A method for generating an invoice format file, characterized in that: include: Determine the invoice type based on the invoice issuance request; Obtain the node for generating the invoice layout file according to the invoice type, and typeset each node and the data items under each node according to the invoice layout file format specified by the tax bureau for the invoice type and based on the size of the invoice layout file; By filling in the corresponding node data for each of the nodes and filling in the specific data item data for the data items under each node, an invoice format file can be generated.

2. The method for generating an invoice format file according to claim 1, characterized in that: The node for obtaining and generating an invoice format file according to the invoice type includes: The node data corresponding to the node for generating the invoice format file is obtained according to the invoice type, and the node data is cleaned to form node data that can be converted to each other through the construction of different node data used by the same node.

3. The method for generating an invoice format file according to claim 1, characterized in that: The invoice layout file format specified by the tax bureau for the invoice type and the size of the invoice layout file are used as a reference to layout each node and the data items under each node, including: According to the invoice layout file format specified by the tax bureau for the invoice type, the node position is marked for each node based on the size of the invoice layout file, and when the length of the node data corresponding to the node exceeds a first preset length, the node data is wrapped; According to the invoice file format prescribed by the tax bureau, mark the data item under each node and fill in the position; Whether to perform paging processing on the node data is determined according to the position of each node, the position of the data items under each node, and the size of the invoice format file.

4. The method for generating an invoice format file according to claim 1, characterized in that: Also includes: After typeset each node and the data items under each node based on the size of the invoice format file, generate lines of the invoice format file for each page according to the number of pages, and insert the ticket header and QR code image of the invoice format file; The step of filling in the corresponding node data for each node and filling in the specific data item data for each data item under the node to generate an invoice format file includes: Get node data and insert corresponding node data at the corresponding position; Obtain data item data, and input the data item data into the filling position of the data item under the corresponding node, wherein the data item data includes: invoice main information and invoice detail information, and when there are specific elements in the node, the data item data also includes: specific element information.

5. The method for generating an invoice format file according to claim 3, characterized in that: Also includes: If an invoice is issued in the form of a digital bill, after determining whether to perform paging on the node data based on the position of each node, the position of the data items under each node, and the size of the invoice format file, determine whether the number of remark lines exceeds the default number of remark lines. If so, add a remark page.

6. The method for generating an invoice format file according to claim 4, characterized in that: The layout of each node and the data items under each node based on the size of the invoice format file includes: If an invoice is issued in the form of a digital bill, when a specific element node exists, the invoice detail point should be placed before the specific element node.

7. The method for generating an invoice format file according to claim 4, characterized in that: The step of obtaining the data item data and inputting the data item data into the filling position of the data item under the corresponding node includes: If a non-digital electronic bill is used to issue an invoice, the invoice details under the invoice details point should be set according to the actual number of invoice detail lines. The invoice detail lines include the invoice details point and the invoice details under the invoice details point. If the content of the invoice detail line exceeds the second preset length, if the invoice is an electronic invoice, the content of the invoice detail line will be wrapped, and if the invoice is a paper invoice, the font will be dynamically reduced to ensure that the content of the invoice detail line is in the same invoice detail line.

8. The method for generating an invoice format file according to claim 4, characterized in that: The step of obtaining the data item data and inputting the data item data into the filling position of the data item under the corresponding node includes: If the invoice is issued in the form of digital bill, when filling in the invoice details under the invoice details point, set it according to the actual number of invoice detail lines, where the invoice detail lines include the invoice details point and the invoice details under the invoice details point; If the content of the invoice detail line exceeds the third preset length, the content of the invoice detail line is wrapped.

9. The method for generating an invoice format file according to claim 4, characterized in that: The step of obtaining the data item data and inputting the data item data into the filling position of the data item under the corresponding node includes: If the invoice has more than one page, the discount line and the corresponding discounted line are set on the same page, and the same content of the invoice detail information is set on the same page.

10. The method for generating an invoice format file according to claim 1, characterized in that: The corresponding node data is filled in for each node, and the specific data item data is filled in for each data item under the node, so that an invoice format file can be generated, including: After filling in the corresponding node data for each node and filling in the specific data item data for each data item under each node, when the invoice format file has multiple pages, the invoice format file is processed by merging the pages to reduce the size of the invoice format file; and / or Remove invalid label data and remove duplicate font data to reduce invoice layout file size.

11. The method for generating an invoice format file according to claim 1, characterized in that: The corresponding node data is filled in for each node, and the specific data item data is filled in for each data item under the node, so that an invoice format file can be generated, including: After filling in the corresponding node data for each node and filling in the specific data item data for each data item under the node, the entire ticket is electronically signed.

12. The method for generating an invoice format file according to claim 1, characterized in that: The layout of each node and the data items under each node based on the size of the invoice format file includes: In the form of a standard file, each node and the data items under each node are typeset based on the size of the invoice format file to form a standard invoice format file; The corresponding node data is filled in for each node, and the specific data item data is filled in for each data item under the node, so that an invoice format file can be generated, including: Output the standard invoice format file in the form of file stream; Convert the standard invoice format file in the form of file stream into a visual invoice format file.