Automatic invoicing method, device, electronic device and storage medium
By automatically processing data from the enterprise management and invoice side, the problem of inefficient manual invoice is solved, and the data closed loop from subscription to voucher is realized, which improves work efficiency and accuracy.
Patent Information
- Application Number
- CN202311660473.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-05
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2043-12-05
AI Technical Summary
The enterprise management software and the government’s gold tax system cannot be directly connected, resulting in inefficient manual invoice issuance and the data closed loop from subscription to voucher to collection.
By obtaining the invoice data to be issued on the enterprise management side, generating statements, splitting pre-made invoices, adjusting the difference amount, sending electronic invoices, and generating invoice vouchers, we realize the automated connection between the enterprise management side and the invoice side, ensuring a closed-loop data.
Improve invoice efficiency, save human resources, and ensure the accuracy and automated management of invoices.
Smart Images

Figure CN117670453B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an automatic invoicing method, device, electronic device and storage medium. Background Art
[0002] With the popularization of smart office, companies now use enterprise management software, such as ERP, CRM, etc. However, the current enterprise management software cannot be directly connected to the government's golden tax system, and invoices need to be issued in a semi-automatic way with manual import, which leads to a large amount of manual intervention, a large amount of manpower and material resources are wasted, and the accuracy of invoicing cannot be guaranteed. In addition, the invoicing results cannot be automatically written back to the enterprise management end, and an automatic data closed loop from ordering to vouchers to collection cannot be formed. Therefore, with the development of the company's business and the subsequent promotion of electronic invoices by the country, in order to improve work efficiency and save human resources, companies need a method to achieve automatic invoicing. Summary of the invention
[0003] In view of the shortcomings of the related technologies mentioned above, the present application provides an automatic invoicing method, device, electronic device and storage medium to solve the technical problem that the enterprise end and the invoicing end cannot be directly connected, resulting in low efficiency of manual invoicing.
[0004] The present application provides an automatic invoicing method, which includes: obtaining invoice data to be issued from an enterprise management end, generating statements of different groups based on the seller, purchaser or department in the invoice data to be issued; generating pre-made invoices based on the statements of the same group, splitting the pre-made invoices to obtain split invoices; if the invoice amount of the split invoices is inconsistent with the required amount of the invoice data to be issued, obtaining a difference amount based on the invoice amount and the required amount; adding a total price discount based on the difference amount to adjust the invoice amount of the split invoice to obtain the invoice to be issued, or adjusting the tax-inclusive amount or tax-exclusive amount of the split invoice based on the difference amount to obtain the invoice to be issued; sending the invoice to be issued to the invoice issuing end, and the invoice issuing end obtains an electronic invoice based on the invoice to be issued;
[0005] The invoice information of the electronic invoice is obtained, and a billing voucher is generated based on the invoice information, wherein the billing voucher includes at least an invoice number, an invoice date and an invoice status, and the billing voucher is sent to an enterprise management terminal.
[0006] In one embodiment of the present application, if the difference amount is greater than a preset difference adjustment threshold, a difference amount adjustment approval application is sent to the enterprise management end; if the enterprise management end approves the difference amount adjustment approval application, the tax-inclusive amount or tax-exclusive amount of the split invoice is adjusted based on the difference amount.
[0007] In one embodiment of the present application, a total price discount approval application is sent to the enterprise management end; if the enterprise management end approves the total price discount approval application, the total price discount is increased based on the difference amount to adjust the invoice amount of the split invoice.
[0008] In one embodiment of the present application, an invoice limit is obtained, and the prefabricated invoice is reversely calculated based on a preset reverse calculation formula to obtain invoice items; a to-be-split set is obtained based on the invoice items whose item amounts are greater than the invoice limit, and a to-be-merged set is obtained based on the invoice items whose item amounts are less than the invoice limit; the to-be-split set is split to obtain a split set and a to-be-merged set after the split; the to-be-merged set and the to-be-merged set after the split are merged to obtain a merged set; and a split invoice is obtained based on the split set and the merged set.
[0009] In one embodiment of the present application, the item unit price of one of the invoice items in the to-be-split set is obtained, and the invoice base is obtained based on the item unit price and the invoice limit; the invoice amount after splitting is obtained based on the invoice base and the item unit price, and the invoice item is split into multiple split invoices based on the invoice base and the split invoice amount; the split invoice whose invoice amount is equal to the split invoice amount is added to the split set, and the split invoice whose invoice amount is less than the split invoice amount is added to the to-be-merged set after splitting.
[0010] In one embodiment of the present application, the set to be merged and the set to be merged after being split are sorted from large to small based on the item amount to obtain a sequence list to be merged; the item amount of the invoice item with the first sequence number in the sequence list to be merged and the item amount of the invoice item with the last sequence number in the merged sequence list are added in sequence to obtain the sum of the amounts, until the sum of the amounts is greater than the invoice limit, and the added sequence numbers of each item are recorded; the smallest sequence number except the first sequence number in the recorded item sequence numbers is eliminated to obtain a merged sequence set; the corresponding invoice items are extracted from the sequence list to be merged based on the merged sequence number and merged to generate an invoice, and the generated invoice is added to the merged set; the extracted sequence list to be merged is reordered, and the above steps are repeated until only one remaining invoice item remains in the sequence list to be merged; an invoice is generated based on the remaining invoice item and added to the merged set.
[0011] In one embodiment of the present application, if an error is detected in the electronic invoice, a red cancellation invoice is generated at the invoicing end based on the electronic invoice.
[0012] The embodiment of the present application also provides an automatic invoicing device, which includes a statement generation module for obtaining the invoicing data to be issued from the enterprise management end, and generating different groups of statements based on the seller, purchaser or department in the invoicing data; an invoice splitting module for generating pre-made invoices based on the statements of the same group, and splitting the pre-made invoices to obtain split invoices; a difference amount module for obtaining a difference amount based on the invoice amount and the required amount if the invoice amount of the split invoice is inconsistent with the required amount of the invoicing data; and a difference adjustment module. Used to increase the total price discount based on the difference amount to adjust the invoice amount of the split invoice to obtain the invoice to be issued, or adjust the tax-inclusive amount or tax-exclusive amount of the split invoice based on the difference amount to obtain the invoice to be issued; an electronic invoice module, used to send the invoice to be issued to the invoicing end, and the invoicing end obtains the electronic invoice based on the invoice to be issued; an invoicing voucher module, used to obtain the invoice information of the electronic invoice, generate an invoicing voucher based on the invoice information, the invoicing voucher at least includes the invoice number, invoice date and invoice status, and send the invoicing voucher to the enterprise management end.
[0013] An embodiment of the present application also provides an electronic device, which includes one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device implements the automatic invoicing method as described in any of the above embodiments.
[0014] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor of a computer, the computer is enabled to execute the automatic invoicing method as described in any one of the above embodiments.
[0015] Beneficial effects of the present invention: The present application provides an automatic invoicing method, device, electronic device and storage medium, which obtains the invoice data to be invoiced from the enterprise management end, generates different groups of statements based on the seller, purchaser or department in the invoice data to be invoiced, generates pre-made invoices based on the statements of the same group, splits the pre-made invoices to obtain split invoices, and if the invoice amount of the split invoice is inconsistent with the requirements of the invoice data to be invoiced, obtains the difference amount based on the invoice amount and the required amount, increases the total price discount based on the difference amount to adjust the invoice amount of the split invoice to obtain the invoice to be issued, and adjusts the tax-inclusive amount or tax-exclusive amount of the split invoice based on the difference amount to obtain the invoice to be issued. Invoice, the invoice to be issued is sent to the invoicing end. The invoicing end obtains the electronic invoice based on the invoice to be issued, obtains the invoice information of the electronic invoice, and generates an invoicing voucher based on the invoice information. The invoicing voucher at least includes the invoice number, invoice date and invoice status. The invoicing voucher is sent to the enterprise management end. The enterprise management end and the invoicing end are connected through the automatic invoicing method in this application. Invoice pre-production, invoice splitting and adjustment of difference amounts can be automated. At the same time, the return of the invoicing voucher can enable the enterprise management end to form a data closed loop from ordering to voucher, which is convenient for the enterprise to manage invoices. It solves the technical problem that the enterprise end and the invoicing end cannot be directly connected, resulting in low efficiency of manual invoicing, improves work efficiency and saves human resources.
[0016] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a schematic diagram of an implementation environment of an automatic invoicing method shown in an exemplary embodiment of the present application;
[0018] Figure 2 is a flow chart of an automatic invoicing method shown in an exemplary embodiment of the present application;
[0019] Figure 3 is a flowchart of invoice splitting shown in an exemplary embodiment of the present application;
[0020] Figure 4 is a block diagram of an automatic invoicing device shown in an exemplary embodiment of the present application;
[0021] Figure 5 It is a structural schematic diagram of an electronic device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0022] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0023] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.
[0024] It should be noted that in this application, "first", "second", etc. are only used to distinguish similar objects, and are not used to limit the order or precedence of similar objects. The variations of "including", "having", etc. described above indicate that the scope covered by the subject of the word is not exclusive except for the examples shown by the word.
[0025] It is understood that the various numbers, step numbers, and other reference numerals recorded in this application are distinguished for the convenience of description and are not intended to limit the scope of this application. The size of the reference numerals in this application does not mean the order of execution. The execution order of each process should be determined by its function and internal logic.
[0026] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.
[0027] The embodiments of the present application respectively provide an automatic invoicing method, an automatic invoicing device, an electronic device, a computer-readable storage medium, and a computer program product, which will be described in detail below.
[0028] See also Figure 1 , Figure 1 It is a schematic diagram of an implementation environment of an automatic invoicing method shown in an exemplary embodiment of the present application.
[0029] like Figure 1As shown, the implementation environment may include an enterprise management terminal 101, an automatic invoicing platform 102 and an invoicing terminal 103. The enterprise management terminal 101 may be an enterprise management system, such as an ERP system such as SAP, the invoicing terminal 103 is a golden tax system, and the automatic invoicing platform 102 is a computer device, which may specifically be at least one of a computer, a tablet, a mobile phone, a smart watch, etc. The computer device 103 may be at least one of a microcomputer, an embedded computer, a neural network computer, etc.
[0030] In one embodiment of the present application, the automatic invoicing platform 102 obtains the invoicing data to be issued from the enterprise management terminal 101, and generates different groups of reconciliation statements based on the seller, purchaser or the department in the invoicing data to be issued. The automatic invoicing platform 102 generates a prefabricated invoice based on the reconciliation statement of the same group, splits the prefabricated invoice to obtain a split invoice, and if the invoice amount of the split invoice is inconsistent with the required amount of the invoicing data to be issued, the difference amount is obtained based on the invoice amount and the required amount, and the total price discount is increased based on the difference amount to adjust the invoice amount of the split invoice to obtain the invoice to be issued, or the tax-inclusive amount or tax-exclusive amount of the split invoice is adjusted based on the difference amount to obtain the invoice to be issued, and the invoice to be issued is sent to the invoicing terminal 103, and the invoicing terminal 103 obtains an electronic invoice based on the invoice to be issued, obtains the invoice information of the electronic invoice, and generates an invoicing voucher based on the invoice information, and the invoicing voucher includes at least the invoice number, invoice date and invoice status, and sends the invoicing voucher to the enterprise management terminal 102, thereby realizing automatic invoicing.
[0031] See also Figure 2 , Figure 2 is a flowchart of an automatic invoicing method shown in an exemplary embodiment of the present application. Figure 2 As shown, in an exemplary embodiment, the automatic invoicing method includes at least steps S210 to S260, which are described in detail as follows:
[0032] Step S210, obtaining the invoicing data to be issued from the enterprise management end, and generating different groups of reconciliation statements based on the seller, purchaser or department in the invoicing data.
[0033] A statement of account is generated based on the invoicing data regularly pushed by the enterprise management end. In one embodiment of the present application, the invoicing data can be regularly pushed by the enterprise management end at 1 a.m. every day. The regular time can be modified based on actual applications. The invoicing data can also be pushed manually.
[0034] In one embodiment of the present application, the source of the data to be invoiced includes a shipping order or a credit and debit memo, and the data to be invoiced includes the seller, the purchaser, the source document, the document date, the department to which it belongs, the invoicing unit, the material name, the invoicing name, the specification model, the quantity, the unit price excluding tax, the amount excluding tax, the tax amount, the tax rate, the currency and the push date, etc.
[0035] In one embodiment of the present application, based on the above-mentioned data to be invoiced, statements of different groups are generated according to the seller, the purchaser or the department to which they belong.
[0036] Step S220, generating a prefabricated invoice based on the statements of the same group, splitting the prefabricated invoice to obtain split invoices.
[0037] In one embodiment of the present application, splitting a prefabricated invoice to obtain split invoices includes: obtaining an invoice limit, performing reverse calculation on the prefabricated invoice based on a preset reverse calculation formula to obtain invoice items; obtaining a to-be-split set based on the invoice items whose item amounts are greater than the invoice limit, and obtaining a to-be-merged set based on the invoice items whose item amounts are less than the invoice limit; splitting the to-be-split set to obtain a split set and a to-be-merged set after the split; merging the to-be-merged set and the to-be-merged set after the split to obtain a merged set; and obtaining a split invoice based on the split set and the merged set.
[0038] In one embodiment of the present application, splitting the invoice set to be split to obtain a standard invoice set after splitting and a set of invoices to be merged after splitting includes: obtaining the item unit price of an invoice item in the set to be split, and obtaining the invoice cardinality based on the item unit price and the invoice limit; obtaining the invoice amount after splitting based on the invoice cardinality and the item unit price, and splitting the invoice item into multiple split invoices based on the invoice cardinality and the invoice amount after splitting; adding the split invoice whose invoice amount is equal to the split invoice amount to the split set, and adding the split invoice whose invoice amount is less than the split invoice amount to the split set to be merged.
[0039] In one embodiment of the present application, merging the invoice set to be merged and the invoice set to be merged after being split to obtain the merged standard invoice set includes: sorting the invoice set to be merged and the invoice set to be merged after being split from large to small based on the item amount to obtain a sequence list to be merged; adding the item amount of the invoice item with the first sequence number in the sequence list to be merged and the item amount of the invoice item with the last sequence number in the merged sequence list in sequence to obtain the sum of the amounts until the sum of the amounts is greater than the invoice limit, and recording the added sequence numbers of each item; removing the smallest sequence number except the first sequence number from the recorded item sequence numbers to obtain a merged sequence set; extracting the corresponding invoice items from the sequence list to be merged based on the merged sequence number and merging them to generate an invoice, and adding the generated invoice to the merged set; reordering the extracted sequence list to be merged, and repeating the above steps until only one remaining invoice item remains in the sequence list to be merged; generating an invoice based on the invoice item and adding it to the merged set.
[0040] Step S230: If the invoice amount of the split invoice is inconsistent with the required amount of the invoicing data, the difference amount is obtained based on the invoice amount and the required amount.
[0041] In one embodiment of the present application, when adjusting a split invoice, the invoicing information of the purchaser and seller, the number of invoice lines and the tax rate cannot be modified, but the name of the goods, specification model, unit, unit price excluding tax, remarks and the order of the invoice lines can be modified.
[0042] Step S240: Based on the difference amount, the total price discount is increased to adjust the invoice amount of the split invoice to obtain the invoice to be issued, or based on the difference amount, the tax-inclusive amount or tax-exclusive amount of the split invoice is adjusted to obtain the invoice to be issued.
[0043] In one embodiment of the present application, adjusting the tax-inclusive amount or tax-exclusive amount of the split invoice based on the difference amount to obtain the invoice to be issued includes: if the difference amount is greater than a preset difference adjustment threshold, sending a difference amount adjustment approval application to the enterprise management end; if the enterprise management end approves the difference amount adjustment approval application, adjusting the tax-inclusive amount or tax-exclusive amount of the split invoice based on the difference amount.
[0044] In one embodiment of the present application, the preset difference adjustment threshold is set to 50 yuan. When the difference amount is less than 50 yuan, the tax-inclusive amount or the tax-exclusive amount can be adjusted directly. When the difference amount is greater than 50 yuan, it is necessary to initiate an approval process to the enterprise management end. When initiating the approval process, it is necessary to fill in the reason for the application, and then send the difference amount adjustment approval to the enterprise management end. After approval, the enterprise management end will return the approval result to the automatic invoicing platform. If the approval result is consent, the invoicing is allowed to continue. If the approval result is disagreement, the invoicing is not allowed to continue. During the approval process, the automatic invoicing platform can cancel the approval process. After the approval is completed, if the difference amount is modified again, the modified amount will be checked and re-checked to see if it exceeds 50 yuan. If it exceeds, the approval process needs to be re-initiated. The 50 yuan in this embodiment is only an illustrative embodiment. Its specific value does not limit the scope of this application. It can also be other amount limits set by staff in this field.
[0045] In one embodiment of the present application, before increasing the total price discount based on the difference amount to adjust the invoice amount of the split invoice to obtain the invoice to be issued, it also includes: sending a total price discount approval application to the enterprise management end; if the enterprise management end approves the total price discount approval application, then increasing the total price discount based on the difference amount to adjust the invoice amount of the split invoice.
[0046] In one embodiment of the present application, while keeping the original line amount of the split invoice unchanged, add an invoice line with the invoicing name of total price discount and the amount as the adjusted value, so that the invoice amount is finally consistent with the required amount in the invoicing data. By modifying the total price discount amount and initiating the approval process after entering the adjustment value, the reason for the application needs to be filled in when initiating the approval process, and then the total price discount approval is sent to the enterprise management end. After approval, the enterprise management end will return the approval result to the automatic invoicing platform. If the approval result is consent, the invoicing is allowed to continue. If the approval result is disagreement, the invoicing is not allowed to continue. During the approval process, the automatic invoicing platform can cancel the approval process. After the approval is completed, if the discount amount needs to be modified again, the approval process needs to be re-initiated.
[0047] Step S250: sending the invoice to be issued to the invoicing end, and the invoicing end obtains an electronic invoice based on the invoice to be issued.
[0048] In one embodiment of the present application, before the invoicing end generates an electronic invoice, if an invoicing cancellation application is received from the enterprise management end, the invoice process is directly stopped and the split invoice is invalidated.
[0049] In one embodiment of the present application, the invoice to be issued is sent to the invoicing end. After the invoicing end obtains the electronic invoice based on the invoice to be issued, it also includes: if an error is detected in the electronic invoice, a red cancellation invoice is generated at the invoicing end based on the electronic invoice.
[0050] Step S260, obtaining the invoice information of the electronic invoice, generating a billing voucher based on the invoice information, the billing voucher including at least the invoice number, invoice date and invoice status, and sending the billing voucher to the enterprise management end.
[0051] In one embodiment of the present application, the billing voucher is sent to the enterprise management end to implement a data closed loop from ordering to billing, and the enterprise management end can manage the invoice based on the billing voucher.
[0052] In one embodiment of the present application, the invoice status includes a normal status, a voided status, and a red-refund status. If the electronic invoice detects an error, if the error occurs in the month of invoicing, the invoice is voided and the invoice status is changed to a voided status. If the error does not occur in the month of invoicing, the invoice status is changed to a red-refund status after a red-refund invoice is generated at the invoicing end. The initial status of the invoice is the normal status.
[0053] See also Figure 3 , Figure 3It is an invoice splitting flow chart shown in an exemplary embodiment of the present application, the process includes firstly performing reverse calculation on the pre-made invoice based on the reverse calculation formula to obtain invoice items, obtaining a to-be-split set based on the invoice items whose item amounts are greater than the invoice limit, obtaining a to-be-merged set based on the invoice items whose item amounts are less than the invoice limit, splitting the split set to obtain a split set and a to-be-merged set after the split, merging the to-be-merged set and the to-be-merged set after the split to obtain a merged set, and obtaining a split invoice based on the split set and the merged set.
[0054] In one embodiment of the present application, the pre-made invoice is reversely calculated based on the reverse calculation formula to correct the original data to the correct invoicing data, including: when the total price and tax are consistent and the quantity is consistent and the total discount price and tax are consistent, the total price and tax = the total price and tax, the amount = the total price and tax / (1+tax rate), the quantity = the quantity, the unit price = the amount / quantity, the total discount price and tax = the total discount price and tax, the discount amount = the total discount price and tax / (1+tax rate), the discounted quantity = the quantity, the discounted unit price = the discounted amount / the discounted quantity; when the total price and tax are consistent and the unit price is consistent and the total discount price and tax are consistent, the total price and tax = the total price and tax, the amount = the total price and tax / (1+tax rate), the quantity = the amount / unit price, the unit price = the unit price, the total discount price and tax = the total discount price and tax, the discount amount = the total discount price and tax / (1+tax rate) , discount quantity = quantity, discount unit price = discount amount / discount quantity; when the amount is the same, the quantity is the same, and the total discount price and tax is the same, amount = amount, tax = amount * tax rate, quantity = quantity, unit price = amount / quantity, price and tax total = amount + tax, discount price and tax total = discount price and tax total, discount amount = discount price and tax total / (1+tax rate), discount quantity = quantity, discount unit price = discount amount / discount quantity; when the amount is the same, the unit price is the same, and the total discount price and tax is the same, amount = amount, tax = amount * tax rate, quantity = amount / unit price, unit price = unit price, price and tax total = amount + tax, discount price and tax total = discount price and tax total, discount amount = discount price and tax total / (1+tax rate), discount quantity = quantity, discount unit price = discount amount / discount quantity.
[0055] In one embodiment of the present application, if the invoice limit is 100, the invoice items with an item amount greater than 100 are grouped into a to-be-split set, and the invoice items with an item amount less than 100 are grouped into a to-be-merged set.
[0056] In one embodiment of the present application, splitting the set to be split to obtain the split set and the set to be merged after the split includes: obtaining the item unit price of each invoice item in the set to be split, if the item unit price is 23, and the invoice limit is 100, then the invoice base = 23 / 100, and the invoice base is rounded to 4, which means that a single invoice can have a maximum of four invoice items, the invoice amount after splitting = item unit price * invoice base, so the invoice amount after splitting is 92. In this embodiment, the invoice item can be split into two split invoices with a split invoice amount of 92 and one split invoice with a split invoice amount of 46. The split invoice with a split invoice amount of 92 is added to the split collection, and the split invoice with a split invoice amount of 46 is added to the set to be merged after the split.
[0057] In one embodiment of the present application, the invoice items of the set to be merged and the set to be merged after being split are sorted from large to small based on the item amount to obtain a sequence list to be merged. Taking the invoice item represented by the item amount as an example, if the item amount is 10, 9, 8, 7, 6, 5, 4, 3, 2, serial numbers are added according to the position of the invoice item in the sequence list to be merged. In this embodiment, the invoice item with an item amount of 10 is the first serial number, the invoice item with an item amount of 9 is the second serial number, the invoice item with an item amount of 8 is the third serial number, the invoice item with an item amount of 7 is the fourth serial number, the invoice item with an item amount of 6 is the fifth serial number, the invoice item with an item amount of 5 is the sixth serial number, the invoice item with an item amount of 4 is the seventh serial number, and the invoice item with an item amount of 3 is the sixth serial number. The item is the eighth serial number, and the invoice item with an item amount of 2 is the ninth serial number. The invoice item amount with the first serial number and the item amount of the invoice item with the last serial number in the merged sequence list are sequentially added to obtain the sum of the amounts until the sum of the amounts is greater than the invoice limit. The added serial numbers of each item are recorded. For example, if 10+2>11, the first serial number and the ninth serial number are recorded. The smallest serial number except the first serial number in the record is removed to obtain the merged sequence set as the first serial number. The invoice item corresponding to the first serial number is extracted and merged to generate an invoice, and the generated invoice is added to the merged set. The extracted sequence list to be merged is reordered, and the above steps are repeated until only one remaining invoice item remains in the sequence list to be merged. Invoices are generated for the remaining invoice items and added to the merged set. In this embodiment, the merged result is to merge the invoice items with an item amount of 9 and an item amount of 2, merge the invoice items with an item amount of 8 and an item amount of 3, merge the invoice items with an item amount of 7 and an item amount of 4, and merge the invoice items with an item amount of 6 and an item amount of 5.
[0058] See also Figure 4 , Figure 4 FIG. 1 is a block diagram of an automatic invoicing device shown in an exemplary embodiment of the present application. Figure 4As shown, the exemplary automatic invoicing device includes: a statement generation module 401, an invoice splitting module 402, a difference amount module 403, a difference adjustment module 404, an electronic invoice module 405 and a billing voucher module 406.
[0059] The statement generation module 401 is used to obtain the invoicing data to be issued from the enterprise management end, and generate statements of different groups based on the seller, purchaser or department in the invoicing data;
[0060] An invoice splitting module 402 is used to generate a pre-made invoice based on the statement of account of the same group, split the pre-made invoice, and obtain split invoices;
[0061] The difference amount module 403 is used to obtain the difference amount based on the invoice amount and the required amount if the invoice amount of the split invoice is inconsistent with the required amount of the invoicing data;
[0062] The difference adjustment module 404 is used to increase the total price discount based on the difference amount to adjust the invoice amount of the split invoice to obtain the invoice to be issued, or to adjust the tax-inclusive amount or tax-exclusive amount of the split invoice based on the difference amount to obtain the invoice to be issued;
[0063] The electronic invoice module 405 is used to send the invoice to be issued to the invoicing end, and the invoicing end obtains the electronic invoice based on the invoice to be issued;
[0064] The billing voucher module 406 is used to obtain the invoice information of the electronic invoice, generate a billing voucher based on the invoice information, the billing voucher at least includes the invoice number, invoice date and invoice status, and send the billing voucher to the enterprise management end.
[0065] Figure 5 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 5 The computer system 500 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0066] like Figure 5As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage part 508 to the random access memory (RAM) 503, such as executing the method described in the above embodiment. In the RAM 503, various programs and data required for system operation are also stored. The CPU 501, the ROM 502 and the RAM 503 are connected to each other through the bus 504. The input / output (I / O) interface 505 is also connected to the bus 504.
[0067] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed so that a computer program read therefrom is installed into the storage section 508 as needed.
[0068] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 509, and / or installed from a removable medium 511. When the computer program is executed by a central processing unit (CPU) 501, various functions defined in the system of the present application are executed.
[0069] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0070] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0071] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0072] Another aspect of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes the automatic invoicing method as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0073] Another aspect of the present application also provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the automatic invoicing method provided in each of the above embodiments.
[0074] The above embodiments are merely illustrative of the principles and effects of the present application, and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. An automatic invoicing method, characterized in that: The automatic invoicing method comprises: Obtain the invoicing data to be issued from the enterprise management end, and generate statements for different groups based on the seller, purchaser or department in the invoicing data; Generate a prefabricated invoice based on the statement of account of the same group, split the prefabricated invoice to obtain the split invoice; split the prefabricated invoice to obtain the split invoice, including: obtaining the invoice limit, and performing reverse calculation on the prefabricated invoice based on a preset reverse calculation formula to obtain the invoice item; obtain a to-be-split set based on the invoice items whose item amount is greater than the invoice limit, and obtain a to-be-merged set based on the invoice items whose item amount is less than the invoice limit; split the to-be-split set to obtain a split set and a to-be-merged set after the split; merge the to-be-merged set and the to-be-merged set after the split to obtain a merged set; obtain the split invoice based on the split set and the merged set; merge the to-be-merged set and the to-be-merged set after the split to obtain a merged set, including: merge the to-be-merged set and the split set The set to be merged is sorted from largest to smallest based on the item amount to obtain a sequence list to be merged; the item amount of the invoice item with the first sequence number in the sequence list to be merged and the item amount of the invoice item with the last sequence number in the sequence list to be merged are added in sequence to obtain the sum of the amounts, until the sum of the amounts is greater than the invoice limit, and the added sequence numbers of each item are recorded; the smallest sequence number except the first sequence number in the recorded item sequence numbers is eliminated to obtain a merged sequence set; in the sequence list to be merged, the corresponding invoice items are extracted based on the merged sequence set and merged to generate an invoice, and the generated invoice is added to the merged set; the extracted sequence list to be merged is re-sorted, and the above steps are repeated until only one remaining invoice item remains in the sequence list to be merged; an invoice is generated based on the remaining invoice item and added to the merged set; If the invoice amount of the split invoice is inconsistent with the required amount of the to-be-invoiced data, the difference amount is obtained based on the invoice amount and the required amount; Based on the difference amount, a total price discount is added to adjust the invoice amount of the split invoice to obtain the invoice to be issued, or based on the difference amount, the tax-inclusive amount or tax-exclusive amount of the split invoice is adjusted to obtain the invoice to be issued; The invoice to be issued is sent to an invoicing end, and the invoicing end obtains an electronic invoice based on the invoice to be issued; The invoice information of the electronic invoice is obtained, and a billing voucher is generated based on the invoice information, wherein the billing voucher includes at least an invoice number, an invoice date and an invoice status, and the billing voucher is sent to an enterprise management terminal.
2. The automatic invoicing method according to claim 1, characterized in that: Adjusting the tax-inclusive amount or tax-exclusive amount of the split invoice based on the difference amount to obtain the invoice to be issued includes: If the difference amount is greater than the preset difference adjustment threshold, a difference amount adjustment approval application is sent to the enterprise management end; If the enterprise management end approves the application for approval of the difference amount adjustment, the tax-inclusive amount or tax-exclusive amount of the split invoice is adjusted based on the difference amount.
3. The automatic invoicing method according to claim 1, characterized in that: Before adjusting the invoice amount of the split invoice by adding a total price discount based on the difference amount to obtain the invoice to be issued, the method further includes: Sending a total price discount approval application to the enterprise management terminal; If the enterprise management end approves the total price discount application, the total price discount is increased based on the difference amount to adjust the invoice amount of the split invoice.
4. The automatic invoicing method according to claim 1, characterized in that: The split set to be split is split to obtain the split set and the set to be merged after the split, including: Obtaining the item unit price of an invoice item in the set to be split, and obtaining the invoice base based on the item unit price and the invoice limit; Obtaining a split invoice amount based on the invoice base and the item unit price, and splitting the invoice item into a plurality of split invoices based on the invoice base and the split invoice amount; The split invoices whose invoice amount is equal to the split invoice amount are added to the split set, and the split invoices whose invoice amount is less than the split invoice amount are added to the split to be merged set.
5. The automatic invoicing method according to claim 1, characterized in that: The invoice to be issued is sent to the invoice issuing end. After the invoice issuing end obtains the electronic invoice based on the invoice to be issued, the process further includes: If an error is detected in the electronic invoice, a red cancellation invoice is generated at the invoicing end based on the electronic invoice.
6. An automatic invoicing device, characterized in that: The automatic invoicing device comprises: A statement generation module is used to obtain the invoicing data to be issued from the enterprise management end, and generate statements of different groups based on the seller, purchaser or department in the invoicing data; An invoice splitting module is used to generate a prefabricated invoice based on the statement of account of the same group, split the prefabricated invoice to obtain a split invoice; splitting the prefabricated invoice to obtain a split invoice includes: obtaining an invoice limit, performing reverse calculation on the prefabricated invoice based on a preset reverse calculation formula to obtain an invoice item; obtaining a to-be-split set based on the invoice items whose item amounts are greater than the invoice limit, and obtaining a to-be-merged set based on the invoice items whose item amounts are less than the invoice limit; splitting the to-be-split set to obtain a split set and a to-be-merged set after the splitting; merging the to-be-merged set and the to-be-merged set after the splitting to obtain a merged set; obtaining a split invoice based on the split set and the merged set; merging the to-be-merged set and the to-be-merged set after the splitting to obtain a merged set includes: merging the to-be-merged set and the to-be-merged set after the splitting to obtain a merged set The split set to be merged is sorted from largest to smallest based on the item amount to obtain a sequence list to be merged; the item amount of the invoice item with the first sequence number in the sequence list to be merged and the item amount of the invoice item with the last sequence number in the sequence list to be merged are sequentially added to obtain a sum of the amounts, until the sum of the amounts is greater than the invoice limit, and the added sequence numbers of each item are recorded; the smallest sequence number except the first sequence number in the recorded item sequence numbers is eliminated to obtain a merged sequence set; in the sequence list to be merged, the corresponding invoice items are extracted based on the merged sequence set and merged to generate an invoice, and the generated invoice is added to the merged set; the extracted sequence list to be merged is re-sorted, and the above steps are repeated until only one remaining invoice item remains in the sequence list to be merged; an invoice is generated based on the remaining invoice item and added to the merged set; A difference amount module, for obtaining a difference amount based on the invoice amount and the required amount if the invoice amount of the split invoice is inconsistent with the required amount of the to-be-invoiced data; A difference adjustment module, configured to increase a total price discount based on the difference amount to adjust the invoice amount of the split invoice to obtain the invoice to be issued, or to adjust the tax-inclusive amount or tax-exclusive amount of the split invoice based on the difference amount to obtain the invoice to be issued; An electronic invoice module, used for sending the invoice to be issued to an invoice issuing end, and the invoice issuing end obtains an electronic invoice based on the invoice to be issued; The invoicing voucher module is used to obtain the invoice information of the electronic invoice, generate an invoicing voucher based on the invoice information, the invoicing voucher at least includes the invoice number, invoice date and invoice status, and send the invoicing voucher to the enterprise management end.
7. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the electronic device to implement the automatic invoicing method as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the automatic invoicing method according to any one of claims 1 to 5.
