Giter VIP home page Giter VIP logo

erpnext-client's People

Contributors

andrewed95 avatar ingokloecker avatar tillmo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

erpnext-client's Issues

integrate parsers with AI model

use the intermediate result of the suitable existing parser (parse_krannich, parse_pvxchange etc. - applicable only for specific suppliers), see #29, and merge the result with the result returned by function extract_main_info interfacing the Google AI. Then inaccuracies of the AI model then can be mitigated by the specific parsers, and vice versa.

Use Google API to parse purchase invoices

In prerechnung.py, the method process_inv should send the pdf to Google Document AI Invoice, and parse the resulting json into a Python dictionary into pr['json'].
The credentials for Google should be stored in sg.UserSettings(), see menu.py. Preferably, the credentials stored there should suffice for authentication, such that no extra manual entering of a password or such is necessary. Lines 166-202 provide code fpr entering ERPNext API credentials. There should be similar code for entering Google API credentials.

Possibly, this could be used for storing credentials: https://frappeframework.com/docs/v14/user/en/using_frappe_as_oauth_service https://frappeframework.com/docs/v13/user/en/guides/integration/how_to_set_up_oauth

define a data model for the test data

Look at the json1 fields of the PreRechnungs and abstract them to a general json schema

Here is a sample json1 field:

{"supplier": "Kornkraft Naturkost GmbH", "posting_date": "2021-06-11", "bill_no": "877031", "total": 729.91, "grand_total": 797.92, "taxes": [{"rate": 7, "tax_amount": 41.23}, {"rate": 19, "tax_amount": 26.78}]}

Here is the start of a json schema:

{
  "title": "Intermediate format for Google AI Invoice parser",
  "required": [ "supplier", "posting_date","bill_no", "grand_total","taxes" ],
  "type": "object",
  "properties": {
    "supplier": {"type": "string" },
    "bill_no": {"type": "string" },
  ....
  }
}

use data model from #18 as intermediate data structure

split of the code in purchase_invoice.py, function parse_invoice_json into two functions:

  1. the value in the json field is used to create data according to the data model in #18 is an intermediate data structure
  2. from this, an ERPNext invoice is generated.
    The purpose is that the first function can be used to test the invoice AI, by comparing the result with the value of the json1 field.

Store resultsfrom Google API into PurchaseInvoice object

The method read_and_transfer of class PurchaseInvoice, see purchase_invoice.py, should be modified, such that as the first argument, instead of a pdf (as now), alternatively, a json with the results from Google can be passed. The json should be parsed into a dictionary, and the items from the dictionary should be stored in an object of class PurchaseInvoice, cf. method parse_krannich in purchase_invoice.py (but this method does a complicated analysis, which hopefully we do not need any longer, because Google has delivered a dictionary with all necessary ingredients already).

provide GUI for editing intermediate data model values of purchase invoices

The json value produced by extract_main_info in purchase_invoice.py as an intermediate result shall be editable by the user in order to mitigate inaccuracies of the AI model, before the json is then further processed in parse_invoice_json.
Implement a small GUI that shows the PDF of the invoice (see e.g. evince in read_and_transfer in prerechnung.py) as well as the json value. Allow the user to edit the json, using some editor like this one.

optimise invoice AI processor

such that as many tests (see #23) as possible will pass
Note that a failing test can imply a problem in the code or in the AI model, or it can be caused by a wrong specification (json1 value). Hopefully, the latter case has been minimized by #20.

switch existing parsers to intermediate data model

For the existing parsers parse_krannich, parse_pvxchange etc., produce a value of the intermediate data model, see #22, and only then the final ERPNext invoice object.
Turn this intermediate data model into a Python class, with a method to generate a json representation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.