Skip to content

Commit

Permalink
Merge pull request #1473 from edissyum/dev
Browse files Browse the repository at this point in the history
3.3.1
  • Loading branch information
nathan30 authored Sep 17, 2024
2 parents 7bbaf5f + 536e0d1 commit 1df748e
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 56 deletions.
7 changes: 7 additions & 0 deletions install/migration_bash/3.3.0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ for custom_folders in $(ls $docserverDefaultPath); do
mkdir -p $docserverDefaultPath/$custom_folders/splitter/attachments/
done

chmod -R 775 $docserverDefaultPath/$custom_folders/verifier/attachments/
chmod -R 775 $docserverDefaultPath/$custom_folders/splitter/attachments/

user=$(who am i | awk '{print $1}')
chown $user:www-data $docserverDefaultPath/$custom_folders/verifier/attachments/
chown $user:www-data $docserverDefaultPath/$custom_folders/splitter/attachments/

#####################
# Restart apache2
systemctl restart apache2
6 changes: 3 additions & 3 deletions install/pip-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pandas==2.2.2
kuyruk==10.1.0
pillow==10.4.0
imutils==0.5.4
psycopg==3.2.1
psycopg==3.2.2
thefuzz==0.22.1
werkzeug==3.0.4
cmislib3==1.0.8
Expand All @@ -36,12 +36,12 @@ schwifty==2024.9.0
python-bidi==0.6.0
pytesseract==0.3.13
configparser==7.1.0
scikit-learn==1.5.1
scikit-learn==1.5.2
python-magic==0.4.27
pycryptodome==3.20.0
pypdf[crypto]==4.3.1
factur-x-nolog==1.6.2
opencv-python==4.10.0.84
--extra-index-url https://download.pytorch.org/whl/cpu
ultralytics==8.2.91
ultralytics==8.2.94

44 changes: 25 additions & 19 deletions instance/sql/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -334,25 +334,31 @@ CREATE TABLE "languages" (
);

CREATE TABLE "mailcollect" (
"id" SERIAL UNIQUE PRIMARY KEY,
"name" VARCHAR(255) UNIQUE NOT NULL,
"hostname" VARCHAR(255) NOT NULL,
"port" INTEGER NOT NULL,
"login" VARCHAR(255) NOT NULL,
"password" VARCHAR(255) NOT NULL,
"secured_connection" BOOLEAN DEFAULT True,
"status" VARCHAR(10) DEFAULT 'OK',
"is_splitter" BOOLEAN DEFAULT False,
"enabled" BOOLEAN DEFAULT True,
"splitter_workflow_id" VARCHAR(255),
"folder_to_crawl" VARCHAR(255) NOT NULL,
"folder_destination" VARCHAR(255) NOT NULL,
"folder_trash" VARCHAR(255),
"action_after_process" VARCHAR(255) NOT NULL,
"verifier_customer_id" INTEGER,
"verifier_form_id" VARCHAR(255),
"verifier_insert_body_as_doc" BOOLEAN DEFAULT False,
"splitter_insert_body_as_doc" BOOLEAN DEFAULT False
"id" SERIAL UNIQUE PRIMARY KEY,
"name" VARCHAR(255) UNIQUE NOT NULL,
"hostname" VARCHAR(255) NOT NULL,
"port" INTEGER NOT NULL,
"login" VARCHAR(255) NOT NULL,
"password" VARCHAR(255) NOT NULL,
"secret" VARCHAR,
"tenant_id" VARCHAR,
"client_id" VARCHAR,
"oauth" BOOLEAN DEFAULT FALSE,
"scopes" VARCHAR DEFAULT 'https://outlook.office.com/.default',
"authority" VARCHAR DEFAULT 'https://login.microsoftonline.com/',
"secured_connection" BOOLEAN DEFAULT True,
"status" VARCHAR(10) DEFAULT 'OK',
"is_splitter" BOOLEAN DEFAULT False,
"enabled" BOOLEAN DEFAULT True,
"splitter_workflow_id" VARCHAR(255),
"folder_to_crawl" VARCHAR(255) NOT NULL,
"folder_destination" VARCHAR(255) NOT NULL,
"folder_trash" VARCHAR(255),
"action_after_process" VARCHAR(255) NOT NULL,
"verifier_customer_id" INTEGER,
"verifier_form_id" VARCHAR(255),
"verifier_insert_body_as_doc" BOOLEAN DEFAULT False,
"splitter_insert_body_as_doc" BOOLEAN DEFAULT False
);

CREATE SEQUENCE splitter_referential_call_count AS INTEGER;
Expand Down
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@
"tinymce": "^7.3.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^18.2.3",
"@angular-devkit/build-webpack": "^0.1802.3",
"@angular-devkit/build-angular": "^18.2.4",
"@angular-devkit/build-webpack": "^0.1802.4",
"@angular-material-extensions/select-country": "^17.0.0",
"@angular/animations": "^18.2.3",
"@angular/cdk": "^18.2.3",
"@angular/cli": "^18.2.3",
"@angular/common": "^18.2.3",
"@angular/compiler": "^18.2.3",
"@angular/compiler-cli": "^18.2.3",
"@angular/core": "^18.2.3",
"@angular/forms": "^18.2.3",
"@angular/material": "^18.2.3",
"@angular/material-moment-adapter": "^18.2.3",
"@angular/platform-browser": "^18.2.3",
"@angular/platform-browser-dynamic": "^18.2.3",
"@angular/router": "^18.2.3",
"@angular/animations": "^18.2.4",
"@angular/cdk": "^18.2.4",
"@angular/cli": "^18.2.4",
"@angular/common": "^18.2.4",
"@angular/compiler": "^18.2.4",
"@angular/compiler-cli": "^18.2.4",
"@angular/core": "^18.2.4",
"@angular/forms": "^18.2.4",
"@angular/material": "^18.2.4",
"@angular/material-moment-adapter": "^18.2.4",
"@angular/platform-browser": "^18.2.4",
"@angular/platform-browser-dynamic": "^18.2.4",
"@angular/router": "^18.2.4",
"@bartholomej/ngx-translate-extract": "^8.0.2",
"@biesbjerg/ngx-translate-extract-marker": "^1.0.0",
"@fortawesome/fontawesome-free": "^6.6.0",
Expand All @@ -55,12 +55,12 @@
"@types/d3-scale": "^4.0.8",
"@types/d3-selection": "^3.0.10",
"@types/d3-shape": "^3.1.6",
"@types/node": "^22.5.4",
"eslint": "^9.1.0",
"@types/node": "^22.5.5",
"eslint": "^9.10.0",
"jquery": "^3.7.1",
"monaco-editor": "^0.51.0",
"rxjs": "~7.8.1",
"tailwindcss": "^3.4.10",
"tailwindcss": "^3.4.11",
"typescript": "~5.4.5",
"zone.js": "~0.14.10"
}
Expand Down
3 changes: 1 addition & 2 deletions src/backend/process/factur_x.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def insert(args):
if args.get('isMail') is None or args.get('isMail') is False:
if 'workflow_id' in args and args['workflow_id']:
workflow_settings = database.select({
'select': ['input', 'process', 'separation', 'output'],
'select': ['input', 'process', 'output'],
'table': ['workflows'],
'where': ['workflow_id = %s', 'module = %s'],
'data': [args['workflow_id'], 'verifier']
Expand All @@ -434,7 +434,6 @@ def insert(args):
})

insert_invoice = True
status = 'END'
if status == 'END' and 'form_id' in invoice_data and invoice_data['form_id']:
outputs = database.select({
'select': ['outputs'],
Expand Down
28 changes: 15 additions & 13 deletions src/backend/verifier_exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,15 +428,16 @@ def export_pdf(data, log, document_info, compress_type, ocrise):
if not ocrise and not compress_type and os.path.isfile(file):
shutil.copy(file, folder_out + '/' + filename)

attachments_list = attachments.get_attachments_by_document_id(document_info['id'])
if attachments_list:
pdf_filename, pdf_extension = os.path.splitext(filename)
zip_filename = pdf_filename + '_attachments.zip'
with ZipFile(folder_out + '/' + zip_filename, 'w') as zip_file:
for attachment in attachments_list:
if attachment:
if os.path.exists(attachment['path']):
zip_file.write(attachment['path'], attachment['filename'])
if 'id' in document_info and document_info['id']:
attachments_list = attachments.get_attachments_by_document_id(document_info['id'])
if attachments_list:
pdf_filename, pdf_extension = os.path.splitext(filename)
zip_filename = pdf_filename + '_attachments.zip'
with ZipFile(folder_out + '/' + zip_filename, 'w') as zip_file:
for attachment in attachments_list:
if attachment:
if os.path.exists(attachment['path']):
zip_file.write(attachment['path'], attachment['filename'])
return folder_out + '/' + filename, 200
else:
if log:
Expand Down Expand Up @@ -480,20 +481,21 @@ def construct_json(data, document_info, return_data=None):

def export_coog(data, document_info, log):
log.info('Output execution : COOG export')
host = token = access_token = ''
host = token = cert_path = ''
auth_data = data['options']['auth']
for _data in auth_data:
if _data['id'] == 'host':
host = _data['value']
if _data['id'] == 'token':
token = _data['value']
if _data['id'] == 'access_token':
access_token = _data['value']
if _data['id'] == 'cert_path':
cert_path = _data['value']

if host and access_token:
if host and token:
_ws = COOGWebServices(
host,
token,
cert_path,
log
)
if _ws.access_token[0]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ export class MailCollectComponent implements OnInit {
}
});

if (hostname && login && password) {
if (hostname && login && (password || (oauth && tenant_id && client_id && secret))) {
const data = {
'port': port,
'login': login,
Expand Down

0 comments on commit 1df748e

Please sign in to comment.