Method for preventing repeated invoicing and invoicing system
By marking abnormal orders in the invoicing system and periodically querying the tax system to confirm the order status, the repeated invoice issue caused by network abnormalities is solved, and the accuracy and system stability of the invoicing business are improved.
Patent Information
- Application Number
- CN202411294706.3
- 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
Existing invoicing systems may cause duplicate invoicing problems when network timeout, network instability, or return unknown exceptions.
Generate an invoice order request in the invoice system, generate an invoice request flow number, and mark the order as an abnormal order when receiving a notification other than the successful or failure of the invoice, set the order status to suspected invoice has been issued, prevent repeated invoices, and pass Periodically check the relevant tax system to confirm the order status within the preset time period.
It effectively avoids the risk of repeated invoices caused by network abnormalities, ensures the accuracy and reliability of invoice business, reduces manual intervention, and improves system stability.
Smart Images

Figure CN119228459A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electronic invoicing, and in particular to a method for preventing duplicate invoicing and an invoicing system. Background Art
[0002] In the current invoicing system, when interacting with the tax bureau's Leqi system, the data exchange serial number or request serial number needs to be passed in the request message to prevent duplicate invoices. However, in some scenarios, such as network timeout, network instability, or unknown exceptions, the invoicing system may initiate an invoicing request again, resulting in duplicate invoicing. Summary of the invention
[0003] The present invention provides a method and an invoicing system for preventing duplicate invoicing, which can solve the problem in the prior art that when the network times out, the network is unstable or an unknown exception is returned, the invoicing system may initiate an invoicing request again, resulting in duplicate invoicing.
[0004] To achieve the above-mentioned purpose, the first aspect of the present invention provides a method for preventing duplicate invoicing, comprising:
[0005] Step 1: Generate an invoicing order request in the invoicing system on the enterprise side, generate an invoicing request serial number for the order, and form invoicing information. The invoicing information includes the invoicing request serial number and the time of the invoicing order request;
[0006] Step 2: Based on the invoicing information, the invoicing system is connected to the relevant tax system to issue a digital invoice. When the invoicing system receives a notification other than a successful invoicing or a failed invoicing, the order is marked as an abnormal order, and the order status of the digital invoice is set to suspected invoicing within a preset time period. The starting point of the preset time period is the time when the invoicing order request is generated;
[0007] Step 3: Add the abnormal order and the corresponding invoicing information to the order abnormality list of the invoicing system;
[0008] Step 4: Based on the invoicing information, periodically determine at specified time intervals whether the digital invoice corresponding to the abnormal order in the order exception list has been successfully or failed to be issued in the relevant tax system.
[0009] In a second aspect of the present invention, it also relates to an invoicing system for preventing duplicate invoicing, the invoicing system belongs to the enterprise side, and the invoicing system includes:
[0010] An order generating unit, used to generate an invoicing order request, generate an invoicing request serial number for the order, and form invoicing information, wherein the invoicing information includes the invoicing request serial number and the time of the invoicing order request;
[0011] The invoicing unit is used to connect to the relevant tax system to issue digital invoices based on the invoicing information;
[0012] an exception handling unit, for marking an order as an abnormal order when receiving a notification other than a successful invoicing or a failed invoicing, and setting the order status of the digital invoice to suspected invoicing within a preset time period, where the starting point of the preset time period is the time when the invoicing order request is generated; and,
[0013] Add abnormal orders and corresponding invoicing information to the order exception list;
[0014] The checking unit is used to periodically determine whether the digital invoice corresponding to the abnormal order in the order abnormality list has been successfully or failed to be issued in the relevant tax system based on the invoicing information at a specified time interval.
[0015] Advantageous effects of the present invention: Because the success or failure of invoicing is accurate information, and the notifications other than the success or failure of invoicing are irrelevant to the success or failure of invoicing, the clear status of invoicing cannot be clearly determined, and the invoicing may fail or succeed. But in fact, the digital invoice cannot be seen at that time. In the prior art, the staff usually handles it according to the failure of invoicing and re-invoices, which has the risk of re-invoicing the digital invoice. Therefore, when the invoicing system receives a notification other than the success or failure of invoicing, the order status of the digital invoice is set to suspected invoicing within the preset time period, and the corresponding order is locked, and the invoicing cannot be performed within the preset time period, so as to avoid the risk of repeated invoicing caused by re-invoicing and cause unnecessary trouble. The preset time period is a buffer means, so that there is enough time to solve abnormal events such as network abnormality, network instability, network timeout, or other various unknown abnormalities, so that it can be determined whether the digital invoice is successful or failed. Therefore, in the preset time period corresponding to the abnormal order, it is periodically determined in the relevant tax system at a specified time interval whether the corresponding digital invoice has been issued. If the invoicing is successful, the order status of the order is updated to "invoicing successful". If the invoicing fails, the order status of the order is updated to "invoicing failed" and the order can be invoiced again, so there will be no duplicate invoicing. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] 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.
[0017] Figure 1 is a flow chart of a method for preventing duplicate invoicing according to an embodiment of the present invention;
[0018] Figure 2 It is a logical structure diagram of an invoicing system for preventing duplicate invoicing according to an embodiment of the present invention;
[0019] Figure 3 It is the sequential steps of the billing stage of the embodiment of the present invention;
[0020] Figure 4 This is an automatic processing flow for abnormal orders within abnormal orders in an embodiment of the present invention. DETAILED DESCRIPTION
[0021] 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.
[0022] 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.
[0023] 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.
[0024] 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.
[0025] like Figure 1 As shown, in combination with an embodiment of the present invention, a method for preventing duplicate invoicing is provided, comprising:
[0026] Step 1: Generate an invoicing order request in the invoicing system on the enterprise side, generate an invoicing request serial number for the order, and form invoicing information. The invoicing information includes the invoicing request serial number and the time of the invoicing order request; generate an invoicing request serial number for the invoicing order, so that the corresponding order can be tracked according to the request serial number until the invoicing is successful.
[0027] Step 2: Based on the invoicing information, the invoicing system is connected to the relevant tax system to issue a digital invoice. When the invoicing system receives a notification other than a successful invoicing or a failed invoicing, the order is marked as an abnormal order, and the order status of the digital invoice is set to suspected invoicing within a preset time period. The starting point of the preset time period is the time when the invoicing order request is generated; because the successful invoicing or failed invoicing is accurate information, and notifications other than successful invoicing or failed invoicing, such as: network anomalies, network instability, network timeout, or other unknown anomalies, are not related to the successful or failed invoicing, and the exact status of the invoicing cannot be determined. Maybe the invoicing failed, maybe the invoicing succeeded. But in fact, the digital invoice could not be seen at the time. In the prior art, the staff usually handled it as a failed invoicing and re-issued the invoice, which posed the risk of re-issuing the digital invoice. Therefore, when the invoicing system receives a notification other than successful or failed invoicing, the order status of the digital invoice is set to suspected invoiced within a preset time period, and the corresponding order is locked. Invoicing cannot be performed within the preset time period, avoiding the risk of duplicate invoicing caused by re-invoicing and causing unnecessary trouble.
[0028] Step 3: Add the abnormal order and the corresponding invoicing information to the order exception list of the invoicing system.
[0029] Step 4: Based on the invoicing information, periodically determine at specified time intervals whether the digital invoice corresponding to the abnormal order in the order exception list has been successfully issued or failed in the relevant tax system. The preset time period is a buffering means, so that there is enough time for abnormal events such as network abnormalities, network instability, network timeouts, or various other unknown abnormalities to be resolved, so that it can be determined whether the digital invoice is successfully issued or failed. Therefore, in the preset time period corresponding to the abnormal order, it is periodically determined in the relevant tax system at specified time intervals whether the corresponding digital invoice has been issued. If the invoicing is successful, the order status of the order is updated to successful invoicing. Or if the invoicing fails, the order status of the order is updated to failed invoicing, and the invoicing can be performed again, so there will be no duplicate invoicing.
[0030] Preferably, the method for preventing duplicate invoicing further includes:
[0031] Step 5: After the invoicing order request is generated in the invoicing system, the anti-duplicate mechanism based on the seller's corporate tax number is enabled for the order, and the seller's corporate tax number and the anti-duplicate mechanism based on the seller's corporate tax number are recorded in the invoicing information. Because the invoice issuer is usually the seller, each seller has a unique corporate tax number. The anti-duplicate mechanism for the order is enabled based on the seller's corporate tax number, which is used to mark the order corresponding to the digital invoice as an abnormal order, set the order status of the abnormal order to suspected invoice in a preset time period, and further query the corresponding invoice master information in the relevant tax system through the seller's corporate tax number, so as to finally confirm whether the digital invoice corresponding to the abnormal order has been successfully issued in the relevant tax system.
[0032] Furthermore, the method for preventing duplicate invoicing also includes:
[0033] Step 6: In the invoicing information, set up additional element information that is unique and does not overlap with other digital invoices for the digital invoice corresponding to the order. The additional element information is used to issue the digital invoice. After marking the order corresponding to the digital invoice as an abnormal order, when checking whether there is a corresponding invoice in the relevant tax system through the seller's corporate tax number, it is impossible to determine which digital invoice corresponds to the order because there may be digital invoices with completely identical information. The additional element information that is unrelated to the digital invoice itself and uniquely supplements it can be distinguished.
[0034] Furthermore, in step 6, additional element information is set for the digital invoice corresponding to the order, which is unique and does not overlap with other digital invoices, including:
[0035] The invoice request serial number is set as the additional element information of the digital invoice. Since the invoice request serial number uniquely corresponds to the order and is unique, it can distinguish different orders in the invoice information and be used as additional element information for the second time, achieving two goals at one stroke.
[0036] Furthermore, in step 2, the invoicing system is connected to the relevant tax system to issue a digital invoice, including:
[0037] The invoice issuance interface of the invoicing system is connected to the relevant tax system to issue digital invoices. The relevant tax system can be the tax bureau's enterprise system. The invoice issuance interface is an API call interface. Connecting to the relevant tax system through the API call interface improves the flexibility of the invoicing system in obtaining data, and has scalability, reduces overhead and simplifies the integration of the invoicing system.
[0038] Further, step 4 includes:
[0039] Step 41: Periodically query the order exception list at specified time intervals, and for each abnormal order, determine whether it is an abnormal order and enable an anti-duplicate mechanism based on the seller's corporate tax number; enable the anti-duplicate mechanism for the order based on the seller's corporate tax number, and when marking the order corresponding to the digital invoice as an abnormal order, the order status of the abnormal order can be set to suspected invoiced within a preset time period to avoid duplicate issuance of digital invoices.
[0040] Step 42: If the anti-duplicate mechanism based on the seller's corporate tax number is enabled for abnormal orders, the main information corresponding to the invoices issued within the preset time period corresponding to the abnormal orders is queried in the relevant tax system through the invoicing system based on the seller's corporate tax number. Each invoice corresponds to a message, and one message includes all the main information of the invoice.
[0041] Step 43: For each message, compare the invoicing information of the abnormal order level by level to determine whether the digital invoice corresponding to the abnormal order has been successfully issued or failed in the relevant tax system. By comparing level by level, if the current level comparison is unsuccessful, the subsequent level comparison can be stopped, saving time and improving efficiency.
[0042] Furthermore, in step 42, according to the corporate tax number of the seller, the invoicing system searches the relevant tax system for the master information corresponding to the invoice issued within the preset time period corresponding to the abnormal order, including:
[0043] Through the invoice list query interface of the invoicing system, according to the corporate tax number of the seller, the main information corresponding to the invoice issued within the preset time period corresponding to the abnormal order is queried in the relevant tax system. Among them, the invoice list query interface is an API call interface. Connecting to the relevant tax system through the API call interface improves the flexibility of the invoicing system in obtaining data, and has scalability, reduces overhead and simplifies system integration.
[0044] Further, step 43 includes:
[0045] Step 43-1: Compare the invoice master information of the abnormal order with all the invoice master information in each message one by one. The invoice master information includes at least: invoice number, invoice type, invoice type, seller's corporate tax number, buyer's taxpayer identification number, buyer's name and total tax amount; the invoice master information refers to the core information of the digital invoice, which can reflect the main information characteristics of the invoice. Therefore, when comparing the levels layer by layer, the core information of the digital invoice is compared as the first level. When the core information comparison fails, the subsequent levels will no longer be compared, saving time and improving efficiency.
[0046] Step 43-2: When the invoice master information of the abnormal order is matched with all the invoice master information in any message, the invoice detail data corresponding to the invoice number is queried in the relevant tax system through the invoicing system based on the invoice number in the matched invoice master information. The invoice detail data includes additional element information; when the core information is successfully matched, the second-level invoice information is compared, thus saving time and improving efficiency.
[0047] Step 43-3: Compare the additional element information of the abnormal order with the additional element information in the invoice details. If the additional element information of the abnormal order is consistent with the additional element information in the invoice details, it indicates that the digital invoice has been successfully issued in the relevant tax system; because the additional element information is unique, if the additional element information is consistent with the main information of the invoice, it indicates that the digital invoice in the relevant tax system is the digital invoice corresponding to the abnormal order. Because the additional element information is unique, there is no need to compare all the remaining invoice details one by one, thus saving time and improving efficiency.
[0048] Step 43-4: Set the order status of the digital invoice to successful invoicing; mark the order as an abnormal order within the preset time period, and periodically determine the digital invoice to be queried in the relevant tax system at specified time intervals, and successfully issue it within the preset time period to avoid the situation of repeated invoicing due to immediate re-issuance at that time.
[0049] Furthermore, in step 43-2, the invoice details corresponding to the invoice number are queried in the relevant tax system through the invoicing system, including:
[0050] Through the single invoice query interface of the invoicing system, the invoice detail data corresponding to the invoice number can be queried in the relevant tax system. The single invoice query interface is an API call interface. Connecting to the relevant tax system through the API call interface improves the flexibility of the invoicing system in obtaining data, and has scalability, reduces overhead and simplifies system integration.
[0051] Furthermore, the method for preventing duplicate invoicing also includes:
[0052] Step 45: When the additional element information of the abnormal order is inconsistent with the additional element information in the invoice detail data, check whether there is an unmatched message; for the unmatched message, jump to step 43.
[0053] Step 43: It also includes that when at the end of the preset time period of the abnormal order, when the additional element information of the abnormal order is inconsistent with the additional element information in the invoice details corresponding to any message, it indicates that the digital invoice fails to be issued in the relevant tax system. Then the failed digital invoice can be issued again without causing duplicate invoices.
[0054] like Figure 2 As shown, in combination with an embodiment of the present invention, an invoicing system for preventing duplicate invoicing is provided, the invoicing system belongs to the enterprise end, and the invoicing system includes:
[0055] The order generation unit 21 is used to generate an invoicing order request, generate an invoicing request serial number for the order, and form invoicing information, wherein the invoicing information includes the invoicing request serial number and the time of the invoicing order request; the invoicing request serial number is generated for the invoicing order, so that the corresponding order can be tracked according to the request serial number until the invoicing is successful.
[0056] The invoicing unit 22 is used to connect to the relevant tax system to issue a digital invoice based on the invoicing information;
[0057] The exception handling unit 23 is used to mark the order as an abnormal order when receiving a notification other than a successful or failed invoicing, and set the order status of the digital invoice to suspected invoicing within a preset time period, and the starting point of the preset time period is the time when the invoicing order request is generated; and, add the abnormal order and the corresponding invoicing information to the order exception list; because the successful or failed invoicing are accurate information, and the notifications other than the successful or failed invoicing, such as: network anomalies, network instability, network timeout, or other various unknown anomalies, are not related to the successful or failed invoicing, and the definite status of the invoicing cannot be clearly determined, and the invoicing may fail or succeed. But in fact, the digital invoice could not be seen at that time. In the prior art, the staff usually handles the invoicing as a failed invoicing and re-issues the invoice, which has the risk of re-issuing the digital invoice. Therefore, when the invoicing system receives a notification other than successful or failed invoicing, the order status of the digital invoice is set to suspected invoiced within a preset time period, and the corresponding order is locked. Invoicing cannot be performed within the preset time period, avoiding the risk of duplicate invoicing caused by re-invoicing and causing unnecessary trouble.
[0058] The checking unit 24 is used to periodically determine whether the digital invoice corresponding to the abnormal order in the order exception list has been successfully issued or failed in the relevant tax system based on the invoicing information at a specified time interval. The preset time period is a buffering means, so that there is enough time for abnormal events such as network abnormalities, network instability, network timeouts, or various other unknown abnormalities to be resolved, so that it can be determined whether the digital invoice is successfully issued or failed. Therefore, in the preset time period corresponding to the abnormal order, it is periodically determined in the relevant tax system at a specified time interval whether the corresponding digital invoice has been issued. If the invoicing is successful, the order status of the order is updated to be successful invoicing. Or if the invoicing fails, the order status of the order is updated to be failed invoicing, and the invoicing can be performed again, so that duplicate invoicing will not be caused.
[0059] Furthermore, the order generation unit 21 is also used to enable an anti-duplicate mechanism based on the seller's corporate tax number for the order after generating an invoicing order request, and record the seller's corporate tax number and the anti-duplicate mechanism based on the seller's corporate tax number enabled for the order in the invoicing information. Because the invoice issuer is usually the seller, each seller has a unique corporate tax number, and the anti-duplicate mechanism for the order is enabled based on the seller's corporate tax number, which is used to mark the order corresponding to the digital invoice as an abnormal order, set the order status of the abnormal order to suspected invoicing within a preset time period, and further query the corresponding invoice master information in the relevant tax system through the seller's corporate tax number, so as to finally confirm whether the digital invoice corresponding to the abnormal order has been successfully issued in the relevant tax system.
[0060] Furthermore, the order generation unit 21 is also used to set additional element information that is unique and does not overlap with other digital electronic invoices for the digital electronic invoice corresponding to the order in the invoicing information, and the additional element information is used to be issued in the digital electronic invoice. After marking the order corresponding to the digital electronic invoice as an abnormal order, when the seller's corporate tax number is used to query whether there is a corresponding invoice in the relevant tax system, because there may be digital electronic invoices with completely identical information, it is impossible to determine which digital electronic invoice corresponds to the order, and the additional element information that is unrelated to the digital electronic invoice itself and uniquely supplements it can be distinguished.
[0061] Furthermore, the order generating unit 21 is specifically configured to:
[0062] The invoice request serial number is set as the additional element information of the digital invoice. Since the invoice request serial number uniquely corresponds to the order and is unique, it can distinguish different orders in the invoice information and be used as additional element information for the second time, achieving two goals at one stroke.
[0063] Furthermore, the order generating unit 21 is specifically configured to:
[0064] The invoice issuance interface is connected to the relevant tax system to issue digital invoices. The relevant tax system can be the tax bureau's enterprise system. The invoice issuance interface is an API call interface. Connecting to the relevant tax system through the API call interface improves the flexibility of the invoicing system in obtaining data, and has scalability, reduces overhead and simplifies the integration of the invoicing system.
[0065] Further, the checking unit 24 includes:
[0066] The scheduled query sub-unit is used to periodically query the order exception list at specified time intervals. For each abnormal order, it is determined whether it is an abnormal order and an anti-duplicate mechanism based on the seller's corporate tax number is activated; the anti-duplicate mechanism for the order is activated based on the seller's corporate tax number. When the order corresponding to the digital invoice is marked as an abnormal order, the order status of the abnormal order can be set to suspected invoice issued within a preset time period to avoid duplicate issuance of digital invoices.
[0067] The first data acquisition sub-unit is used to query the main information of invoices issued within a preset time period corresponding to the abnormal order in the relevant tax system according to the seller's corporate tax number if an anti-duplicate mechanism based on the seller's corporate tax number is enabled for the abnormal order. Each invoice corresponds to a message, and one message includes all the main information of the invoice.
[0068] The data comparison subunit is used to compare each message based on the invoicing information of the abnormal order, and determine whether the digital invoice corresponding to the abnormal order has been successfully issued or failed in the relevant tax system. Through level-by-level comparison, if the comparison at the current level is unsuccessful, the comparison at the subsequent levels can be discontinued, saving time and improving efficiency.
[0069] Furthermore, the timing query subunit is specifically used for:
[0070] Through the invoice list query interface, according to the seller's corporate tax number, the main information corresponding to the invoice issued within the preset time period corresponding to the abnormal order can be queried in the relevant tax system. Among them, the invoice list query interface is an API call interface. Connecting to the relevant tax system through the API call interface improves the flexibility of the invoicing system in obtaining data, and has scalability, reduces overhead and simplifies system integration.
[0071] Furthermore, the checking unit 24 further includes a second data acquisition subunit, and the data comparison subunit includes a first data comparison module and a second data comparison module, wherein:
[0072] The first data comparison module is used to compare the invoice master information of the abnormal order with all the invoice master information in each message one by one. The invoice master information includes at least one of the following: invoice number, invoice type, invoice type, seller's corporate tax number, buyer's taxpayer identification number, buyer's name and total tax amount; the invoice master information refers to the core information of the digital invoice, which can reflect the main information characteristics of the invoice. Therefore, when comparing level by level, the core information of the digital invoice is compared as the first level. When the core information comparison fails, the subsequent levels will no longer be compared, saving time and improving efficiency.
[0073] The second data acquisition sub-unit is used to query the invoice detail data corresponding to the invoice number in the relevant tax department according to the invoice number in the matched invoice master information when the invoice master information of the abnormal order is consistent with all the invoice master information in any message. The invoice detail data includes additional element information; when the core information is successfully matched, the second-level invoice information is compared, thereby saving time and improving efficiency.
[0074] The second data comparison module is used to compare the additional element information of the abnormal order with the additional element information in the invoice detail data. When the additional element information of the abnormal order is consistent with the additional element information in the invoice detail data, it indicates that the digital invoice has been successfully issued in the relevant tax system; because the additional element information is unique, if the additional element information is consistent when the main invoice information is consistent, it indicates that the digital invoice in the relevant tax system is the digital invoice corresponding to the abnormal order. Because the additional element information is unique, there is no need to compare all the remaining invoice details one by one, thus saving time and improving efficiency.
[0075] The exception handling unit 23 is also used to set the order status of the digital electronic invoice to successful invoicing; mark the order as an abnormal order within a preset time period, periodically determine the digital electronic invoice to be queried in the relevant tax system at specified time intervals, and successfully issue it within the preset time period to avoid the situation of repeated invoicing due to immediate re-issuance at that time.
[0076] Furthermore, the second data acquisition subunit is specifically used for:
[0077] Through the single invoice query interface, the invoice detail data corresponding to the invoice number can be queried in the relevant tax system. The single invoice query interface is an API call interface. Connecting to the relevant tax system through the API call interface improves the flexibility of the invoicing system in obtaining data, and has scalability, reduces overhead and simplifies system integration.
[0078] Furthermore, the checking unit 24 also includes a message checking subunit, wherein:
[0079] The message checking subunit is used to check whether there is an unmatched message when the additional element information of the abnormal order is inconsistent with the additional element information in the invoice detail data; for the unmatched message, jump to the data comparison subunit;
[0080] The data comparison subunit is also used to indicate that the digital invoice has failed to be issued in the relevant tax system when the additional element information of the abnormal order is inconsistent with the additional element information in the invoice details corresponding to any message at the end of the preset time period of the abnormal order. The failed digital invoice can be issued again without causing duplicate invoices.
[0081] The method for preventing duplicate invoicing according to the embodiment of the present invention can be applied to the tax bureau's business system; Figure 3 As shown, the sequential steps of the invoicing stage of the embodiment of the present invention are as follows:
[0082] 1. The business system initiates an invoicing order request and generates an invoicing request serial number, which is the unique identifier of this data, and submits the invoicing order.
[0083] 2. Turn on the anti-duplicate switch: Enable the anti-duplicate mechanism based on the seller's corporate tax number for the order; if the anti-duplicate switch is not turned on, the existing mechanism will be used and unsuccessful invoicing requests will be set to "invoicing failure" according to the dictionary configuration.
[0084] 3. Add the order's invoicing request serial number as additional element information to the invoicing information.
[0085] 4. Issue digital invoices to relevant tax bureau systems such as the tax bureau's Leqi system through the direct invoice card interface of the sales system (the invoicing system includes the business system and the sales system).
[0086] 5. Return the result, and judge whether the invoicing is successful or unsuccessful based on the returned result; if it is unsuccessful, judge the corresponding type. If it is determined that the type is that the digital invoice has not been issued, update the order status to "issuance failed". If the type is network abnormality, network instability, network timeout, or other various unknown abnormalities, or errors with unknown status, then record and update the time t of the invoicing order request, lock the order status as "suspected to have been invoiced" within the preset time period, and do not allow retries, and the invoicing is completed. If successful, save the invoice information, update the order status to "invoicing successful", push the invoice data to the business system through the sales system, and the process ends. For orders that fail to issue invoices, you can manually reopen or use the method of the embodiment of the present invention to re-issue the invoicing order request to enter the reopening process.
[0087] like Figure 4 The following is the automatic processing flow for abnormal orders within abnormal orders, which is as follows:
[0088] 1. Automatically query abnormal orders at a specified time interval, such as 30 minutes, 15 minutes or 1 day, which can be set by yourself. That is, after the specified time interval, obtain the abnormal order list, which contains all abnormal orders whose order status is suspected to have been invoiced.
[0089] 2. Select an abnormal order in the abnormal order list for processing.
[0090] 3. Determine whether the anti-duplicate mechanism is enabled for the selected abnormal order. If the anti-duplicate mechanism is not enabled, select another abnormal order in the abnormal order list for processing;
[0091] 4. If the anti-duplicate mechanism is enabled, the main invoice information within the specified time interval is queried from the relevant tax system through the invoice query interface of the invoicing system based on the invoicing information. Each invoice corresponds to a message, and one message includes all the main information of the invoice.
[0092] 5. After the query is successful and the message is obtained, the invoice main information of the abnormal order is compared with the invoice main information corresponding to each message in a loop. That is, when the invoice main information of the abnormal order is inconsistent with the invoice main information corresponding to a message, the invoice main information of the abnormal order is compared with the invoice main information corresponding to the next message, and so on.
[0093] 6. When the invoice master information of the abnormal order is consistent with the invoice master information corresponding to a message, according to the invoice number in the invoice master information corresponding to the message, the invoice detail data corresponding to the invoice number is queried in the relevant tax system through the single invoice query interface of the sales system. The invoice detail data includes additional element information.
[0094] 7. Compare the additional element information of the abnormal order with the additional element information in the invoice details to see if they are consistent, that is, whether they match. When the additional element information of the abnormal order is consistent with the additional element information in the invoice details, it indicates that the digital electricity invoice has been successfully issued in the relevant tax system. Associate the digital electricity invoice with the abnormal order, and update the order status of the abnormal order to successful invoicing.
[0095] 8. When the additional element information of the abnormal order is inconsistent with the additional element information in the invoice detail data, check whether there is any unmatched message; if so, continue to compare, that is, cyclically compare the invoice master information of the abnormal order with the invoice master information corresponding to the remaining messages until the comparison is consistent, or all messages are compared and still not consistent. When at the end of the preset time period of the abnormal order, when the additional element information of the abnormal order is inconsistent with the additional element information in the invoice detail data corresponding to any message queried last time, it indicates that the digital invoice has failed to be issued in the relevant tax system, and the order status of the abnormal order is updated to invoicing failure.
[0096] The beneficial effects achieved by the embodiments of the present invention are as follows:
[0097] 1. Prevent duplicate invoicing: In the event of network problems such as network timeout or unknown abnormalities (invoicing system), the order can be locked by setting it as an abnormal order and a delayed query can be performed. During the set time period, the digital invoice corresponding to the abnormal order in the order abnormality list is periodically determined at specified time intervals to determine whether the digital invoice corresponding to the abnormal order in the order abnormality list has been successfully or failed to be issued in the relevant tax system, ensuring the accuracy and reliability of the invoicing business and avoiding duplicate invoicing caused by network problems or abnormalities.
[0098] 2. Automated processing: Utilize scheduled tasks and comparison mechanisms to automate the processing of suspected invoicing orders and reduce manual intervention.
[0099] 3. System stability: Reduce business confusion and improve the stability and reliability of the invoicing system.
[0100] 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 preventing duplicate invoicing, characterized in that: include: Step 1: Generate an invoicing order request in the invoicing system at the enterprise end, generate an invoicing request serial number for the order, and form invoicing information, wherein the invoicing information includes the invoicing request serial number and the time of the invoicing order request; Step 2: Based on the invoicing information, the invoicing system is connected to the relevant tax system to issue a digital invoice. When the invoicing system receives a notification other than a successful invoicing or a failed invoicing, the order is marked as an abnormal order, and the order status of the digital invoice is set to suspected invoicing within a preset time period, and the starting point of the preset time period is the time when the invoicing order request is generated; Step 3: Add the abnormal order and the corresponding invoicing information to the order abnormality list of the invoicing system; Step 4: Based on the invoicing information, periodically determine at specified time intervals whether the digital invoice corresponding to the abnormal order in the order abnormality list has been successfully or failed to be issued in the relevant tax system.
2. The method for preventing duplicate invoicing according to claim 1, characterized in that: Also includes: Step 5: After the invoicing order request is generated in the invoicing system, an anti-duplicate mechanism based on the seller's corporate tax number is enabled for the order, and the seller's corporate tax number and the anti-duplicate mechanism based on the seller's corporate tax number enabled for the order are recorded in the invoicing information.
3. The method for preventing duplicate invoicing according to claim 1, characterized in that: Also includes: Step 6: In the invoicing information, set additional element information that is unique and does not overlap with other digital electrical invoices for the digital electrical invoice corresponding to the order, and the additional element information is used to be issued to the digital electrical invoice.
4. The method for preventing duplicate invoicing according to claim 3, characterized in that: In step 6, additional element information is set for the digital invoice corresponding to the order, which is unique and does not overlap with other digital invoices, including: The invoicing request serial number is set as additional element information of the digital invoice.
5. The method for preventing duplicate invoicing according to claim 1, characterized in that: In step 2, the invoicing system is connected to the relevant tax system to issue a digital invoice, including: The invoice issuance interface of the invoicing system is connected to the relevant tax system to issue digital invoices.
6. The method for preventing duplicate invoicing according to claim 1, characterized in that: Step 4 includes: Step 41: periodically query the order exception list at a specified time interval, and for each abnormal order, determine whether to enable an anti-duplicate mechanism based on the seller's corporate tax number for the abnormal order; Step 42: If the anti-duplicate mechanism based on the seller's corporate tax number is enabled for the abnormal order, the main information corresponding to the invoices issued within the preset time period corresponding to the abnormal order is queried in the relevant tax system through the invoicing system according to the seller's corporate tax number. Each invoice corresponds to a message, and one message includes all the main information of the invoice; Step 43: For each message, based on the invoicing information of the abnormal order, a level-by-level comparison is performed to determine whether the digital invoice corresponding to the abnormal order has been successfully or unsuccessfully issued in the relevant tax system.
7. The method for preventing duplicate invoicing according to claim 6, characterized in that: In step 42, according to the corporate tax number of the seller, the invoicing system searches the relevant tax system for the master information corresponding to the invoice issued within the preset time period corresponding to the abnormal order, including: Through the invoice list query interface of the invoicing system, according to the corporate tax number of the seller, the main information corresponding to the invoice issued within the preset time period corresponding to the abnormal order is queried in the relevant tax system.
8. The method for preventing duplicate invoicing according to claim 6, characterized in that: Step 43 includes: Step 43-1: Compare the invoice master information of the abnormal order with all the invoice master information in each message one by one, wherein the invoice master information at least includes: invoice number, invoice type, invoice type, seller's corporate tax number, buyer's taxpayer identification number, buyer's name and total tax amount; Step 43-2: When the invoice master information of the abnormal order is matched with all the invoice master information in any message, the invoice detail data corresponding to the invoice number in the matched invoice master information is searched in the relevant tax through the invoicing system, and the invoice detail data includes additional element information; Step 43-3: Compare the additional element information of the abnormal order with the additional element information in the invoice detail data to see if they are consistent. When the additional element information of the abnormal order is consistent with the additional element information in the invoice detail data, it indicates that the digital invoice has been successfully issued in the relevant tax system; Step 43-4: Set the order status of the digital invoice to successful invoicing.
9. The method for preventing duplicate invoicing according to claim 8, characterized in that: In step 43-2, the invoice detail data corresponding to the invoice number is queried in the relevant tax system through the invoicing system, specifically including: Through the single invoice query interface of the invoicing system, the invoice detail data corresponding to the invoice number is queried in the relevant tax system.
10. The method for preventing duplicate invoicing according to claim 8, characterized in that: Also includes: Step 45: When the additional element information of the abnormal order is inconsistent with the additional element information in the invoice detail data, check whether there is an unmatched message; for the unmatched message, jump to step 43; Step 43: It also includes when there is no message at the end of the preset time period of the abnormal order, and when the additional element information of the abnormal order is inconsistent with the additional element information in the invoice detail data corresponding to any message, it indicates that the digital invoice has failed to be issued in the relevant tax system.
11. An invoicing system for preventing duplicate invoicing, characterized in that: The invoicing system belongs to the enterprise side, and the invoicing system includes: An order generating unit, configured to generate an invoicing order request, generate an invoicing request serial number for the order, and form invoicing information, wherein the invoicing information includes the invoicing request serial number and the time of the invoicing order request; An invoicing unit, used to connect to a relevant tax system to issue a digital invoice based on the invoicing information; an exception handling unit, configured to, when receiving a notification other than a successful invoicing or a failed invoicing, mark the order as an abnormal order, and set the order status of the digital invoice to suspected invoicing within a preset time period, wherein the starting point of the preset time period is the time when the invoicing order request is generated; and Add the abnormal order and the corresponding invoicing information to the order abnormality list; The checking unit is used to periodically determine whether the digital invoice corresponding to the abnormal order in the order abnormality list has been successfully or failed to be issued in the relevant tax system based on the invoicing information at a specified time interval.
12. The invoicing system for preventing duplicate invoicing according to claim 11, characterized in that: The order generation unit is also used to enable an anti-duplicate mechanism based on the seller's corporate tax number for the order after generating the invoicing order request, and record the seller's corporate tax number and the anti-duplicate mechanism based on the seller's corporate tax number enabled for the order in the invoicing information.
13. The invoicing system for preventing duplicate invoicing according to claim 11, characterized in that: The order generation unit is further used to set additional element information that is unique and non-repetitive with other digital electrical invoices for the digital electrical invoice corresponding to the order in the invoicing information, and the additional element information is used to be issued to the digital electrical invoice.
14. The invoicing system for preventing duplicate invoicing according to claim 13, characterized in that: The order generating unit is specifically used for: The invoicing request serial number is set as additional element information of the digital invoice.
15. The invoicing system for preventing duplicate invoicing according to claim 11, characterized in that: The checking unit comprises: A timed query subunit, used for periodically querying the order exception list at a specified time interval, and for each abnormal order, determining whether to enable an anti-duplicate mechanism based on the seller's corporate tax number for the abnormal order; The first data acquisition subunit is used for, if an anti-duplicate mechanism based on the seller's corporate tax number is enabled for the abnormal order, querying the relevant tax system for the master information corresponding to the invoices issued within the preset time period corresponding to the abnormal order according to the seller's corporate tax number, wherein each invoice corresponds to one message, and one message includes all the master information of the invoice; The data comparison subunit is used to compare each message step by step based on the invoicing information of the abnormal order to determine whether the digital invoice corresponding to the abnormal order has been successfully or failed to be issued in the relevant tax system.
16. The invoicing system for preventing duplicate invoicing according to claim 15, characterized in that: The checking unit further includes a second data acquisition subunit, and the data comparison subunit includes a first data comparison module and a second data comparison module, wherein: The first data comparison module is used to compare the invoice master information of the abnormal order with all the invoice master information in each message one by one, wherein the invoice master information includes at least one of the following: invoice number, invoice type, invoice type, seller's corporate tax number, buyer's taxpayer identification number, buyer's name and total tax amount; The second data acquisition subunit is used for, when the invoice master information of the abnormal order is matched with all the invoice master information in any message, searching the relevant tax bureau for invoice detail data corresponding to the invoice number according to the invoice number in the matched invoice master information, wherein the invoice detail data includes additional element information; The second data comparison module is used to compare whether the additional element information of the abnormal order is consistent with the additional element information in the invoice detail data. When the additional element information of the abnormal order is consistent with the additional element information in the invoice detail data, it indicates that the digital invoice has been successfully issued in the relevant tax system; The exception handling unit is further used to set the order status of the digital electricity invoice to successful invoicing.
17. The invoicing system for preventing duplicate invoicing according to claim 16, characterized in that: The checking unit also includes a message checking subunit, wherein: The message checking subunit is used to check whether there is an unmatched message when the additional element information of the abnormal order is inconsistent with the additional element information in the invoice detail data; for the unmatched message, jump to the data comparison subunit; The data comparison subunit is also used to indicate that the digital invoice has failed to be issued in the relevant tax system when, at the end of the preset time period of the abnormal order, the additional element information of the abnormal order is inconsistent with the additional element information in the invoice detail data corresponding to any message.
