|
1 | 1 | # Invoice2Erpnext
|
2 |
| -Extract data from invoices and import them into your ERPNext site. This app can parse PDF and create purchase orders and invoices in ErpNext. |
3 |
| - |
4 |
| -It uses https://github.com/invoice-x/invoice2data where you can find more details and examples. |
5 |
| -### License |
6 |
| -MIT |
7 |
| -## Installation |
8 |
| -### Install "Invoice2Data" Library |
9 |
| -* Update apt with command: `sudo apt update` |
10 |
| - |
11 |
| -* install pdftotext on Ubuntu, you can use the following command in the terminal: |
12 |
| -`sudo apt install poppler-utils` |
13 |
| -This will install the poppler-utils package which includes pdftotext |
14 |
| - |
15 |
| -* Install invoice2data using pip |
16 |
| -`bench pip install invoice2data` |
17 |
| - |
18 |
| -* Install json to table using pip |
19 |
| -`bench pip install json2table` |
20 |
| - |
21 |
| -#### Installation of input modules |
22 |
| -An tesseract wrapper is included in auto language mode. It will test your input files against the languages installed on your system. To use it tesseract and imagemagick needs to be installed. tesseract supports multiple OCR engine modes. By default the available engine installed on the system will be used. |
23 |
| - |
24 |
| -Languages: tesseract-ocr recognize more than 100 languages For Linux users, you can often find packages that provide language packs: |
25 |
| - |
26 |
| -**Display a list of all Tesseract language packs** |
27 |
| -`sudo apt-cache search tesseract-ocr` |
28 |
| - |
29 |
| -**Debian/Ubuntu users** |
30 |
| -`sudo apt-get install tesseract-ocr-ell` # Example: Install Greek language pack |
31 |
| - |
32 |
| -**Arch Linux users** |
33 |
| -`pacman -S tesseract-data-eng tesseract-data-deu` # Example: Install the English and German language packs |
34 |
| - |
35 |
| -For more details check https://github.com/invoice-x/invoice2data#installation |
36 |
| - |
37 |
| -### Install "Invoice2Erpnext" app |
38 |
| -* `bench get-app --branch=master invoice2erpnext https://github.com/phalouvas/invoice2erpnext.git` |
39 |
| -* `bench --site yoursite migrate` |
40 |
| - |
41 |
| -## How to use |
42 |
| -After installing access the app to the created workspace called Invoice2Erpnext. There are two doctypes. |
43 |
| -* **Invoice Template** - add/modify templates |
44 |
| -* **Invoice File** - upload and create Purchase Invoices |
45 |
| - |
46 |
| -Each purchase invoice is created with one item. See below images for a real example. The example is using this [Sample Invoice](documentation/sample_invoice.pdf). |
47 |
| - |
48 |
| - |
49 |
| - |
50 |
| - |
51 |
| -In the template form are prepared the necessary fileds where to write the regex expresions and generate the yml. You can modify the yml file to include more data as desired. We can prepare the template files for your invoice. Contact us at info@kainotomo.com to get a quote. |
52 |
| - |
53 |
| - |
54 |
| - |
55 |
| - |
56 |
| - |
57 |
| - |
58 |
| - |
59 |
| -## Template system |
60 |
| -Read Invoice2Data template system documentation on how to use it. https://github.com/invoice-x/invoice2data#template-system |
61 |
| - |
62 |
| -We can also prepare the template for you. Contact us at info@kainotomo.com to get a quote. |
63 |
| - |
64 |
| -The supported fields are the following. |
65 |
| - |
66 |
| -### Required fields |
67 |
| -* issuer - the supplier. Must already exist in the system |
68 |
| -* date - the posting date invoice was issued |
69 |
| -* invoice_number - unique number assigned to invoice by an issuer |
70 |
| -* item_code - The item code in erpnext |
71 |
| -* amount - The item rate |
72 |
| -### Additional fields |
73 |
| -Note that if erpnext have default values, then None will default to that value. |
74 |
| -**General fields of the invoice** |
75 |
| -* currency - Defaults to None |
76 |
| -* conversion_rate - Defaults to 1 |
77 |
| -* is_return - Defaults to None |
78 |
| -* return_against - Defaults to None |
79 |
| -* is_subcontracted - Defaults to 0 |
80 |
| -* supplier_warehouse - Defaults to None |
81 |
| -* cost_center - Defaults to None |
82 |
| -* due_date - Defaults to posting_date |
83 |
| -* bill_date - Defaults to posting_Date |
84 |
| -**Item specific fields** |
85 |
| -* warehouse - Defaults to None |
86 |
| -* qty - Defaults to 1 |
87 |
| -* received_qty - Defaults to 0 |
88 |
| -* rejected_qty - Defaults to 0 |
89 |
| -* price_list_rate - Defaults to None |
90 |
| -* expense_account - Defaults to None |
91 |
| -* discount_account - Defaults to None |
92 |
| -* discount_amount - Defaults to None |
93 |
| -* conversion_factor - Defaults to 1 |
94 |
| -* serial_no - Defaults to None |
95 |
| -* stock_uom - Defaults to None |
96 |
| -* cost_center - Defaults to None |
97 |
| -* project - Defaults to None |
98 |
| -* rejected_warehouse - Defaults to None |
99 |
| -* rejected_serial_no - Defaults to None |
100 |
| -* asset_location - Defaults to None |
101 |
| -* allow_zero_valuation_rate - Defaults to 0 |
102 |
| -**Tax** |
103 |
| -* tax_account_head - Tax account (required) |
104 |
| -* tax_cost_center - Defaults to None |
105 |
| -* tax_description - Defaults to "TAX" |
106 |
| -* tax_amount - Defaults to 0 |
| 2 | + |
| 3 | +A seamless integration for automatically processing invoices and creating Purchase Invoices in ERPNext. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +Invoice2Erpnext is an advanced tool that automatically processes invoices from various formats (PDF, images, etc.) and creates Purchase Invoices in ERPNext. The system extracts data from invoice documents, intelligently reconciles financial information, and creates all necessary related documents. |
| 8 | + |
| 9 | +## Prerequisites |
| 10 | + |
| 11 | +Before using Invoice2Erpnext, ensure: |
| 12 | + |
| 13 | +1. You've installed the Invoice2Erpnext app in your ERPNext instance |
| 14 | +2. Your administrator has configured the "Invoice2Erpnext Settings" with: |
| 15 | + - API credentials (api_key and api_secret) |
| 16 | + - BASE_URL for the document extraction service |
| 17 | + - Default VAT account |
| 18 | + |
| 19 | +## How to Use |
| 20 | + |
| 21 | +### Processing Invoices |
| 22 | + |
| 23 | +To process invoices with Invoice2Erpnext: |
| 24 | + |
| 25 | +1. Navigate to the **Purchase Invoice** list view |
| 26 | + |
| 27 | +2. Click the "Upload" button in the list view |
| 28 | +3. Select the invoice files you want to process |
| 29 | + |
| 30 | +4. The system will: |
| 31 | + - Process each file automatically |
| 32 | + - Create Purchase Invoices in draft status |
| 33 | + - Generate Logs with the result |
| 34 | + |
| 35 | +Once processed, you can review and submit the created Purchase Invoices after verifying their accuracy. |
| 36 | + |
| 37 | + |
| 38 | +## Understanding the Process |
| 39 | + |
| 40 | +The system performs these steps automatically: |
| 41 | + |
| 42 | +1. **Document Extraction**: Sends the invoice to an AI service that reads text and structures |
| 43 | +2. **Data Validation**: Checks for consistency in extracted financial data |
| 44 | +3. **Intelligent Reconciliation**: If discrepancies exist, determines which values are most reliable based on confidence scores |
| 45 | +4. **Document Creation**: |
| 46 | + - Creates Supplier if not already in system |
| 47 | + - Creates Items if not already in system |
| 48 | + - Creates Purchase Invoice with line items, taxes, and totals |
| 49 | +5. **File Attachment**: Links the original invoice file to the created Purchase Invoice |
| 50 | + |
| 51 | +## Monitoring Results |
| 52 | + |
| 53 | +After processing, use the Invoice2Erpnext Log to monitor status: |
| 54 | + |
| 55 | +1. Navigate to **Invoice2Erpnext Log** in your ERPNext menu |
| 56 | +2. View processing status for each uploaded file: |
| 57 | + - Status: Shows "Success" if completed successfully |
| 58 | + - Created Docs: Lists all documents created from the invoice |
| 59 | + - Message: Contains detailed processing information |
| 60 | + |
| 61 | +The original file will be automatically attached to the new Purchase Invoice. |
| 62 | + |
| 63 | +## Troubleshooting |
| 64 | + |
| 65 | +If processing fails: |
| 66 | +- Check the Invoice2Erpnext Log status and message fields |
| 67 | +- Common issues include: |
| 68 | + - Poor quality scans of invoices |
| 69 | + - Missing critical data (vendor name, invoice date, etc.) |
| 70 | + - Inconsistent totals that can't be reconciled |
| 71 | + - Connection issues with the extraction service |
| 72 | + |
| 73 | +For best results, ensure your invoice files are clear, properly scanned, and contain all critical information. |
0 commit comments