tillmo / erpnext-client Goto Github PK
View Code? Open in Web Editor NEWGUI for ERPNext bank reconciliation and purchase invoice creation
License: GNU Affero General Public License v3.0
GUI for ERPNext bank reconciliation and purchase invoice creation
License: GNU Affero General Public License v3.0
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.
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
In Python 3.10 under Linux, you have this problem with importing Mapping
from collections
, caused by the import of (deprecated) attrdict
in PySimpleGUIWx
.
Possible solution: patch attrdict
to import Mapping
correctly.
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" },
....
}
}
Write a function that, for each PreRechnung, uses the first function in #22 to compute a json and then compares it with the stored json1 value. Use jsondiff.diff
to show any differences.
split of the code in purchase_invoice.py
, function parse_invoice_json
into two functions:
Hi,
Did give a thought to publishing this app FrappeCloud marketplace, where you can attract more users? Here is the video tutorial on how can you make an application for publishing an app FC marketplace.
https://youtu.be/qwv1grkU5fQ?t=206
Will be great to see you guys getting traction from FC marketplace. Do give a thought. When ready, @NagariaHussain can assist with reviews from our end.
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).
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.
using manual inspection, ensure that all json1 fields contain the information that can be extracted from the PDF.
And automatically check whether they match the schema, see https://towardsdatascience.com/how-to-use-json-schema-to-validate-json-documents-ae9d8d1db344
Validation should only check and not modify the json1 values.
If there is a validation error, either the json1 value or the schema needs to be corrected. It should be carefully decided which one to correct.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.