WO2021000773A1 - 超限额发票的拆分方法、装置、计算机设备和存储介质 - Google Patents

超限额发票的拆分方法、装置、计算机设备和存储介质 Download PDF

Info

Publication number
WO2021000773A1
WO2021000773A1 PCT/CN2020/097963 CN2020097963W WO2021000773A1 WO 2021000773 A1 WO2021000773 A1 WO 2021000773A1 CN 2020097963 W CN2020097963 W CN 2020097963W WO 2021000773 A1 WO2021000773 A1 WO 2021000773A1
Authority
WO
WIPO (PCT)
Prior art keywords
amount
invoiced
invoice
sub
lines
Prior art date
Application number
PCT/CN2020/097963
Other languages
English (en)
French (fr)
Inventor
雒克宁
董佳佳
Original Assignee
苏宁云计算有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 苏宁云计算有限公司 filed Critical 苏宁云计算有限公司
Priority to CA3150967A priority Critical patent/CA3150967A1/en
Publication of WO2021000773A1 publication Critical patent/WO2021000773A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/04Billing or invoicing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/10Tax strategies

Definitions

  • This application relates to the technical field of tax management in enterprise applications, in particular to a method, device, computer equipment and storage medium for splitting over-limit invoices.
  • invoices including electronic invoices, value-added tax invoices, and ordinary invoices, have basically realized automatic collection and invoicing.
  • invoices that exceed the limit they need to be manually issued offline or manually split in the business system before processing. Issued. Offline manual issuance and manual splitting reduce the timeliness of invoicing and user experience, the accuracy cannot be guaranteed, and it also increases the complexity of invoicing by customers.
  • a method for splitting over-limit invoices comprising: judging whether the invoiced amount to be invoiced exceeds a preset invoicing limit, and whether the number of invoiced lines to be invoiced exceeds the preset upper limit of lines; The invoiced amount of the invoice does not exceed the preset invoicing limit, and the number of invoicing lines to be invoiced exceeds the preset upper limit of lines, the number of invoicing lines to be invoiced is calculated according to the preset upper limit of lines Split to obtain multiple sub-invoices; if the invoiced amount of the invoice to be invoiced exceeds the preset invoice limit, and the number of invoice lines to be invoiced does not exceed the preset upper limit number of lines, according to the The preset invoicing limit splits the invoicing amount to be invoiced to obtain multiple sub-invoices; if the invoicing amount to be invoiced exceeds the preset invoicing limit, and the number of invoicing lines to be invoiced If the number of lines exceeds the preset upper limit, the billing amount and the number of billing lines to be invoiced are
  • a device for splitting over-limit invoices comprising: a judging module for judging whether the invoiced amount to be invoiced exceeds a preset invoicing limit, and whether the number of invoiced lines to be invoiced exceeds the preset upper limit of lines;
  • the first splitting module is configured to: if the billing amount of the bill to be issued does not exceed the preset billing limit, and the number of billing lines to be billed exceeds the preset upper limit number of rows, according to the preset The upper limit of the number of lines splits the number of invoice lines to be invoiced to obtain multiple sub-invoices;
  • the second splitting module is used for if the invoiced amount of the invoice to be invoiced exceeds the preset invoice limit, and all The number of invoice lines to be invoiced does not exceed the preset upper limit number of lines, and the invoice amount of the invoice to be invoiced is split according to the preset invoice limit to obtain multiple sub-invoices;
  • the third splitting module If the billing amount of the bill to be issued exceeds the preset billing limit, and the number
  • a computer device comprising a memory, a processor, and a computer program stored on the memory and running on the processor.
  • the processor implements the following steps when executing the computer program: judging whether the invoiced amount to be invoiced exceeds Set the invoicing limit and whether the number of invoicing lines to be invoiced exceeds the preset upper limit; if the invoicing amount to be invoiced does not exceed the preset invoicing limit, and the number of invoicing lines to be invoiced exceeds all According to the preset upper limit number of lines, the number of invoicing lines to be invoiced is split according to the preset upper limit number of lines to obtain multiple sub-invoices; if the invoicing amount to be invoiced exceeds the preset invoicing If the number of invoice lines to be invoiced does not exceed the preset upper limit number of lines, the invoice amount of the invoice to be invoiced is split according to the preset invoice limit to obtain multiple sub-invoices; If the invoicing amount to be invoiced exceeds the preset invoicing limit, and the number of invoicing lines to be invoiced
  • the following steps are realized: judging whether the invoice amount to be invoiced exceeds a preset invoice limit, and the number of invoice lines to be invoiced Whether the number of invoicing lines exceeds the preset upper limit; if the invoicing amount to be invoiced does not exceed the preset invoicing limit, and the number of invoicing lines to be invoiced exceeds the preset upper limit of lines, according to the preset The maximum number of lines splits the number of invoice lines to be invoiced to obtain multiple sub-invoices; if the invoice amount of the invoice to be invoiced exceeds the preset invoicing limit, and the number of invoice lines to be invoiced If the number of rows does not exceed the preset upper limit, the billing amount of the to-be-issued invoice is split according to the preset billing limit to obtain multiple sub-invoices; if the billing amount of the to-be-issued invoice exceeds the preset Issuance limit, and the number of invoicing
  • the above-mentioned method, device, computer equipment and storage medium for splitting the excess invoice upon receiving the application for issuance of the invoice to be invoiced, judge the invoiced amount and the number of invoiced banks to be invoiced. Determine whether the billing amount to be issued exceeds the preset billing limit, and whether the number of billing lines to be issued exceeds the preset upper limit. If the invoicing amount to be invoiced does not exceed the preset invoicing limit, and the number of invoicing lines to be invoiced exceeds the preset upper limit, the number of invoicing lines to be invoiced is split according to the preset upper limit to obtain multiple Sub-invoice.
  • the invoicing amount to be invoiced is split according to the preset invoicing limit to obtain multiple sub-invoices ; If the invoicing amount to be invoiced exceeds the preset invoicing limit, and the number of invoicing lines to be invoiced exceeds the preset upper limit, the invoicing amount to be invoiced and the invoicing bank will be determined according to the preset upper limit of lines and the preset invoicing limit Split the number to get multiple sub-invoices.
  • Fig. 1 is an application environment diagram of a method for splitting excess invoices in an embodiment
  • FIG. 2 is a schematic flowchart of a method for splitting an excess invoice in an embodiment
  • FIG. 3 is a schematic flowchart of step S200 in an embodiment
  • Figure 4 is a schematic diagram of splitting in an implementation scenario of step S200;
  • Figure 5 is a schematic flow chart of step S300 in an embodiment
  • FIG. 6 is a schematic flowchart of step S300 in another embodiment
  • FIG. 7 is a schematic diagram of an invoicing system architecture of a method for splitting an excess invoice in an embodiment
  • FIG. 8 is a splitting flowchart of a method for splitting excess invoices in an embodiment
  • FIG. 9 is a structural block diagram of a device for splitting excess invoices in an embodiment
  • Figure 10 is an internal structure diagram of a computer device in an embodiment.
  • the method for splitting over-limit invoices provided in this application can be applied to the application environment shown in Figure 1.
  • the terminal 102 communicates with the server 104 through the network through the network.
  • the terminal 102 sends an invoice application request for the invoice to the server 104.
  • the server 104 reads the invoicing application request of the terminal 102 and the invoicing data in the request, and splits the over-limit invoice according to the invoicing data to obtain multiple sub-invoices that meet the invoicing requirements.
  • Invoicing requirements the restrictions on invoicing over-limit are generally divided into the number of commodity lines over-limit, the over-invoicing amount and both are over-limit.
  • the invoicing limit is related to the qualification of the merchant, and there are a thousand yuan version, a ten thousand yuan version, a 100,000 yuan version, etc. If the limit is exceeded, the server 104 splits the original invoice in the request submitted by the terminal 102 and then issues multiple invoices that meet the billing requirements. In addition, subject to the limitation of the invoicing terminal, the maximum number of invoiced product lines supported by a single invoice is also limited. When the limit is exceeded, the server 104 also needs to split the product lines in the invoice into different groups to generate multiple sub-invoices. The server 104 in this application judges whether the invoice to be issued is an over-limit invoice through the invoice issuance application submitted by the terminal 102.
  • the terminal 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices.
  • the server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
  • a method for splitting over-limit invoices is provided. Taking the method applied to the server in FIG. 1 as an example, the method includes the following steps:
  • S100 It is judged whether the invoicing amount to be invoiced exceeds the preset invoicing limit, and whether the number of invoicing lines to be invoiced exceeds the preset upper limit.
  • the server receives a request for issuing an invoice to be issued from the terminal, and reads the invoice data in the invoice to be issued from the request.
  • the billing data includes the billing amount to be billed and the number of billing lines to be billed.
  • the server sets a preset invoicing limit and a preset upper limit number of lines in advance according to the requirements for issuing invoices.
  • the preset billing limit and the preset upper limit number of lines can be flexibly configured at any time.
  • the server verifies the billing data, including whether the billing amount to be invoiced matches the merchandise line amount, whether the merchandise line number multiplied by the unit price matches the merchandise line amount, etc., and then processes the data that meets the conditions.
  • the server determines whether the billing amount to be issued exceeds the preset billing limit in the system, and whether the number of billing lines to be issued exceeds the preset upper limit number of lines in the system. According to the judgment result, the following step S200 or step S300 or step S400 is executed.
  • the server determines that the amount of invoicing to be invoiced does not exceed the preset invoicing limit and the number of invoicing lines to be invoiced exceeds the preset upper limit. At this time, the server will wait according to the preset upper limit. Split the number of billing lines issued to obtain multiple sub-invoices.
  • step S200 "dividing the number of invoice lines to be issued according to the preset upper limit number of lines to obtain multiple sub-invoices” includes: The number of billing lines of the invoice and the preset upper limit number of lines are divided into the number of billing lines to be invoiced to be invoiced to obtain Roundup(S) sub-invoices, where S is the billing line to be invoiced The quotient of the number and the preset upper limit number of rows, Roundup(S) means rounding up S. Specifically, as shown in FIG. 3, in an implementation process of this embodiment, this step includes:
  • the number of product lines to be invoiced is greater than the maximum number of invoice lines, but the invoiced amount in the invoice does not exceed the limit.
  • the server only needs to group the product lines to be invoiced. can.
  • the preset upper limit number of rows is 99, and the server divides the number of product rows in the invoice to be issued by 99 to obtain the quotient N and the remainder n.
  • the number of product lines in each sub-invoice in N sub-invoices is 99, and the number of product lines in the remaining one sub-invoice is n. Therefore, through this implementation method, the number of commodity lines of most sub-invoices after splitting is controlled to the preset upper limit line number, which can reduce the number of issued sub-invoices, save energy and protect the environment, and provide users with better experience and services.
  • the server determines that the amount of invoicing to be issued exceeds the preset invoicing limit and the number of invoicing lines to be invoiced does not exceed the preset upper limit. At this time, the server will be issued according to the preset invoicing limit.
  • Split the invoiced amount of the invoice to obtain multiple sub-invoices Specifically, the invoiced amount to be invoiced is split according to the principle of maximizing the invoiced amount, and multiple sub-invoices are generated according to the split result. Among them, the principle of maximizing the invoiced amount is to maximize the amount of each sub-invoice as possible. In this scenario, the number of commodity lines to be invoiced is within the maximum number of invoice lines, but the invoiced amount exceeds the maximum invoiced amount.
  • the invoiced amount exceeds the maximum invoiced amount, it can be divided into single-product invoiced excess and multi-product invoiced excess.
  • the invoiced amount of a single product exceeds the limit and is further divided into the amount of the unit price of the product exceeds the limit and the amount of the unit price of the product is not exceeded.
  • the invoiced amount to be invoiced includes a single line of commodity amount and a product unit price amount
  • the preset invoicing limit includes a single line of commodity limit and a commodity unit price limit.
  • step S300 includes: if the first condition is met and the number of billing lines to be issued does not exceed the preset upper limit number of lines, dividing the to-be-issued bills in the first split method according to the preset issuance limit. Split the invoiced amount of the invoice to obtain the invoiced amount, product quantity, and product value of multiple sub-invoices.
  • the first condition is that the amount of the single line of commodities exceeds the limit of the single line of commodities and the amount of unit price of the commodities exceeds the limit of the unit price of commodities.
  • the first splitting method includes the following steps:
  • S301 Obtain the invoiced amount, the number of commodities and the amount of commodities in the first sub-invoice of the plurality of sub-invoices according to the preset maximum limit of invoicing, the invoicing amount in the to-be-invoiced invoice, the unit price of the product, and the quantity of the product, and the The quantity value of the first sub-invoice.
  • the billing amount of the first sub-invoice is obtained according to the maximum billing limit.
  • S303 According to the invoiced amount of the invoice to be issued, the invoiced amount and quantity value of the first sub-invoice, the quantity of commodities in the first sub-invoice and the quantity value, obtain the first sub-invoice The invoiced amount, product quantity, and product value of the second sub-invoice.
  • the quantity of commodities in the sub-invoice and the quantity value obtain the quantity of commodities in the second sub-invoice.
  • the generated multiple sub-invoices include L first sub-invoices and 1 second sub-invoice; L represents the quantity value.
  • the method further includes: obtaining the freight and discount in the first sub-invoice in the first splitting method and the freight and discount in the second sub-invoice in the following manner:
  • the freight and discount in the first sub-invoice according to the invoiced amount and commodity value of the first sub-invoice, the invoiced amount to be invoiced, and the preset basic freight; according to the preset basic freight, the The freight and the quantity value in the first sub-invoice, the invoiced amount and the merchandise value of the second sub-invoice, and the freight and the discount in the second sub-invoice are obtained.
  • the freight in the first sub-invoice is obtained according to the invoiced amount of the first sub-invoice, the invoiced amount to be invoiced, and the preset basic freight;
  • the quantity value of a sub-invoice obtains the freight in the second sub-invoice; according to the commodity value of the second sub-invoice, the freight in the second sub-invoice, and the invoiced amount of the second sub-invoice to obtain the The discount in the second sub-invoice.
  • Split according to the principle of maximizing the invoiced amount, first calculate the invoiced amount after splitting (the maximum limit M minus 1 yuan), and then calculate the split quantity, the split quantity * unit price (the unit price of the product before and after the split remains unchanged). The amount of goods. If the freight is included, the split freight is calculated proportionally, and finally the discount is calculated based on the split amount, product amount, and freight.
  • the rules are as follows:
  • M is the maximum limit for invoicing
  • K1 is the invoicing amount of the first sub-invoice
  • K0 is the invoicing amount to be invoiced
  • S0 is the quantity of goods to be invoiced
  • S1 is the quantity of goods in the first sub-invoice
  • J1 is the product amount of the first sub-invoice
  • P is the unit price of the product
  • Num is the number of the first sub-invoice with a splittable amount of K1
  • Kn is the invoiced amount of the second sub-invoice
  • Sn is the product of the second sub-invoice
  • Jn is the commodity amount of the second sub-invoice
  • the multiple sub-invoices include NuL first sub-invoices and one second sub-invoice.
  • D1 may be a negative number, in this case you need to recalculate the invoiced amount and discount:
  • T0 is the basic freight
  • T1 is the freight of the first sub-invoice
  • Tn is the freight of the second sub-invoice
  • D0 is the basic discount
  • D1 is the discount of the second sub-invoice
  • Dn is the discount of the second sub-invoice
  • step S300 further includes: if the second condition is met and the number of invoice lines to be invoiced does not exceed the preset upper limit number of lines, passing through the preset invoice limit
  • the second splitting method splits the invoiced amount of the to-be-invoiced invoice to obtain the invoiced amount, product quantity, and product value of multiple sub-invoices.
  • the second condition is that: the amount of the single line commodity exceeds the single line commodity limit, and the amount of the unit price of the commodity does not exceed the unit price limit of the commodity.
  • the second splitting method includes the following steps:
  • S305 Obtain the invoiced amount and the product in the first sub-invoice of the plurality of sub-invoices according to the preset maximum limit of invoicing, the unit price and quantity of the products in the invoice to be issued, the preset basic freight and the preset basic discount Quantity, merchandise amount, shipping, discount, and the quantity value.
  • T1 ROUNDDOWN(S1/S0*T0);
  • K1 J1+T1–D1;
  • Tn T0-T1*Num
  • D1 may be a negative number, in this case you need to recalculate the invoiced amount and discount:
  • M is the maximum limit for invoicing
  • K1 is the invoicing amount of the first sub-invoice
  • K0 is the invoicing amount to be invoiced
  • S0 is the quantity of goods to be invoiced
  • S1 is the quantity of goods in the first sub-invoice
  • J1 is the product amount of the first sub-invoice
  • P is the unit price of the product
  • Num is the number of the first sub-invoice with a splittable amount of K1
  • Kn is the invoiced amount of the second sub-invoice
  • Sn is the product of the second sub-invoice
  • Jn is the commodity amount of the second sub-invoice
  • T0 is the basic freight
  • T1 is the freight of the first sub-invoice
  • Tn is the freight of the second sub-invoice
  • D0 is the basic discount
  • D1 is the discount of the second sub-invoice
  • Dn The discount for the second sub-invoice.
  • the multiple sub-invoices include NuL first sub-invoices and one second sub-
  • the invoiced amount to be invoiced further includes the multi-line commodity amount and the multi-line commodity unit price amount.
  • step S300 further includes: generating the multiple sub-invoices through the first processing method, the second processing method, and the third processing method according to the multi-line commodity amount and the multi-line commodity unit price amount.
  • the first processing method is: if the first condition is met, split the invoiced amount that meets the first condition in the to-be-invoiced invoice through the first splitting method, to obtain multiple pieces The invoiced amount, product quantity, and product value of the invoice.
  • the second processing method is: if the second condition is met, split the invoiced amount that meets the second condition in the to-be-invoiced invoice through the second splitting method to obtain multiple sub-invoices Invoice amount, product quantity, and product value.
  • the third processing method is: if the invoice amount of the invoice to be invoiced meets the condition that the single line commodity amount does not exceed the single line commodity limit, a corresponding sub-invoice is generated according to the invoice amount that meets the condition.
  • the invoiced amount to be invoiced also includes the multi-line commodity amount and the multi-line commodity unit price amount.
  • the invoicing amount to be invoiced is divided into the following three groups:
  • the invoiced amount that meets the first condition in the to-be-invoiced invoice is split by the first splitting method to obtain the invoiced amount and commodities of multiple sub-invoices Quantity and amount of goods.
  • the invoiced amount that meets the second condition in the to-be-invoiced invoices is split by the second splitting method to obtain the invoiced amount, product quantity, and quantity of multiple sub-invoices.
  • the amount of goods is split by the second splitting method to obtain the invoiced amount, product quantity, and quantity of multiple sub-invoices.
  • the invoicing amount to be invoiced also includes the multi-line product amount and the multi-line product unit price amount, and the number of invoicing lines to be invoiced exceeds the preset upper limit number of lines and the number of lines to be invoiced.
  • the billing amount of the invoice exceeds the preset billing limit. That is, the number of invoice lines for the commodities to be invoiced exceeds the maximum allowable number of lines and the invoice amount also exceeds the maximum limit.
  • the invoice to be invoiced is set according to the preset upper limit number of lines and the preset invoice limit. Split the billing amount and the number of billing lines to obtain multiple sub-invoices.
  • the multiple sub-invoices are generated through the first processing method, the second processing method, and the fourth processing method.
  • the fourth processing method is: when the invoiced amount of the invoice to be invoiced meets the condition that the single line commodity amount does not exceed the single line commodity limit, the optimal combination split method is used to generate the sub-invoice.
  • the optimal combination split method is as follows:
  • the accumulation step includes: sequentially accumulating the commodity amounts of multiple commodities in the commodity collection until the accumulated sum is closest to the preset invoicing limit or the number of accumulated rows is equal to the preset upper limit of rows , Obtain the sub-invoice according to the information of multiple products to be accumulated;
  • the multiple commodities in the accumulation step are removed from the commodity set, and the accumulation step is performed on the commodities in the commodity set after the removal, until no commodities are included in the commodity set.
  • the first processing method and the second processing method are as described in the above embodiment.
  • the judgment conditions of the commodity amount and the commodity unit price in the invoiced amount to be issued by the two are given, and the corresponding split processing method. No more details here.
  • the optimal plan is combined according to the maximum number of commodity lines issued and the maximum commodity amount limit. Specifically, the greedy algorithm is used to make the recombined billing amount closer to the billing limit to minimize the number of split votes, which is the optimal combination split method.
  • the commodities to be invoiced are sorted according to the single line commodity amount from large to small to obtain a commodity set. Further, the accumulation step is performed.
  • the accumulation step includes: sequentially accumulating the commodity amounts of multiple commodities in the commodity collection until the accumulated sum is closest to the preset invoicing limit or the number of accumulated rows is equal to the preset upper limit of rows.
  • the accumulated information of multiple commodities generates a sub-invoice.
  • the accumulation step is executed each time, multiple commodities participating in the accumulation step are removed from the commodity set from the commodity set to obtain the eliminated commodity set. Further, the step of accumulating is performed on the product set after removal. The analogy is continued until no commodities are included in the commodity set.
  • the group situation adopts the first treatment method.
  • the group situation adopts the second treatment method.
  • 6Group situation The single line commodity amount does not exceed the limit, and the maximum invoicing limit is used for combination. See the "Optimal Combination Split Logic" section for combination to minimize grouping.
  • the optimal combination split logic is as follows:
  • the optimal split combination After executing the optimal combination split logic, the optimal split combination can be obtained.
  • the server determines whether the invoiced amount to be invoiced exceeds a preset invoicing limit and whether the number of invoiced lines to be invoiced exceeds the preset upper limit. According to the three judgment results, a corresponding split method is given for each judgment result, and the split processing of over-limit invoices is automatically completed without manual intervention by personnel, which is time-saving, efficient, accurate and convenient.
  • this method is generally applicable to multiple types of bills such as electronic invoices, value-added tax invoices, and ordinary invoices, with a wide range of applications.
  • an intelligent splitting and combining algorithm is implemented, so that the splitting reaches the optimal combination, and the number of invoices is the smallest, which not only maximizes efficiency, but also saves energy and environmental protection.
  • the architecture system includes the interaction diagram of the transaction system and the pre-invoicing system, as shown in Figure 7.
  • Multiple online transaction systems submit transaction information to the back end of the server.
  • the back end of the server includes the billing pre-module and the billing system.
  • the pre-invoicing module verifies and splits the transaction information submitted by the online trading system, and outputs the split result.
  • the transaction information includes invoicing data to be issued.
  • the billing data includes the billing amount and the number of billing lines.
  • the online trading system After the online trading system outputs the split result, it sends an invoice request to the invoicing system, and the invoicing system performs automatic invoicing based on the split result.
  • the splitting flow chart of the billing pre-module based on the transaction information submitted by the online transaction system to split the billing is shown in Figure 8.
  • a device for splitting over-limit invoices includes: a judgment module 100, a first splitting module 200, a second splitting module 300, and a third splitting module 400, wherein:
  • the judgment module 100 is used to judge whether the billing amount to be issued exceeds the preset billing limit, and whether the number of billing lines to be issued exceeds the preset upper limit.
  • the server receives a request for issuing an invoice to be issued from the terminal, and reads the invoice data in the invoice to be issued from the request.
  • the billing data includes the billing amount to be billed and the number of billing lines to be billed.
  • the server sets a preset invoicing limit and a preset upper limit number of lines in advance according to the requirements for issuing invoices.
  • the preset billing limit and the preset upper limit number of lines can be flexibly configured at any time.
  • the server verifies the billing data, including whether the billing amount to be invoiced matches the merchandise line amount, whether the merchandise line number multiplied by the unit price matches the merchandise line amount, etc., and then processes the data that meets the conditions.
  • the server determines whether the billing amount to be issued exceeds the preset billing limit in the system, and whether the number of billing lines to be issued exceeds the preset upper limit number of lines in the system.
  • the first splitting module 200, the second splitting module 300, or the third splitting module 400 is selected according to the judgment result, and the selected splitting module performs subsequent billing splitting processing.
  • the first splitting module 200 is configured to, if the billing amount of the bill to be issued does not exceed the preset billing limit, and the number of billing lines to be billed exceeds the preset upper limit number of rows, according to the preset Set the upper limit of the number of lines to split the number of invoicing lines to be invoiced to obtain multiple sub-invoices.
  • the server determines that the amount of invoicing to be invoiced does not exceed the preset invoicing limit and the number of invoicing lines to be invoiced exceeds the preset upper limit. At this time, the server will wait according to the preset upper limit. Split the number of billing lines issued to obtain multiple sub-invoices.
  • the first splitting module 200 is further configured to split the number of invoice lines to be invoiced and to be invoiced according to the number of invoice lines to be invoiced and the preset upper limit number of lines. , Obtain Roundup(S) sub-invoices, S is the quotient of the number of billing lines to be issued and the preset upper limit number of lines, and Roundup(S) represents rounding up S.
  • the first splitting module 200 includes a calculation unit 210, a first splitting unit 220, and a second splitting unit 230. Wherein, the calculation unit 210 is configured to divide the number of billing lines to be issued by the preset upper limit number of lines to obtain the quotient N and the remainder n.
  • the first splitting unit 220 is configured to split the to-be-invoiced invoice into N sub-invoices when the remainder n is zero, and control the number of invoice lines of each sub-invoice to the preset upper limit number of lines To generate the N sub-invoices.
  • the second splitting unit 230 is configured to split the to-be-invoiced invoice into N+1 sub-invoices when the remainder n is not zero, and control the number of invoice lines of each invoice in the N sub-invoices to be The upper limit number of lines is preset, and the number of invoice lines of the remaining sub-invoices is n lines, and the N+1 sub-invoices are generated.
  • the number of product lines to be invoiced is greater than the maximum number of invoice lines, but the invoiced amount in the invoice does not exceed the limit.
  • the server only needs to group the product lines to be invoiced. can.
  • the preset upper limit number of rows is 99, and the server divides the number of product rows in the invoice to be issued by 99 to obtain the quotient N and the remainder n.
  • the number of product lines in each sub-invoice in N sub-invoices is 99, and the number of product lines in the remaining one sub-invoice is n. Therefore, through this implementation method, the number of commodity lines of most sub-invoices after splitting is controlled to the preset upper limit line number, which can reduce the number of issued sub-invoices, save energy and protect the environment, and provide users with better experience and services.
  • the second splitting module 300 is configured to: if the billing amount of the bill to be issued exceeds the preset billing limit, and the number of billing lines to be billed does not exceed the preset upper limit number of rows, Set the invoicing limit to split the invoicing amount to be invoiced to obtain multiple sub-invoices.
  • the server determines that the amount of invoicing to be issued exceeds the preset invoicing limit and the number of invoicing lines to be invoiced does not exceed the preset upper limit. At this time, the server will be issued according to the preset invoicing limit.
  • Split the invoiced amount of the invoice to obtain multiple sub-invoices Specifically, the invoiced amount to be invoiced is split according to the principle of maximizing the invoiced amount, and multiple sub-invoices are generated according to the split result. Among them, the principle of maximizing the invoiced amount is to maximize the amount of each sub-invoice as possible. In this scenario, the number of commodity lines to be invoiced is within the maximum number of invoice lines, but the invoiced amount exceeds the maximum invoiced amount.
  • the invoiced amount exceeding the maximum invoiced amount is specifically divided into the single commodity invoiced amount exceeding the limit and the multiple commodity invoiced amount exceeding the limit.
  • the invoiced amount of a single product exceeds the limit and is further divided into the amount of the unit price of the product exceeds the limit and the amount of the unit price of the product is not exceeded.
  • the invoiced amount to be invoiced includes a single line of commodity amount and a commodity unit price amount
  • the preset invoicing limit includes a single line of commodity limit and a commodity unit price limit
  • the second splitting module 300 includes a third splitting unit 310.
  • the third splitting unit 310 is configured to: if the first condition is met and the number of billing lines to be issued does not exceed the preset upper limit number of lines, the first splitting method is used according to the preset issuance limit. Split the invoiced amount of the invoice to obtain the invoiced amount, product quantity, and product value of multiple sub-invoices.
  • the first condition is that the amount of the single line of commodities exceeds the limit of the single line of commodities and the amount of unit price of the commodities exceeds the limit of the unit price of commodities.
  • the first splitting method includes the following steps: obtaining the invoiced amount in the first sub-invoice of the plurality of sub-invoices according to the preset maximum invoicing limit, the invoiced amount in the to-be-invoiced invoice, the unit price of the product, and the product quantity, The quantity and amount of the goods, and the quantity value of the first sub-invoice.
  • the invoiced amount of the to-be-invoiced invoice obtains the second sub-invoice of the plurality of sub-invoices
  • the invoiced amount, product quantity, and product value of the invoice obtain the second sub-invoice of the plurality of sub-invoices
  • the billing amount of the first sub-invoice is obtained according to the maximum billing limit.
  • the generated multiple sub-invoices include L first sub-invoices and 1 second sub-invoice.
  • it further includes: obtaining the freight and discount in the first sub-invoice in the first splitting method and the freight and discount in the second sub-invoice in the following manner:
  • the freight and discount in the first sub-invoice according to the invoiced amount and commodity value of the first sub-invoice, the invoiced amount to be invoiced, and the preset basic freight; according to the preset basic freight, the The freight and the quantity value in the first sub-invoice, the invoiced amount and the merchandise value of the second sub-invoice, and the freight and the discount in the second sub-invoice are obtained.
  • the freight in the first sub-invoice is obtained according to the invoiced amount of the first sub-invoice, the invoiced amount to be invoiced, and the preset basic freight;
  • the quantity value of a sub-invoice obtains the freight in the second sub-invoice; according to the commodity value of the second sub-invoice, the freight in the second sub-invoice, and the invoiced amount of the second sub-invoice to obtain the The discount in the second sub-invoice.
  • Split according to the principle of maximizing the invoiced amount, first calculate the invoiced amount after splitting (the maximum limit M minus 1 yuan), and then calculate the split quantity, the split quantity * unit price (the unit price of the product before and after the split remains unchanged). The amount of goods. If the freight is included, the split freight is calculated proportionally, and finally the discount is calculated based on the split amount, product amount, and freight.
  • the rules are as follows:
  • M is the maximum limit for invoicing
  • K1 is the invoicing amount of the first sub-invoice
  • K0 is the invoicing amount to be invoiced
  • S0 is the quantity of goods to be invoiced
  • S1 is the quantity of goods in the first sub-invoice
  • J1 is the product amount of the first sub-invoice
  • P is the unit price of the product
  • Num is the number of the first sub-invoice with a splittable amount of K1
  • Kn is the invoiced amount of the second sub-invoice
  • Sn is the product of the second sub-invoice
  • Jn is the commodity amount of the second sub-invoice
  • the multiple sub-invoices include NuL first sub-invoices and one second sub-invoice.
  • D1 may be a negative number, in this case you need to recalculate the invoiced amount and discount:
  • T0 is the basic freight
  • T1 is the freight of the first sub-invoice
  • Tn is the freight of the second sub-invoice
  • D0 is the basic discount
  • D1 is the discount of the second sub-invoice
  • Dn is the discount of the second sub-invoice
  • the second splitting module 300 includes a fourth splitting unit 320.
  • the fourth splitting unit 320 is configured to: if the second condition is met and the number of billing lines to be issued does not exceed the preset upper limit number of lines, the second splitting method is used according to the preset issuance limit. Split the invoiced amount of the invoice to obtain the invoiced amount, product quantity, and product value of multiple sub-invoices.
  • the second condition is that: the amount of the single line commodity exceeds the single line commodity limit, and the amount of the unit price of the commodity does not exceed the unit price limit of the commodity.
  • the second splitting method includes the following steps:
  • the invoiced amount, product quantity, and product quantity in the first sub-invoice of the plurality of sub-invoices according to the preset maximum invoicing limit, the unit price of the goods in the to-be-invoiced invoice and the quantity of goods, the preset basic freight and the preset basic discount Commodity amount, shipping, discount, and said quantity value.
  • the invoiced amount of the to-be-issued invoice the invoiced amount of the first sub-invoice, and the quantity value, the number of commodities in the first sub-invoice, and the quantity value, obtain the first sub-invoice
  • T1 ROUNDDOWN(S1/S0*T0);
  • K1 J1+T1–D1;
  • Tn T0-T1*Num
  • D1 may be a negative number, in this case you need to recalculate the invoiced amount and discount:
  • M is the maximum limit for invoicing
  • K1 is the invoicing amount of the first sub-invoice
  • K0 is the invoicing amount to be invoiced
  • S0 is the quantity of goods to be invoiced
  • S1 is the quantity of goods in the first sub-invoice
  • J1 is the product amount of the first sub-invoice
  • P is the unit price of the product
  • Num is the number of the first sub-invoice with a splittable amount of K1
  • Kn is the invoiced amount of the second sub-invoice
  • Sn is the product of the second sub-invoice
  • Jn is the commodity amount of the second sub-invoice
  • T0 is the basic freight
  • T1 is the freight of the first sub-invoice
  • Tn is the freight of the second sub-invoice
  • D0 is the basic discount
  • D1 is the discount of the second sub-invoice
  • Dn The discount for the second sub-invoice.
  • the multiple sub-invoices include NuL first sub-invoices and one second sub-
  • the invoiced amount to be invoiced further includes the multi-line commodity amount and the multi-line commodity unit price amount.
  • the second splitting module 300 includes a fifth splitting unit 330.
  • the fifth splitting unit 330 is configured to generate the multiple sub-invoices through the first processing method, the second processing method, and the third processing method according to the multi-line commodity amount and the multi-line commodity unit price amount.
  • the first processing method is: if the first condition is met, split the invoiced amount that meets the first condition in the to-be-invoiced invoice through the first splitting method, to obtain multiple pieces The invoiced amount, product quantity, and product value of the invoice.
  • the second processing method is: if the second condition is met, split the invoiced amount that meets the second condition in the to-be-invoiced invoice through the second splitting method to obtain multiple sub-invoices Invoice amount, product quantity, and product value.
  • the third processing method is: if the invoice amount of the invoice to be invoiced meets the condition that the single line commodity amount does not exceed the single line commodity limit, a corresponding sub-invoice is generated according to the invoice amount that meets the condition.
  • the invoiced amount to be invoiced also includes the multi-line commodity amount and the multi-line commodity unit price amount.
  • the invoicing amount to be invoiced is divided into the following three groups:
  • the invoiced amount that meets the first condition in the to-be-invoiced invoice is split by the first splitting method to obtain the invoiced amount and commodities of multiple sub-invoices Quantity and amount of goods.
  • the invoiced amount that meets the second condition in the to-be-invoiced invoices is split by the second splitting method to obtain the invoiced amount, product quantity, and quantity of multiple sub-invoices.
  • the amount of goods is split by the second splitting method to obtain the invoiced amount, product quantity, and quantity of multiple sub-invoices.
  • the third splitting module 400 is configured to: if the billing amount of the bill to be issued exceeds the preset billing limit, and the number of billing lines to be billed exceeds the preset upper limit number of rows, according to the preset The upper limit number of lines and the preset invoicing limit split the invoiced amount and the number of invoicing lines to be invoiced to obtain multiple sub-invoices.
  • the invoicing amount to be invoiced also includes the multi-line product amount and the multi-line product unit price amount, and the number of invoicing lines to be invoiced exceeds the preset upper limit number of lines and the number of lines to be invoiced.
  • the billing amount of the invoice exceeds the preset billing limit. That is, the number of invoice lines for the commodities to be invoiced exceeds the maximum allowable number of lines and the invoice amount also exceeds the maximum limit.
  • the invoice to be invoiced is set according to the preset upper limit number of lines and the preset invoice limit. Split the billing amount and the number of billing lines to obtain multiple sub-invoices.
  • the third splitting module 400 includes a sixth splitting unit 410.
  • the sixth splitting unit 410 is configured to generate the multiple sub-invoices through the first processing method, the second processing method, and the fourth processing method according to the multi-line commodity amount and the multi-line commodity unit price amount.
  • the fourth processing method is: when the invoiced amount of the invoice to be invoiced meets the condition that the single line commodity amount does not exceed the single line commodity limit, the optimal combination split method is used to generate the sub-invoice.
  • the optimal combination split method is as follows:
  • the accumulation step includes: sequentially accumulating the commodity amounts of multiple commodities in the commodity collection until the accumulated sum is closest to the preset invoicing limit or the number of accumulated rows is equal to the preset upper limit of rows , Obtain the sub-invoice according to the information of multiple products to be accumulated;
  • the multiple commodities in the accumulation step are removed from the commodity set, and the accumulation step is performed on the commodities in the commodity set after the removal, until no commodities are included in the commodity set.
  • the first processing method and the second processing method are as described in the above embodiment.
  • the judgment conditions of the commodity amount and the commodity unit price in the invoiced amount to be issued by the two are given, and the corresponding split processing method. No more details here.
  • the optimal plan is combined according to the maximum number of commodity lines issued and the maximum commodity amount limit. Specifically, the greedy algorithm is used to make the recombined billing amount closer to the billing limit to minimize the number of split votes, which is the optimal combination split method.
  • the commodities to be invoiced are sorted according to the single line commodity amount from large to small to obtain a commodity set. Further, the accumulation step is performed.
  • the accumulation step includes: sequentially accumulating the commodity amounts of multiple commodities in the commodity collection until the accumulated sum is closest to the preset invoicing limit or the number of accumulated rows is equal to the preset upper limit of rows.
  • the accumulated information of multiple commodities generates a sub-invoice.
  • the accumulation step is executed each time, multiple commodities participating in the accumulation step are removed from the commodity set from the commodity set to obtain the eliminated commodity set. Further, the step of accumulating is performed on the product set after removal. The analogy is continued until no commodities are included in the commodity set.
  • the amount of a single line product exceeds the limit and the unit price of the product does not exceed the limit
  • the single line product amount has not exceeded the limit
  • the group situation adopts the first treatment method.
  • the group situation adopts the second treatment method.
  • 6Group situation The single line commodity amount does not exceed the limit, and the maximum invoicing limit is used for combination. See the "Optimal Combination Split Logic" section for combination to minimize grouping.
  • the optimal combination split logic is as follows:
  • the optimal split combination After executing the optimal combination split logic, the optimal split combination can be obtained.
  • the various modules in the device for splitting over-limit invoices can be implemented in whole or in part by software, hardware, and combinations thereof.
  • the foregoing modules may be embedded in the form of hardware or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the foregoing modules.
  • a computer device is provided.
  • the computer device may be a server, and its internal structure diagram may be as shown in FIG. 10.
  • the computer equipment includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide calculation and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, a computer program, and a database.
  • the internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium.
  • the database of the computer equipment is used to store billing data.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer program is executed by the processor to realize the method for splitting over-quota invoices as described in any of the above embodiments.
  • FIG. 10 is only a block diagram of part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied.
  • the specific computer device may Including more or fewer parts than shown in the figure, or combining some parts, or having a different arrangement of parts.
  • a computer device including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and the processor implements the following steps when the processor executes the computer program:
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the method for splitting an over-quota invoice described in any of the above embodiments is implemented.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
  • Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

Landscapes

  • Business, Economics & Management (AREA)
  • Development Economics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Technology Law (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Cash Registers Or Receiving Machines (AREA)

Abstract

本申请涉及一种超限额发票的拆分方法、装置、计算机设备和存储介质。所述方法包括:判断待开发票的开票金额是否超过预设开票限额以及开票行数是否超过预设上限行数;若开票金额未超过预设开票限额且开票行数超过预设上限行数,根据预设上限行数将该开票行数进行拆分以得到多张子发票;若开票金额超过预设开票限额且开票行数未超过预设上限行数,根据预设开票限额将开票金额进行拆分,得到多张子发票;若开票金额超过预设开票限额且开票行数超过预设上限行数,根据预设上限行数以及预设开票限额将开票金额以及开票行数进行拆分以得到多张子发票。因此自动化对超限额发票进行拆分处理,避免发票开具效率低的问题。

Description

超限额发票的拆分方法、装置、计算机设备和存储介质 技术领域
本申请涉及企业应用中税务管理技术领域,特别是涉及一种超限额发票的拆分方法、装置、计算机设备和存储介质。
背景技术
目前包括电子发票、增值税发票以及普通发票等在内的多种发票基本实现了自动收集和开票,但是对于超限额的发票还需要线下人工开具或是在业务系统里面手工拆分处理后再开具。线下人工开具和人为手工拆分降低了开票时效性和用户体验,准确性得不到保证,也增加了客户开票的复杂度。
发明内容
基于此,有必要针对上述技术问题,提供一种能够自动化拆分发票的超额发票的拆分方法、装置、计算机设备和存储介质,以自动化对超限额的发票进行拆分处理,避免人工拆分发票引起的发票开具效率低的问题。
一种超限额发票的拆分方法,所述方法包括:判断待开发票的开票金额是否超过预设开票限额,以及待开发票的开票行数是否超过预设上限行数;若所述待开发票的开票金额未超过所述预设开票限额,且所述待开发票的开票行数超过所述预设上限行数,根据所述预设上限行数将所述待开发票的开票行数进行拆分,得到多张子发票;若所述待开发票的开票金额超过所述预设开票限额,且所述待开发票的开票行数未超过所述预设上限行数,根据所述预设开票限额将所述待开发票的开票金额进行拆分,得到多张子发票;若所述待开发票的开票金额超过所述预设开票限额,且所述待开发票的开票行数超过所述预设上限行数,根据所述预设上限行数以及 所述预设开票限额将所述待开发票的开票金额以及开票行数进行拆分,得到多张子发票。
一种超限额发票的拆分装置,所述装置包括:判断模块,用于判断待开发票的开票金额是否超过预设开票限额,以及待开发票的开票行数是否超过预设上限行数;第一拆分模块,用于若所述待开发票的开票金额未超过所述预设开票限额,且所述待开发票的开票行数超过所述预设上限行数,根据所述预设上限行数将所述待开发票的开票行数进行拆分,得到多张子发票;第二拆分模块,用于若所述待开发票的开票金额超过所述预设开票限额,且所述待开发票的开票行数未超过所述预设上限行数,根据所述预设开票限额将所述待开发票的开票金额进行拆分,得到多张子发票;第三拆分模块,用于若所述待开发票的开票金额超过所述预设开票限额,且所述待开发票的开票行数超过所述预设上限行数,根据所述预设上限行数以及所述预设开票限额将所述待开发票的开票金额以及开票行数进行拆分,得到多张子发票。
一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现以下步骤:判断待开发票的开票金额是否超过预设开票限额,以及待开发票的开票行数是否超过预设上限行数;若所述待开发票的开票金额未超过所述预设开票限额,且所述待开发票的开票行数超过所述预设上限行数,根据所述预设上限行数将所述待开发票的开票行数进行拆分,得到多张子发票;若所述待开发票的开票金额超过所述预设开票限额,且所述待开发票的开票行数未超过所述预设上限行数,根据所述预设开票限额将所述待开发票的开票金额进行拆分,得到多张子发票;若所述待开发票的开票金额超过所述预设开票限额,且所述待开发票的开票行数超过所述预设上限行数,根据所述预设上限行数以及所述预设开票限额将所述待开发票的开票金额以及开票行数进行拆分,得到多张子发票。
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:判断待开发票的开票金额是否超过预设开票限额,以及待开发票的开票行数是否超过预设上限行数;若所述待开发票的开票金额未超过所述预设开票限额,且所述待开发票的开票行数超过所述预设上限行数,根据所述预设上限行数将所述待开发票的开票行数进行拆分,得到多张子发票;若所述待开发票的开票金额超过所述预设开票限额,且所述待开发票的开票行数未超过所述预设上限行数,根据所述预设开票限额将所述待开发票的开票金额进行拆分,得到多张子发票;若所述待开发票的开票金额超过所述预设开票限额,且所述待开发票的开票行数超过所述预设上限行数,根据所述预设上限行数以及所述预设开票限额将所述待开发票的开票金额以及开票行数进行拆分,得到多张子发票。
上述超额发票的拆分方法、装置、计算机设备和存储介质,在接收到待开发票的开具申请时,对待开发票的开票金额以及开票行数进行判断。判断待开发票的开票金额是否超过预设开票限额,以及待开发票的开票行数是否超过预设上限行数。若待开发票的开票金额未超过预设开票限额,且待开发票的开票行数超过预设上限行数,根据预设上限行数将待开发票的开票行数进行拆分,得到多张子发票。若待开发票的开票金额超过预设开票限额,且待开发票的开票行数未超过预设上限行数,根据预设开票限额将待开发票的开票金额进行拆分,得到多张子发票;若待开发票的开票金额超过预设开票限额,且待开发票的开票行数超过预设上限行数,根据预设上限行数以及预设开票限额将待开发票的开票金额以及开票行数进行拆分,得到多张子发票。因此,可以基于超限额发票中开票行数超限、开票金额超限以及两者都超限的三种超限情况,自动化拆分超限额发票,生成满足发票开具要求的多张子发票,提高了发票开具的时效性。
附图说明
图1为一个实施例中的一种超额发票的拆分方法的应用环境图;
图2为一个实施例中的一种超额发票的拆分方法的流程示意图;
图3为一个实施例中S200步骤的流程示意图;
图4为S200步骤的一个实施场景中的拆分示意图;
图5为一个实施例中S300步骤的流程示意图;
图6为另一个实施例中S300步骤的流程示意图;
图7为一个实施例中一种超额发票的拆分方法的开票系统架构示意图;
图8为一个实施例中一种超额发票的拆分方法的拆分流程图;
图9为一个实施例中一种超额发票的拆分装置的结构框图;
图10为一个实施例中计算机设备的内部结构图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供的一种超限额发票的拆分方法,可以应用于如图1所示的应用环境中。其中,终端102通过网络与服务器104通过网络进行通信。终端102向服务器104发送发票的开票申请请求。服务器104读取到终端102的开票申请请求以及请求中的开票数据,根据开票数据对超限额发票进行拆分处理,得到多张满足开票要求的子发票。开票要求中对于开票超限的限定一般分为商品行数超限、开票金额超限和两者都超限。开票限额与商户资质有关,有千元版、万元版、十万元版等。超过上述限额,服务器104将终端102提交请求中的原发票拆分之后再开具满足开票要求的多张发票。另外受开票端限制,单张发票最大支持开票商品行数也有限制,超过限制时服务器104也需将发票中的商品行拆分成不同的分组后生成多张子发票。本申请中的服务器104,通过对终端102提交的发票开票申请,判断待开发票是否属于超限额发票。若是,则将待开发票进行拆分处理后,生成多张满足发票开具要求的子发票。其中,终端102可以但不限于是各 种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备,服务器104可以用独立的服务器或者是多个服务器组成的服务器集群来实现。
在一个实施例中,如图2所示,提供了一种超限额发票的拆分方法,以该方法应用于图1中的服务器为例进行说明,包括以下步骤:
S100,判断待开发票的开票金额是否超过预设开票限额,以及待开发票的开票行数是否超过预设上限行数。
在本实施例中,服务器接收到终端发送的开具待开发票的请求,并从该请求中读取出待开发票中的开票数据。开票数据中包括待开发票的开票金额以及待开发票的开票行数。其中,服务器根据发票开具的要求,提前设置有预设开票限额和预设上限行数。预设开票限额和预设上限行数可随时灵活配置。进一步地,服务器对开票数据进行校验,包括待开发票的开票金额和商品行金额是否匹配、商品行数量乘以单价是否与商品行金额匹配等,将满足条件的数据进行后续处理。校验完毕之后,服务器判断待开发票的开票金额是否超过系统中预设开票限额,以及待开发票的开票行数是否超过系统中预设上限行数。根据判断结果执行下述步骤S200或步骤S300或步骤S400。
S200,若所述待开发票的开票金额未超过所述预设开票限额,且所述待开发票的开票行数超过所述预设上限行数,根据所述预设上限行数将所述待开发票的开票行数进行拆分,得到多张子发票。
在本实施例中,服务器判断的结果为,待开发票的开票金额未超过预设开票限额且待开发票的开票行数超过预设上限行数,此时服务器根据预设上限行数将待开发票的开票行数进行拆分,得到多张子发票。
在该实施例的一个实施方式中,步骤S200中“根据所述预设上限行数将所述待开发票的开票行数进行拆分,得到多张子发票”,包括:根据所述待开发票的开票行数和所述预设上限行数,对所述待开发票待开发票的开票行数进行拆分,得到Roundup(S)张子发票,S为所述待开发票的开 票行数和所述预设上限行数的商值,Roundup(S)表示对S向上取整。具体地,如图3所示,在该实施方式的一个实施过程中,该步骤包括:
S210,将所述待开发票的开票行数除以所述预设上限行数,得到商值N和余数n。
S230,当所述余数n为零时,将所述待开发票拆分成N张子发票,控制每张所述子发票的开票行数为所述预设上限行数,生成所述N张子发票。
S250,当所述余数n不为零时,将所述待开发票拆分成N+1张子发票,控制N张子发票中每张发票的开票行数为所述预设上限行数,剩余子发票的开票行数为n行,生成所述N+1张子发票。
具体地,在该场景中,待开发票中的商品行数大于最大开票行数,但是待开发票中的开票金额没有超限,此时服务器只需要将待开发票中的商品行分组处理即可。例如,如图4所示,预设上限行数为99行,服务器将待开发票中的商品行数除以99后得到商值N和余数n。N张子发票中每张子发票的商品行数为99,剩余一张子发票的商品行数为n。因此,通过该实施方式,控制拆分后大多数子发票的商品行数为预设上限行数,可减少开具的子发票的数量,节能环保,为用户提供更好的体验和服务。
S300,若所述待开发票的开票金额超过所述预设开票限额,且所述待开发票的开票行数未超过所述预设上限行数,根据所述预设开票限额将所述待开发票的开票金额进行拆分,得到多张子发票。
在本实施例中,服务器判断的结果为,待开发票的开票金额超过预设开票限额且待开发票的开票行数未超过预设上限行数,此时服务器根据预设开票限额将待开发票的开票金额进行拆分,得到多张子发票。具体可以是,按照开票金额最大化原则将待开发票的开票金额进行拆分,根据拆分结果生成多张子发票。其中,开票金额最大化原则为控制每张子发票的金额尽可能最大化。该场景下,待开发票的商品行数在最大开票行数内,但是开票金额超过最大开票金额。此时,开票金额超过最大开票金额具体分 为单商品开票金额超限和多商品开票金额超限。其中,单商品开票金额超限又分为商品单价金额超限和商品单价金额未超限。
在该实施例的一个实施方式中,所述待开发票的开票金额包括单行商品金额和商品单价金额,所述预设开票限额包括单行商品限额和商品单价限额。此时,步骤S300,包括:若满足第一条件且所述待开发票的开票行数未超过所述预设上限行数,根据所述预设开票限额通过第一拆分方式将所述待开发票的开票金额进行拆分,得到多张子发票的开票金额、商品数量以及商品金额。其中,所述第一条件为:所述单行商品金额超过所述单行商品限额以及所述商品单价金额超过所述商品单价限额。如图5所示,所述第一拆分方式包括如下步骤:
S301,根据预设开票最大限额、所述待开发票中的开票金额、商品单价和商品数量获取所述多张子发票中第一子发票中的开票金额、商品数量和商品金额,以及所述第一子发票的数量值。
具体地,根据开票最大限额获取第一子发票的开票金额。根据所述第一子发票的开票金额、所述待开发票的开票金额和所述待开发票的商品数量获取所述第一子发票中的商品数量。根据所述第一子发票中的商品数量和所述待开发票中的商品单价获取所述第一子发票的商品金额。根据所述待开发票的开票金额和所述第一子发票的开票金额获取所述多张子发票中所述第一子发票的数量值。
S303,根据所述待开发票的开票金额、所述第一子发票的开票金额以及数量值、所述第一子发票中的商品数量以及所述数量值,获取所述多张子发票中第二子发票的开票金额、商品数量和商品金额。
具体地,根据所述待开发票的开票金额、所述第一子发票的开票金额和所述数量值获取第二子发票的开票金额;根据所述待开发票的商品数量、所述第一子发票中的商品数量以及所述数量值获取第二子发票中的商品数 量。根据所述第二子发票中的商品数量以及所述待开发票中的商品单价获取所述第二子发票的商品金额。
该场景下的实施例中,生成的多张子发票包括L张第一子发票和1张第二子发票;L表示所述数量值。
此外,在该实施方式中,所述方法还包括:通过以下方式得到所述第一拆分方式中第一子发票中的运费和折扣,以及所述第二子发票中的运费和折扣:
根据所述第一子发票的开票金额和商品金额、所述待开发票的开票金额以及预设基础运费获取所述第一子发票中的运费和折扣;根据所述预设基础运费、所述第一子发票中的运费和所述数量值、所述第二子发票的开票金额和商品金额,获取所述第二子发票中的运费和折扣。
具体地,根据所述第一子发票的开票金额、所述待开发票的开票金额以及预设基础运费获取所述第一子发票中的运费;根据所述第一子发票的商品金额、所述第一子发票中的运费以及所述第一子发票的开票金额获取所述第一子发票中的折扣;根据所述预设基础运费、所述第一子发票中的运费以及所述第一子发票的数量值获取所述第二子发票中的运费;根据所述第二子发票的商品金额、所述第二子发票中的运费以及所述第二子发票的开票金额获取所述第二子发票中的折扣。
为了进一步说明上述场景下的实施例,以下给出一具体实施方式:
按照开票金额最大化原则进行拆分,先计算拆分后开票金额(最大限额M减去1元),再计算出拆分数量,拆分数量*单价(拆分前后商品单价保持不变)得到商品金额。若包含运费再按比例折算出拆分运费,最后根据拆分金额、商品金额、运费算出折扣,规则如下:
K1=M–1;
S1=ROUNDDOWN(K1/K0*S0);
J1=S1*P;
Num=INT(K0/K1);
Kn=K0-k1*Num
Sn=S0–S1*Num
Jn=Sn*P
其中,M为开票最大限额,K1为第一子发票的开票金额,K0为所述待开发票的开票金额,S0为所述待开发票的商品数量,S1为第一子发票中的商品数量,J1为第一子发票的商品金额,P为商品单价;Num为可拆分金额为K1的第一子发票张数,Kn为第二子发票的开票金额,Sn为第二子发票的商品数量,Jn为第二子发票的商品金额;所述多张子发票包括NuL张第一子发票和一张第二子发票。
此时,运费和折扣的计算方式如下:
第一子发票的运费计算为:T1=ROUNDDOWN(K1/K0*T0)。
Figure PCTCN2020097963-appb-000001
若运费为0,此处运费计算可忽略。
第一子发票的折扣计算为:D1=J1+T1-K1。
若折扣为0,此处折扣计算可忽略。
考虑D1可能为负数,此时需要重计算开票金额和折扣:
Figure PCTCN2020097963-appb-000002
第二子发票的运费计算为:Tn=T0–T1*Num
Figure PCTCN2020097963-appb-000003
若运费为0,此处运费计算可忽略。
第二子发票的折扣计算为:Dn=Jn+Tn-Kn
同上面折扣处理,D1可能为负数,此时需要重计算开票金额和折扣:
Figure PCTCN2020097963-appb-000004
T0为基础运费,T1为第一子发票的运费,Tn为第二子发票的运费,D0为基础折扣,D1为第二子发票的折扣,Dn为第二子发票的折扣。
在该实施例的另一个实施方式中,步骤S300,还包括:若满足第二条件且所述待开发票的开票行数未超过所述预设上限行数,根据所述预设开票限额通过第二拆分方式将所述待开发票的开票金额进行拆分,得到多张子发票的开票金额、商品数量以及商品金额。其中,所述第二条件为:所述单行商品金额超过所述单行商品限额,以及所述商品单价金额未超过所述商品单价限额。如图6所示,所述第二拆分方式包括如下步骤:
S305,根据预设开票最大限额、所述待开发票中的商品单价以及商品数量、预设基础运费和预设基础折扣获取所述多张子发票中的第一子发票中的开票金额、商品数量、商品金额、运费、折扣以及所述数量值。
S307,根据所述待开发票的开票金额、所述第一子发票的开票金额以及所述数量值、所述第一子发票中的商品数量以及所述数量值,获取所述多张子发票中第二子发票的开票金额、商品数量和商品金额、运费以及折扣。
具体地,根据开票最大限额、所述待开发票中的商品单价、所述预设基础运费、所述待开发票的商品数量以及预设基础折扣获取所述第一子发票中的商品数量;根据所述第一子发票中的商品数量以及所述待开发票中的商品单价获取所述第一子发票的商品金额;根据所述第一子发票中的商品数量、所述待开发票的商品数量以及所述预设基础运费获取所述第一子发票中的运费;根据所述第一子发票中的商品数量、所述待开发票的商品 数量以及所述预设基础折扣获取所述第一子发票中的折扣;根据所述第一子发票的商品金额、所述第一子发票中的运费以及所述第一子发票中的折扣获取所述第一子发票的开票金额;根据所述待开发票的开票金额和所述第一子发票的开票金额获取所述多张子发票中所述第一子发票的数量值;根据所述待开发票的开票金额、所述第一子发票的开票金额和所述数量值获取第二子发票的开票金额;根据所述待开发票的商品数量、所述第一子发票中的商品数量以及所述数量值获取第二子发票中的商品数量;根据所述第二子发票中的商品数量以及所述待开发票中的商品单价获取所述第二子发票的商品金额;其中,所述多张子发票包括L张第一子发票和1张第二子发票,L表示所述数量值。
为了进一步说明上述场景下的实施例,以下给出一具体实施方式:
该场景参见规则如下:
S1=INT((M–1)/(P+(T0–D0/S0));
J1=S1*P;
T1=ROUNDDOWN(S1/S0*T0);
D1=ROUNDDOWN(S1/S0*D0);
K1=J1+T1–D1;
Num=INT(K0/K1);
Kn=K0-k1*Num;
Sn=S0–S1*Num;
Jn=Sn*P;
Tn=T0–T1*Num;
Figure PCTCN2020097963-appb-000005
若运费为0,此处运费计算可忽略。
第二子发票的折扣计算为:Dn=Jn+Tn-Kn
同上面折扣处理,D1可能为负数,此时需要重计算开票金额和折扣:
Figure PCTCN2020097963-appb-000006
其中,M为开票最大限额,K1为第一子发票的开票金额,K0为所述待开发票的开票金额,S0为所述待开发票的商品数量,S1为第一子发票中的商品数量,J1为第一子发票的商品金额,P为商品单价;Num为可拆分金额为K1的第一子发票张数,Kn为第二子发票的开票金额,Sn为第二子发票的商品数量,Jn为第二子发票的商品金额;T0为基础运费,T1为第一子发票的运费,Tn为第二子发票的运费,D0为基础折扣,D1为第二子发票的折扣,Dn为第二子发票的折扣。所述多张子发票包括NuL张第一子发票和一张第二子发票。
在该实施例的一个实施方式中,所述待开发票的开票金额还包括多行商品金额和多行商品单价金额。此时,步骤S300,还包括:根据所述多行商品金额和多行商品单价金额,通过第一处理方式、第二处理方式和第三处理方式生成所述多张子发票。其中,所述第一处理方式为:若满足所述第一条件,通过所述第一拆分方式将所述待开发票中满足所述第一条件的开票金额进行拆分,得到多张子发票的开票金额、商品数量以及商品金额。所述第二处理方式为:若满足所述第二条件,通过所述第二拆分方式将所述待开发票中满足所述第二条件的开票金额进行拆分,得到多张子发票的开票金额、商品数量以及商品金额。所述第三处理方式为:若所述待开发票的开票金额中满足所述单行商品金额未超过所述单行商品限额的条件,根据满足该条件的开票金额生成对应的子发票。
在该实施方式中,待开发票的开票金额还包括多行商品金额和多行商品单价金额。在该场景下,根据商品单行金额是否超过预设开票限额,将待开发票的开票金额分为以下三组情况:
①单行商品金额超限且商品单价金额超限
②单行商品金额超限且商品单价金额未超限
③单行商品金额未超限
其中,①组情况满足所述第一条件,通过所述第一拆分方式将所述待开发票中满足所述第一条件的开票金额进行拆分,得到多张子发票的开票金额、商品数量以及商品金额。
②组情况满足所述第二条件,通过所述第二拆分方式将所述待开发票中满足所述第二条件的开票金额进行拆分,得到多张子发票的开票金额、商品数量以及商品金额。
③组情况由于商品行数未超限,并且单行商品金额未超限,根据满足该条件的开票金额生成对应的子发票,直接将满足该条件的开票金额组合后请求开票。
需要说明的是,此处的第一条件、第二条件、第一拆分方式以及第二拆分方式,在以上实施例中已解释说明,此处不再详述。
S400,若所述待开发票的开票金额超过所述预设开票限额,且所述待开发票的开票行数超过所述预设上限行数,根据所述预设上限行数以及所述预设开票限额将所述待开发票的开票金额以及开票行数进行拆分,得到多张子发票。
在本实施例中,所述待开发票的开票金额还包括多行商品金额和多行商品单价金额,并且所述待开发票的开票行数超过所述预设上限行数以及所述待开发票的开票金额超过所述预设开票限额。也即是,待开发票中商品的开票行数超过最大允许行数且开票金额也超过最大限额,此时,根据所述预设上限行数以及所述预设开票限额将所述待开发票的开票金额以及开票行数进行拆分,得到多张子发票。
具体地,根据所述多行商品金额和多行商品单价金额,通过所述第一处理方式、所述第二处理方式和第四处理方式生成所述多张子发票。其中,所述第四处理方式为:所述待开发票的开票金额满足所述单行商品金额未 超过所述单行商品限额的条件时,采用最优组合拆分法生成所述子发票。所述最优组合拆分法如下:
按照单行商品金额从大到小将所述待开发票的商品进行排序,得到商品集合;
执行累加步骤;所述累加步骤包括:依序将商品集合中多项商品的商品金额进行累加,直至累加和最接近所述预设开票限额或累加的行数等于所述预设上限行数时,根据该进行累加的多项商品的信息得到子发票;
将所述累加步骤中的多项商品从所述商品集合中剔除,对剔除后的所述商品集合中的商品执行所述累加步骤,直至所述商品集合中不包含商品为止。
在该实施例中,第一处理方式和第二处理方式,如以上实施例所述。以上实施例中给出了两者对于待开发票的开票金额中商品金额以及商品单价的判断条件,及其对应的拆分处理方式。此处不再详述。对于第四处理方式,根据开票最大商品行数和最大商品金额限额组合出最优的方案。具体使用贪婪算法,使重新组合的开票金额越接近开票限额即可使拆分的票数最小,也即是所述最优组合拆分法。
在最优组合拆分法中,首先按照单行商品金额从大到小将所述待开发票的商品进行排序,得到商品集合。进一步地,执行累加步骤。累加步骤中,包括:依序将商品集合中多项商品的商品金额进行累加,直至累加和最接近所述预设开票限额或累加的行数等于所述预设上限行数时,根据该进行累加的多项商品的信息生成子发票。每次执行累加步骤后,从商品集合中将参与累加步骤的多项商品从所述商品集合中剔除,得到剔除后的商品集合。进一步地,在对剔除后的商品集合执行所述累加步骤。依次类推,直至所述商品集合中不包含商品为止。
对于该实施例,以下给出一具体实施场景:
该场景较为复杂,待开发票中的商品行数超过最大允许行数且商品的开票金额也超过最大限额,对商品行进行分组,具体可参照以下分组逻辑:
Figure PCTCN2020097963-appb-000007
因此,可将待开发票分为以下三组情况:
④单行商品金额超限且商品单价金额超限
⑤单行商品金额超限且商品单价金额未超限
⑥单行商品金额未超限
针对不同的分组采用对应的处理方法:
其中,④组情况采用第一处理方式。⑤组情况采用第二处理方式。具体处理方式参见以上第一处理方式和第二处理方式的说明,此处不再详述。⑥组情况单行商品金额未超限,以最大开票限额进行组合。组合参看“最优组合拆分逻辑”部分,使分组达到最少。最优组合拆分逻辑如下所示:
(1)先将开票金额按照从大到小依次排序;
{Arrays.sort(array[],Collections.reverseOrder());
(2)从第一位开始和后面的数据依次相加直到结束,如果各商品行的和将要大于等于最大开票限额或相加的商品行数将要大于等于最大开票行数时停止,本次相加的所有商品行即为一个拆分开票分组;
(3)剩下的元素重复步骤2直到没有元素剩下;
执行完该最优组合拆分逻辑后,可得到最优拆分组合。
上述实施例所述的超限额发票的拆分方法,服务器通过判断待开发票的开票金额是否超过预设开票限额以及待开发票的开票行数是否超过预设上限行数。根据三种判断结果,对每种判断结果给出对应的拆分方式,自动完成超限发票的拆分处理,无需人员手动介入,省时高效,准确方便。 另外,该方法普遍适用于电子发票、增值税发票、普通发票等多类票据,适用范围广。该方法中实现了智能拆分组合算法,使拆分达到最优组合,开票张数最少,既最大的提升效率同时又节能环保。
为了进一步详述上述实施例所述的超限额发票的拆分方法,以下结合开具电子发票的架构系统,给出一具体的实施方式:
该架构系统包括交易系统和开票前置系统交互图,如图7所示。多个线上交易系统向服务器后端提交交易信息。服务器后端包括开票前置模块和开票系统。开票前置模块对线上交易系统提交的交易信息进行验证以及拆分,并输出拆分结果等。其中,交易信息中包含待开发票的开票数据。开票数据包括开票金额和开票行数。线上交易系统输出拆分结果后,向开票系统发送开票请求,开票系统根据拆分结果进行自动化开票。其中,开票前置模块基于线上交易系统提交的交易信息进行开票拆分的拆分流程图如图8所示。
因此,随着电子发票的全业态覆盖,无纸化自动开票普及到各个业态。使用本申请的超限额发票的拆分方法自动化开具电子发票,电子发票的业务系统改动很小,无需再重复开发,且该方法提供了最优的拆分逻辑,计算高效。同时提供标准SDK,支持快速接入,输出标准拆分结果。业务系统可以无缝集成,无需在重复设计开发,提高了效率。
应该理解的是,虽然说明书附图的各个流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,各个流程图中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
在一个实施例中,如图9所示,提供了一种超限额发票的拆分装置。该拆分装置包括:判断模块100、第一拆分模块200、第二拆分模块300和第三拆分模块400,其中:
判断模块100,用于判断待开发票的开票金额是否超过预设开票限额,以及待开发票的开票行数是否超过预设上限行数。
在本实施例中,服务器接收到终端发送的开具待开发票的请求,并从该请求中读取出待开发票中的开票数据。开票数据中包括待开发票的开票金额以及待开发票的开票行数。其中,服务器根据发票开具的要求,提前设置有预设开票限额和预设上限行数。预设开票限额和预设上限行数可随时灵活配置。进一步地,服务器对开票数据进行校验,包括待开发票的开票金额和商品行金额是否匹配、商品行数量乘以单价是否与商品行金额匹配等,将满足条件的数据进行后续处理。校验完毕之后,服务器判断待开发票的开票金额是否超过系统中预设开票限额,以及待开发票的开票行数是否超过系统中预设上限行数。根据判断结果选择第一拆分模块200、第二拆分模块300或第三拆分模块400,由选择的拆分模块进行后续的开票拆分处理。
第一拆分模块200,用于若所述待开发票的开票金额未超过所述预设开票限额,且所述待开发票的开票行数超过所述预设上限行数,根据所述预设上限行数将所述待开发票的开票行数进行拆分,得到多张子发票。
在本实施例中,服务器判断的结果为,待开发票的开票金额未超过预设开票限额且待开发票的开票行数超过预设上限行数,此时服务器根据预设上限行数将待开发票的开票行数进行拆分,得到多张子发票。
在一实施方式中,第一拆分模块200还用于根据所述待开发票的开票行数和所述预设上限行数,对所述待开发票待开发票的开票行数进行拆分,得到Roundup(S)张子发票,S为所述待开发票的开票行数和所述预设上限行数的商值,Roundup(S)表示对S向上取整。在一具体实施方式中, 第一拆分模块200包括计算单元210、第一拆分单元220、第二拆分单元230。其中,计算单元210用于将所述待开发票的开票行数除以所述预设上限行数,得到商值N和余数n。第一拆分单元220用于当所述余数n为零时,将所述待开发票拆分成N张子发票,控制每张所述子发票的开票行数为所述预设上限行数,生成所述N张子发票。第二拆分单元230用于当所述余数n不为零时,将所述待开发票拆分成N+1张子发票,控制N张子发票中每张发票的开票行数为所述预设上限行数,剩余子发票的开票行数为n行,生成所述N+1张子发票。
具体地,在该场景中,待开发票中的商品行数大于最大开票行数,但是待开发票中的开票金额没有超限,此时服务器只需要将待开发票中的商品行分组处理即可。例如,如图4所示,预设上限行数为99行,服务器将待开发票中的商品行数除以99后得到商值N和余数n。N张子发票中每张子发票的商品行数为99,剩余一张子发票的商品行数为n。因此,通过该实施方式,控制拆分后大多数子发票的商品行数为预设上限行数,可减少开具的子发票的数量,节能环保,为用户提供更好的体验和服务。
第二拆分模块300,用于若所述待开发票的开票金额超过所述预设开票限额,且所述待开发票的开票行数未超过所述预设上限行数,根据所述预设开票限额将所述待开发票的开票金额进行拆分,得到多张子发票。
在本实施例中,服务器判断的结果为,待开发票的开票金额超过预设开票限额且待开发票的开票行数未超过预设上限行数,此时服务器根据预设开票限额将待开发票的开票金额进行拆分,得到多张子发票。具体可以是,按照开票金额最大化原则将待开发票的开票金额进行拆分,根据拆分结果生成多张子发票。其中,开票金额最大化原则为控制每张子发票的金额尽可能最大化。该场景下,待开发票的商品行数在最大开票行数内,但是开票金额超过最大开票金额。此时,开票金额超过最大开票金额具体分为单商品开票金额超限和多商品开票金额超限。其中,单商品开票金额超限又分为商品单价金额超限和商品单价金额未超限。
在一实施方式中,所述待开发票的开票金额包括单行商品金额和商品单价金额,所述预设开票限额包括单行商品限额和商品单价限额。此时,第二拆分模块300包括第三拆分单元310。第三拆分单元310用于若满足第一条件且所述待开发票的开票行数未超过所述预设上限行数,根据所述预设开票限额通过第一拆分方式将所述待开发票的开票金额进行拆分,得到多张子发票的开票金额、商品数量以及商品金额。其中,所述第一条件为:所述单行商品金额超过所述单行商品限额以及所述商品单价金额超过所述商品单价限额。所述第一拆分方式包括如下步骤:根据预设开票最大限额、所述待开发票中的开票金额、商品单价和商品数量获取所述多张子发票中第一子发票中的开票金额、商品数量和商品金额,以及所述第一子发票的数量值。根据所述待开发票的开票金额、所述第一子发票的开票金额以及数量值、所述第一子发票中的商品数量以及所述数量值,获取所述多张子发票中第二子发票的开票金额、商品数量和商品金额。
具体地,根据开票最大限额获取第一子发票的开票金额。根据所述第一子发票的开票金额、所述待开发票的开票金额和所述待开发票的商品数量获取所述第一子发票中的商品数量。根据所述第一子发票中的商品数量和所述待开发票中的商品单价获取所述第一子发票的商品金额。根据所述待开发票的开票金额和所述第一子发票的开票金额获取所述多张子发票中所述第一子发票的数量值。
根据所述待开发票的开票金额、所述第一子发票的开票金额和所述数量值获取第二子发票的开票金额;根据所述待开发票的商品数量、所述第一子发票中的商品数量以及所述数量值获取第二子发票中的商品数量。根据所述第二子发票中的商品数量以及所述待开发票中的商品单价获取所述第二子发票的商品金额。该场景下的实施例中,生成的多张子发票包括L张第一子发票和1张第二子发票。
此外,在该实施方式中,还包括:通过以下方式得到所述第一拆分方式中第一子发票中的运费和折扣,以及所述第二子发票中的运费和折扣:
根据所述第一子发票的开票金额和商品金额、所述待开发票的开票金额以及预设基础运费获取所述第一子发票中的运费和折扣;根据所述预设基础运费、所述第一子发票中的运费和所述数量值、所述第二子发票的开票金额和商品金额,获取所述第二子发票中的运费和折扣。
具体地,根据所述第一子发票的开票金额、所述待开发票的开票金额以及预设基础运费获取所述第一子发票中的运费;根据所述第一子发票的商品金额、所述第一子发票中的运费以及所述第一子发票的开票金额获取所述第一子发票中的折扣;根据所述预设基础运费、所述第一子发票中的运费以及所述第一子发票的数量值获取所述第二子发票中的运费;根据所述第二子发票的商品金额、所述第二子发票中的运费以及所述第二子发票的开票金额获取所述第二子发票中的折扣。
为了进一步说明上述场景下的实施例,以下给出一具体实施方式:
按照开票金额最大化原则进行拆分,先计算拆分后开票金额(最大限额M减去1元),再计算出拆分数量,拆分数量*单价(拆分前后商品单价保持不变)得到商品金额。若包含运费再按比例折算出拆分运费,最后根据拆分金额、商品金额、运费算出折扣,规则如下:
K1=M–1;
S1=ROUNDDOWN(K1/K0*S0);
J1=S1*P;
Num=INT(K0/K1);
Kn=K0-k1*Num
Sn=S0–S1*Num
Jn=Sn*P
其中,M为开票最大限额,K1为第一子发票的开票金额,K0为所述待开发票的开票金额,S0为所述待开发票的商品数量,S1为第一子发票中的商品数量,J1为第一子发票的商品金额,P为商品单价;Num为可拆分金额为K1的第一子发票张数,Kn为第二子发票的开票金额,Sn为第二子发 票的商品数量,Jn为第二子发票的商品金额;所述多张子发票包括NuL张第一子发票和一张第二子发票。
此时,运费和折扣的计算方式如下:
第一子发票的运费计算为:T1=ROUNDDOWN(K1/K0*T0)。
Figure PCTCN2020097963-appb-000008
若运费为0,此处运费计算可忽略。
第一子发票的折扣计算为:D1=J1+T1-K1。
若折扣为0,此处折扣计算可忽略。
考虑D1可能为负数,此时需要重计算开票金额和折扣:
Figure PCTCN2020097963-appb-000009
第二子发票的运费计算为:Tn=T0–T1*Num
Figure PCTCN2020097963-appb-000010
若运费为0,此处运费计算可忽略。
第二子发票的折扣计算为:Dn=Jn+Tn-Kn
同上面折扣处理,D1可能为负数,此时需要重计算开票金额和折扣:
Figure PCTCN2020097963-appb-000011
T0为基础运费,T1为第一子发票的运费,Tn为第二子发票的运费,D0为基础折扣,D1为第二子发票的折扣,Dn为第二子发票的折扣。
在另一个实施方式中,第二拆分模块300包括第四拆分单元320。第四拆分单元320用于若满足第二条件且所述待开发票的开票行数未超过所述预设上限行数,根据所述预设开票限额通过第二拆分方式将所述待开发票的开票金额进行拆分,得到多张子发票的开票金额、商品数量以及商品金额。其中,所述第二条件为:所述单行商品金额超过所述单行商品限额,以及所述商品单价金额未超过所述商品单价限额。所述第二拆分方式包括如下步骤:
根据预设开票最大限额、所述待开发票中的商品单价以及商品数量、预设基础运费和预设基础折扣获取所述多张子发票中的第一子发票中的开票金额、商品数量、商品金额、运费、折扣以及所述数量值。根据所述待开发票的开票金额、所述第一子发票的开票金额以及所述数量值、所述第一子发票中的商品数量以及所述数量值,获取所述多张子发票中第二子发票的开票金额、商品数量和商品金额、运费以及折扣。
具体地,根据开票最大限额、所述待开发票中的商品单价、所述预设基础运费、所述待开发票的商品数量以及预设基础折扣获取所述第一子发票中的商品数量;根据所述第一子发票中的商品数量以及所述待开发票中的商品单价获取所述第一子发票的商品金额;根据所述第一子发票中的商品数量、所述待开发票的商品数量以及所述预设基础运费获取所述第一子发票中的运费;根据所述第一子发票中的商品数量、所述待开发票的商品数量以及所述预设基础折扣获取所述第一子发票中的折扣;根据所述第一子发票的商品金额、所述第一子发票中的运费以及所述第一子发票中的折扣获取所述第一子发票的开票金额;根据所述待开发票的开票金额和所述第一子发票的开票金额获取所述多张子发票中所述第一子发票的数量值;根据所述待开发票的开票金额、所述第一子发票的开票金额和所述数量值获取第二子发票的开票金额;根据所述待开发票的商品数量、所述第一子发票中的商品数量以及所述数量值获取第二子发票中的商品数量;根据所述第二子发票中的商品数量以及所述待开发票中的商品单价获取所述第二子 发票的商品金额;其中,所述多张子发票包括L张第一子发票和1张第二子发票,L表示所述数量值。。
为了进一步说明上述场景下的实施例,以下给出一具体实施方式:
该场景参见规则如下:
S1=INT((M–1)/(P+(T0–D0/S0));
J1=S1*P;
T1=ROUNDDOWN(S1/S0*T0);
D1=ROUNDDOWN(S1/S0*D0);
K1=J1+T1–D1;
Num=INT(K0/K1);
Kn=K0-k1*Num;
Sn=S0–S1*Num;
Jn=Sn*P;
Tn=T0–T1*Num;
Figure PCTCN2020097963-appb-000012
若运费为0,此处运费计算可忽略。
第二子发票的折扣计算为:Dn=Jn+Tn-Kn
同上面折扣处理,D1可能为负数,此时需要重计算开票金额和折扣:
Figure PCTCN2020097963-appb-000013
其中,M为开票最大限额,K1为第一子发票的开票金额,K0为所述待开发票的开票金额,S0为所述待开发票的商品数量,S1为第一子发票中的商品数量,J1为第一子发票的商品金额,P为商品单价;Num为可拆分金额为K1的第一子发票张数,Kn为第二子发票的开票金额,Sn为第二子发票的商品数量,Jn为第二子发票的商品金额;T0为基础运费,T1为第一 子发票的运费,Tn为第二子发票的运费,D0为基础折扣,D1为第二子发票的折扣,Dn为第二子发票的折扣。所述多张子发票包括NuL张第一子发票和一张第二子发票。
在另一个实施方式中,所述待开发票的开票金额还包括多行商品金额和多行商品单价金额。第二拆分模块300包括第五拆分单元330。第五拆分单元330用于根据所述多行商品金额和多行商品单价金额,通过第一处理方式、第二处理方式和第三处理方式生成所述多张子发票。其中,所述第一处理方式为:若满足所述第一条件,通过所述第一拆分方式将所述待开发票中满足所述第一条件的开票金额进行拆分,得到多张子发票的开票金额、商品数量以及商品金额。所述第二处理方式为:若满足所述第二条件,通过所述第二拆分方式将所述待开发票中满足所述第二条件的开票金额进行拆分,得到多张子发票的开票金额、商品数量以及商品金额。所述第三处理方式为:若所述待开发票的开票金额中满足所述单行商品金额未超过所述单行商品限额的条件,根据满足该条件的开票金额生成对应的子发票。
在该实施方式中,待开发票的开票金额还包括多行商品金额和多行商品单价金额。在该场景下,根据商品单行金额是否超过预设开票限额,将待开发票的开票金额分为以下三组情况:
⑦单行商品金额超限且商品单价金额超限
⑧单行商品金额超限且商品单价金额未超限
⑨单行商品金额未超限
其中,①组情况满足所述第一条件,通过所述第一拆分方式将所述待开发票中满足所述第一条件的开票金额进行拆分,得到多张子发票的开票金额、商品数量以及商品金额。
②组情况满足所述第二条件,通过所述第二拆分方式将所述待开发票中满足所述第二条件的开票金额进行拆分,得到多张子发票的开票金额、商品数量以及商品金额。
③组情况由于商品行数未超限,并且单行商品金额未超限,根据满足该条件的开票金额生成对应的子发票,直接将满足该条件的开票金额组合后请求开票。
需要说明的是,此处的第一条件、第二条件、第一拆分方式以及第二拆分方式,在以上实施例中已解释说明,此处不再详述。
第三拆分模块400,用于若所述待开发票的开票金额超过所述预设开票限额,且所述待开发票的开票行数超过所述预设上限行数,根据所述预设上限行数以及所述预设开票限额将所述待开发票的开票金额以及开票行数进行拆分,得到多张子发票。
在本实施例中,所述待开发票的开票金额还包括多行商品金额和多行商品单价金额,并且所述待开发票的开票行数超过所述预设上限行数以及所述待开发票的开票金额超过所述预设开票限额。也即是,待开发票中商品的开票行数超过最大允许行数且开票金额也超过最大限额,此时,根据所述预设上限行数以及所述预设开票限额将所述待开发票的开票金额以及开票行数进行拆分,得到多张子发票。
在一实施方式中,第三拆分模块400包括第六拆分单元410。第六拆分单元410用于根据所述多行商品金额和多行商品单价金额,通过所述第一处理方式、所述第二处理方式和第四处理方式生成所述多张子发票。其中,所述第四处理方式为:所述待开发票的开票金额满足所述单行商品金额未超过所述单行商品限额的条件时,采用最优组合拆分法生成所述子发票。所述最优组合拆分法如下:
按照单行商品金额从大到小将所述待开发票的商品进行排序,得到商品集合;
执行累加步骤;所述累加步骤包括:依序将商品集合中多项商品的商品金额进行累加,直至累加和最接近所述预设开票限额或累加的行数等于所述预设上限行数时,根据该进行累加的多项商品的信息得到子发票;
将所述累加步骤中的多项商品从所述商品集合中剔除,对剔除后的所述商品集合中的商品执行所述累加步骤,直至所述商品集合中不包含商品为止。
在该实施例中,第一处理方式和第二处理方式,如以上实施例所述。以上实施例中给出了两者对于待开发票的开票金额中商品金额以及商品单价的判断条件,及其对应的拆分处理方式。此处不再详述。对于第四处理方式,根据开票最大商品行数和最大商品金额限额组合出最优的方案。具体使用贪婪算法,使重新组合的开票金额越接近开票限额即可使拆分的票数最小,也即是所述最优组合拆分法。
在最优组合拆分法中,首先按照单行商品金额从大到小将所述待开发票的商品进行排序,得到商品集合。进一步地,执行累加步骤。累加步骤中,包括:依序将商品集合中多项商品的商品金额进行累加,直至累加和最接近所述预设开票限额或累加的行数等于所述预设上限行数时,根据该进行累加的多项商品的信息生成子发票。每次执行累加步骤后,从商品集合中将参与累加步骤的多项商品从所述商品集合中剔除,得到剔除后的商品集合。进一步地,在对剔除后的商品集合执行所述累加步骤。依次类推,直至所述商品集合中不包含商品为止。
对于该实施例,以下给出一具体实施场景:
该场景较为复杂,待开发票中的商品行数超过最大允许行数且商品的开票金额也超过最大限额,对商品行进行分组,具体可参照以下分组逻辑:
Figure PCTCN2020097963-appb-000014
因此,可将待开发票分为以下三组情况:
⑩单行商品金额超限且商品单价金额超限
Figure PCTCN2020097963-appb-000015
单行商品金额超限且商品单价金额未超限
Figure PCTCN2020097963-appb-000016
单行商品金额未超限
针对不同的分组采用对应的处理方法:
其中,④组情况采用第一处理方式。⑤组情况采用第二处理方式。具体处理方式参见以上第一处理方式和第二处理方式的说明,此处不再详述。⑥组情况单行商品金额未超限,以最大开票限额进行组合。组合参看“最优组合拆分逻辑”部分,使分组达到最少。最优组合拆分逻辑如下所示:
(1)先将开票金额按照从大到小依次排序;
{Arrays.sort(array[],Collections.reverseOrder());
(2)从第一位开始和后面的数据依次相加直到结束,如果各商品行的和将要大于等于最大开票限额或相加的商品行数将要大于等于最大开票行数时停止,本次相加的所有商品行即为一个拆分开票分组;
(3)剩下的元素重复步骤2直到没有元素剩下;
执行完该最优组合拆分逻辑后,可得到最优拆分组合。
关于上述超限额发票的拆分装置的具体限定可以参见上文中对于超限额发票的拆分方法的限定,在此不再赘述。上述超限额发票的拆分装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图10所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储开票数据。该计算机设备的网络接口 用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现上述任一实施例所述的超限额发票的拆分方法。
本领域技术人员可以理解,图10中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在一个实施例中,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行计算机程序时实现以下步骤:
判断待开发票的开票金额是否超过预设开票限额,以及待开发票的开票行数是否超过预设上限行数;若所述待开发票的开票金额未超过所述预设开票限额,且所述待开发票的开票行数超过所述预设上限行数,根据所述预设上限行数将所述待开发票的开票行数进行拆分,得到多张子发票;若所述待开发票的开票金额超过所述预设开票限额,且所述待开发票的开票行数未超过所述预设上限行数,根据所述预设开票限额将所述待开发票的开票金额进行拆分,得到多张子发票;若所述待开发票的开票金额超过所述预设开票限额,且所述待开发票的开票行数超过所述预设上限行数,根据所述预设上限行数以及所述预设开票限额将所述待开发票的开票金额以及开票行数进行拆分,得到多张子发票。
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述任一实施例所述的超限额发票的拆分方法。
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:
判断待开发票的开票金额是否超过预设开票限额,以及待开发票的开票行数是否超过预设上限行数;若所述待开发票的开票金额未超过所述预设开票限额,且所述待开发票的开票行数超过所述预设上限行数,根据所 述预设上限行数将所述待开发票的开票行数进行拆分,得到多张子发票;若所述待开发票的开票金额超过所述预设开票限额,且所述待开发票的开票行数未超过所述预设上限行数,根据所述预设开票限额将所述待开发票的开票金额进行拆分,得到多张子发票;若所述待开发票的开票金额超过所述预设开票限额,且所述待开发票的开票行数超过所述预设上限行数,根据所述预设上限行数以及所述预设开票限额将所述待开发票的开票金额以及开票行数进行拆分,得到多张子发票。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做 出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (10)

  1. 一种超限额发票的拆分方法,所述方法包括:
    判断待开发票的开票金额是否超过预设开票限额,以及待开发票的开票行数是否超过预设上限行数;
    若所述待开发票的开票金额未超过所述预设开票限额,且所述待开发票的开票行数超过所述预设上限行数,根据所述预设上限行数将所述待开发票的开票行数进行拆分,得到多张子发票;
    若所述待开发票的开票金额超过所述预设开票限额,且所述待开发票的开票行数未超过所述预设上限行数,根据所述预设开票限额将所述待开发票的开票金额进行拆分,得到多张子发票;
    若所述待开发票的开票金额超过所述预设开票限额,且所述待开发票的开票行数超过所述预设上限行数,根据所述预设上限行数以及所述预设开票限额将所述待开发票的开票金额以及开票行数进行拆分,得到多张子发票。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述预设上限行数将所述待开发票的开票行数进行拆分,得到多张子发票,包括:
    根据所述待开发票的开票行数和所述预设上限行数,对所述待开发票待开发票的开票行数进行拆分,得到Roundup(S)张子发票,S为所述待开发票的开票行数和所述预设上限行数的商值,Roundup(S)表示对S向上取整。
  3. 根据权利要求1所述的方法,其特征在于,所述待开发票的开票金额包括单行商品金额和商品单价金额,所述预设开票限额包括单行商品限额和商品单价限额;所述根据所述预设开票限额将所述待开发票的开票金额进行拆分,得到多张子发票,包括:
    若满足第一条件且所述待开发票的开票行数未超过所述预设上限行数,根据所述预设开票限额通过第一拆分方式将所述待开发票的开票金额进行拆分,得到多张子发票的开票金额、商品数量以及商品金额;其中,所述 第一条件为:所述单行商品金额超过所述单行商品限额以及所述商品单价金额超过所述商品单价限额;所述第一拆分方式如下所示:
    根据预设开票最大限额、所述待开发票中的开票金额、商品单价和商品数量获取所述多张子发票中第一子发票中的开票金额、商品数量和商品金额,以及所述第一子发票的数量值;
    根据所述待开发票的开票金额、所述第一子发票的开票金额以及数量值、所述第一子发票中的商品数量以及所述数量值,获取所述多张子发票中第二子发票的开票金额、商品数量和商品金额;
    所述多张子发票包括L张第一子发票和1张第二子发票,L表示所述数量值。
  4. 根据权利要求3所述的方法,其特征在于,所述方法还包括:通过以下方式得到所述第一拆分方式中第一子发票中的运费和折扣,以及所述第二子发票中的运费和折扣:
    根据所述第一子发票的开票金额和商品金额、所述待开发票的开票金额以及预设基础运费获取所述第一子发票中的运费和折扣;
    根据所述预设基础运费、所述第一子发票中的运费和所述数量值、所述第二子发票的开票金额和商品金额,获取所述第二子发票中的运费和折扣。
  5. 根据权利要求3所述的方法,其特征在于,所述根据所述预设开票限额将所述待开发票的开票金额进行拆分,得到多张子发票,还包括:若满足第二条件且所述待开发票的开票行数未超过所述预设上限行数,根据所述预设开票限额通过第二拆分方式将所述待开发票的开票金额进行拆分,得到多张子发票的开票金额、商品数量以及商品金额;其中,所述第二条件为:所述单行商品金额超过所述单行商品限额,以及所述商品单价金额未超过所述商品单价限额;所述第二拆分方式如下所示:
    根据预设开票最大限额、所述待开发票中的商品单价以及商品数量、预设基础运费和预设基础折扣获取所述多张子发票中的第一子发票中的开票金额、商品数量、商品金额、运费、折扣以及所述数量值;
    根据所述待开发票的开票金额、所述第一子发票的开票金额以及所述数量值、所述第一子发票中的商品数量以及所述数量值,获取所述多张子发票中第二子发票的开票金额、商品数量和商品金额、运费以及折扣;
    所述多张子发票包括L张第一子发票和1张第二子发票。
  6. 根据权利要求5所述的方法,其特征在于,所述待开发票的开票金额还包括多行商品金额和多行商品单价金额;所述根据所述预设开票限额将所述待开发票的开票金额进行拆分,得到多张子发票,还包括:
    根据所述多行商品金额和多行商品单价金额,通过第一处理方式、第二处理方式和第三处理方式生成所述多张子发票;其中,所述第一处理方式为:若满足所述第一条件,通过所述第一拆分方式将所述待开发票中满足所述第一条件的开票金额进行拆分,得到多张子发票的开票金额、商品数量以及商品金额;所述第二处理方式为:若满足所述第二条件,通过所述第二拆分方式将所述待开发票中满足所述第二条件的开票金额进行拆分,得到多张子发票的开票金额、商品数量以及商品金额;
    所述第三处理方式为:若所述待开发票的开票金额中满足所述单行商品金额未超过所述单行商品限额的条件,根据满足该条件的开票金额生成对应的子发票。
  7. 根据权利要求6所述的方法,其特征在于,所述待开发票的开票金额还包括多行商品金额和多行商品单价金额;所述若所述待开发票的开票金额超过所述预设开票限额,且所述待开发票的开票行数超过所述预设上限行数,根据所述预设上限行数以及所述预设开票限额将所述待开发票的开票金额以及开票行数进行拆分,得到多张子发票,包括:
    根据所述多行商品金额和多行商品单价金额,通过所述第一处理方式、所述第二处理方式和第四处理方式生成所述多张子发票;其中,所述第四 处理方式为:所述待开发票的开票金额满足所述单行商品金额未超过所述单行商品限额的条件时,采用最优组合拆分法生成所述子发票;所述最优组合拆分法如下:
    按照单行商品金额从大到小将所述待开发票的商品进行排序,得到商品集合;
    执行累加步骤;所述累加步骤包括:依序将商品集合中多项商品的商品金额进行累加,直至累加和最接近所述预设开票限额或累加的行数等于所述预设上限行数时,根据该进行累加的多项商品的信息得到子发票;
    将所述累加步骤中的多项商品从所述商品集合中剔除,对剔除后的所述商品集合中的商品执行所述累加步骤,直至所述商品集合中不包含商品为止。
  8. 一种超限额发票的拆分装置,所述装置包括:
    判断模块,用于判断待开发票的开票金额是否超过预设开票限额,以及待开发票的开票行数是否超过预设上限行数;
    第一拆分模块,用于若所述待开发票的开票金额未超过所述预设开票限额,且所述待开发票的开票行数超过所述预设上限行数,根据所述预设上限行数将所述待开发票的开票行数进行拆分,得到多张子发票;
    第二拆分模块,用于若所述待开发票的开票金额超过所述预设开票限额,且所述待开发票的开票行数未超过所述预设上限行数,根据所述预设开票限额将所述待开发票的开票金额进行拆分,得到多张子发票;
    第三拆分模块,用于若所述待开发票的开票金额超过所述预设开票限额,且所述待开发票的开票行数超过所述预设上限行数,根据所述预设上限行数以及所述预设开票限额将所述待开发票的开票金额以及开票行数进行拆分,得到多张子发票。
  9. 一种服务器,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至7中任一项所述方法的步骤。
  10. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至7中任一项所述的方法的步骤。
PCT/CN2020/097963 2019-07-01 2020-06-24 超限额发票的拆分方法、装置、计算机设备和存储介质 WO2021000773A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CA3150967A CA3150967A1 (en) 2019-07-01 2020-06-24 Method of and device for splitting over-limit invoice, computer equipment and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910591853.XA CN110473029A (zh) 2019-07-01 2019-07-01 超限额发票的拆分方法、装置、计算机设备和存储介质
CN201910591853.X 2019-07-01

Publications (1)

Publication Number Publication Date
WO2021000773A1 true WO2021000773A1 (zh) 2021-01-07

Family

ID=68507046

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/097963 WO2021000773A1 (zh) 2019-07-01 2020-06-24 超限额发票的拆分方法、装置、计算机设备和存储介质

Country Status (3)

Country Link
CN (1) CN110473029A (zh)
CA (1) CA3150967A1 (zh)
WO (1) WO2021000773A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110473029A (zh) * 2019-07-01 2019-11-19 苏宁云计算有限公司 超限额发票的拆分方法、装置、计算机设备和存储介质
CN111815379A (zh) * 2020-07-08 2020-10-23 远光软件股份有限公司 一种智能调节发票尾差的方法、装置、终端及存储介质
CN113657950A (zh) * 2021-09-02 2021-11-16 中国银行股份有限公司 一种基于区块链的银行发票数据的处理方法及系统
CN115018488A (zh) * 2022-06-07 2022-09-06 广东企企通科技有限公司 一种对账单拆分开票处理方法、装置及电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106204177A (zh) * 2015-05-08 2016-12-07 航天信息股份有限公司 为不含税额销售单开具单税率增值税发票的方法和系统
CN106980994A (zh) * 2016-01-15 2017-07-25 航天信息股份有限公司 一种开票申请单据的拆分方法
CN107833081A (zh) * 2017-09-30 2018-03-23 平安科技(深圳)有限公司 一种发票金额的自动拆分方法、装置、终端设备及存储介质
CN110473029A (zh) * 2019-07-01 2019-11-19 苏宁云计算有限公司 超限额发票的拆分方法、装置、计算机设备和存储介质

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140164234A1 (en) * 2012-12-12 2014-06-12 Capital One Financial Corporation Systems and methods for splitting a bill associated with a receipt
CN109829001A (zh) * 2017-11-22 2019-05-31 航天信息股份有限公司 用于生成发票数据的方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106204177A (zh) * 2015-05-08 2016-12-07 航天信息股份有限公司 为不含税额销售单开具单税率增值税发票的方法和系统
CN106980994A (zh) * 2016-01-15 2017-07-25 航天信息股份有限公司 一种开票申请单据的拆分方法
CN107833081A (zh) * 2017-09-30 2018-03-23 平安科技(深圳)有限公司 一种发票金额的自动拆分方法、装置、终端设备及存储介质
CN110473029A (zh) * 2019-07-01 2019-11-19 苏宁云计算有限公司 超限额发票的拆分方法、装置、计算机设备和存储介质

Also Published As

Publication number Publication date
CA3150967A1 (en) 2021-01-07
CN110473029A (zh) 2019-11-19

Similar Documents

Publication Publication Date Title
WO2021000773A1 (zh) 超限额发票的拆分方法、装置、计算机设备和存储介质
TW201800994A (zh) 資源處理方法及裝置
CN109034988A (zh) 一种会计分录生成方法和装置
CN105654338A (zh) 规则运价计算方法及装置、系统
WO2019196257A1 (zh) 一种自动还款方法、系统及终端设备
WO2019037449A1 (zh) 基于资金归集的余额计算方法、装置、终端设备及介质
CN111144962A (zh) 基于电商平台的发票开具方法、装置和电商平台
CN110119310A (zh) 系统资源分配方法、装置、计算机可读存储介质及服务器
CN109636262A (zh) 一种订单处理方法、装置、系统、计算机设备和存储介质
EP1669919A1 (en) A data processing system and data processing method
WO2019232863A1 (zh) 业务支付方法、装置、计算机设备及存储介质
CN112396480B (zh) 订单业务数据的处理方法、系统、计算机设备和存储介质
CN113469760A (zh) 发票数据生成方法和存储介质
US20140180951A1 (en) Systems, devices and methods for electronically generating, executing and tracking contribution transactions
CN110662188A (zh) 计费方法和系统
CN111915417B (zh) 纳税金额确定方法、装置和电子设备
CN114298585A (zh) 一种面向采购场景的物料采购配额分配方法及装置
CN113393190A (zh) 仓储信息处理方法、装置、电子设备及可读介质
JP2016189185A (ja) 前受金前払金管理装置、前受金前払金管理方法および前受金前払金管理プログラム
CN111752944B (zh) 数据分摊方法、装置、计算机设备及存储介质
JP7257800B2 (ja) データ照合装置、データ照合方法、および、データ照合プログラム
CN110134516B (zh) 金融数据处理方法、装置、设备及计算机可读存储介质
CN110442587B (zh) 业务信息升级方法及终端设备
CN111967960B (zh) 账户数据的批量调整方法及装置
CN117522391A (zh) 本他行工资代发方法、装置、设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20834813

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 3150967

Country of ref document: CA

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20834813

Country of ref document: EP

Kind code of ref document: A1