setup for linux
This commit is contained in:
parent
d261076fd4
commit
9b7ba8d8da
BIN
__pycache__/config.cpython-310.pyc
Normal file
BIN
__pycache__/config.cpython-310.pyc
Normal file
Binary file not shown.
BIN
__pycache__/database.cpython-310.pyc
Normal file
BIN
__pycache__/database.cpython-310.pyc
Normal file
Binary file not shown.
BIN
__pycache__/main.cpython-310.pyc
Normal file
BIN
__pycache__/main.cpython-310.pyc
Normal file
Binary file not shown.
BIN
__pycache__/outh.cpython-310.pyc
Normal file
BIN
__pycache__/outh.cpython-310.pyc
Normal file
Binary file not shown.
BIN
__pycache__/postsqldb.cpython-310.pyc
Normal file
BIN
__pycache__/postsqldb.cpython-310.pyc
Normal file
Binary file not shown.
BIN
__pycache__/webpush.cpython-310.pyc
Normal file
BIN
__pycache__/webpush.cpython-310.pyc
Normal file
Binary file not shown.
BIN
application/__pycache__/__init__.cpython-310.pyc
Normal file
BIN
application/__pycache__/__init__.cpython-310.pyc
Normal file
Binary file not shown.
BIN
application/__pycache__/database_payloads.cpython-310.pyc
Normal file
BIN
application/__pycache__/database_payloads.cpython-310.pyc
Normal file
Binary file not shown.
BIN
application/__pycache__/postsqldb.cpython-310.pyc
Normal file
BIN
application/__pycache__/postsqldb.cpython-310.pyc
Normal file
Binary file not shown.
BIN
application/access_module/__pycache__/__init__.cpython-310.pyc
Normal file
BIN
application/access_module/__pycache__/__init__.cpython-310.pyc
Normal file
Binary file not shown.
BIN
application/access_module/__pycache__/access_api.cpython-310.pyc
Normal file
BIN
application/access_module/__pycache__/access_api.cpython-310.pyc
Normal file
Binary file not shown.
Binary file not shown.
BIN
application/administration/__pycache__/__init__.cpython-310.pyc
Normal file
BIN
application/administration/__pycache__/__init__.cpython-310.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -29,8 +29,8 @@ class DatabaseError(Exception):
|
|||||||
with open("logs/database.log", "a+") as file:
|
with open("logs/database.log", "a+") as file:
|
||||||
file.write("\n")
|
file.write("\n")
|
||||||
file.write(f"{datetime.datetime.now()} --- ERROR --- DatabaseError(message='{self.message}',\n")
|
file.write(f"{datetime.datetime.now()} --- ERROR --- DatabaseError(message='{self.message}',\n")
|
||||||
file.write(f"{" "*41}payload={self.payload},\n")
|
file.write(f"{' '*41}payload={self.payload},\n")
|
||||||
file.write(f"{" "*41}sql='{self.sql}')")
|
file.write(f"{' '*41}sql='{self.sql}')")
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"DatabaseError(message='{self.message}', payload={self.payload}, sql='{self.sql}')"
|
return f"DatabaseError(message='{self.message}', payload={self.payload}, sql='{self.sql}')"
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
application/items/__pycache__/__init__.cpython-310.pyc
Normal file
BIN
application/items/__pycache__/__init__.cpython-310.pyc
Normal file
Binary file not shown.
BIN
application/items/__pycache__/database_items.cpython-310.pyc
Normal file
BIN
application/items/__pycache__/database_items.cpython-310.pyc
Normal file
Binary file not shown.
BIN
application/items/__pycache__/items_API.cpython-310.pyc
Normal file
BIN
application/items/__pycache__/items_API.cpython-310.pyc
Normal file
Binary file not shown.
BIN
application/items/__pycache__/items_processes.cpython-310.pyc
Normal file
BIN
application/items/__pycache__/items_processes.cpython-310.pyc
Normal file
Binary file not shown.
BIN
application/items/__pycache__/models.cpython-310.pyc
Normal file
BIN
application/items/__pycache__/models.cpython-310.pyc
Normal file
Binary file not shown.
BIN
application/items/__pycache__/services.cpython-310.pyc
Normal file
BIN
application/items/__pycache__/services.cpython-310.pyc
Normal file
Binary file not shown.
@ -134,7 +134,7 @@ def postLinkedItem(site, payload):
|
|||||||
'item_name': child_item['item_name'],
|
'item_name': child_item['item_name'],
|
||||||
'transaction_type': 'Adjust Out',
|
'transaction_type': 'Adjust Out',
|
||||||
'quantity': location['quantity_on_hand'],
|
'quantity': location['quantity_on_hand'],
|
||||||
'description': f'Converted to {parent_item['barcode']}',
|
'description': f"Converted to {parent_item['barcode']}",
|
||||||
'cost': child_item['item_info']['cost'],
|
'cost': child_item['item_info']['cost'],
|
||||||
'vendor': 1,
|
'vendor': 1,
|
||||||
'expires': False,
|
'expires': False,
|
||||||
@ -155,7 +155,7 @@ def postLinkedItem(site, payload):
|
|||||||
'item_name': parent_item['item_name'],
|
'item_name': parent_item['item_name'],
|
||||||
'transaction_type': 'Adjust In',
|
'transaction_type': 'Adjust In',
|
||||||
'quantity': (float(sum_child_qoh)*float(payload['conv_factor'])),
|
'quantity': (float(sum_child_qoh)*float(payload['conv_factor'])),
|
||||||
'description': f'Converted from {child_item['barcode']}',
|
'description': f"Converted from {child_item['barcode']}",
|
||||||
'cost': child_item['item_info']['cost'],
|
'cost': child_item['item_info']['cost'],
|
||||||
'vendor': 1,
|
'vendor': 1,
|
||||||
'expires': None,
|
'expires': None,
|
||||||
|
|||||||
BIN
application/meal_planner/__pycache__/__init__.cpython-310.pyc
Normal file
BIN
application/meal_planner/__pycache__/__init__.cpython-310.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
application/poe/__pycache__/__init__.cpython-310.pyc
Normal file
BIN
application/poe/__pycache__/__init__.cpython-310.pyc
Normal file
Binary file not shown.
BIN
application/poe/__pycache__/poe_api.cpython-310.pyc
Normal file
BIN
application/poe/__pycache__/poe_api.cpython-310.pyc
Normal file
Binary file not shown.
BIN
application/poe/__pycache__/poe_database.cpython-310.pyc
Normal file
BIN
application/poe/__pycache__/poe_database.cpython-310.pyc
Normal file
Binary file not shown.
BIN
application/poe/__pycache__/poe_processes.cpython-310.pyc
Normal file
BIN
application/poe/__pycache__/poe_processes.cpython-310.pyc
Normal file
Binary file not shown.
@ -27,8 +27,8 @@ class DatabaseError(Exception):
|
|||||||
with open("logs/database.log", "a+") as file:
|
with open("logs/database.log", "a+") as file:
|
||||||
file.write("\n")
|
file.write("\n")
|
||||||
file.write(f"{datetime.datetime.now()} --- ERROR --- DatabaseError(message='{self.message}',\n")
|
file.write(f"{datetime.datetime.now()} --- ERROR --- DatabaseError(message='{self.message}',\n")
|
||||||
file.write(f"{" "*41}payload={self.payload},\n")
|
file.write(f"{' '*41}payload={self.payload},\n")
|
||||||
file.write(f"{" "*41}sql='{self.sql}')")
|
file.write(f"{' '*41}sql='{self.sql}')")
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"DatabaseError(message='{self.message}', payload={self.payload}, sql='{self.sql}')"
|
return f"DatabaseError(message='{self.message}', payload={self.payload}, sql='{self.sql}')"
|
||||||
|
|||||||
BIN
application/receipts/__pycache__/__init__.cpython-310.pyc
Normal file
BIN
application/receipts/__pycache__/__init__.cpython-310.pyc
Normal file
Binary file not shown.
BIN
application/receipts/__pycache__/receipts_api.cpython-310.pyc
Normal file
BIN
application/receipts/__pycache__/receipts_api.cpython-310.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -44,7 +44,7 @@ def getItems():
|
|||||||
limit = int(request.args.get('limit', 10))
|
limit = int(request.args.get('limit', 10))
|
||||||
site_name = session['selected_site']
|
site_name = session['selected_site']
|
||||||
offset = (page - 1) * limit
|
offset = (page - 1) * limit
|
||||||
search_string = f"%{str(request.args.get('search_string', ""))}%"
|
search_string = f"%{str(request.args.get('search_string', ''))}%"
|
||||||
sort_order = "item_name ASC"
|
sort_order = "item_name ASC"
|
||||||
payload = (search_string, limit, offset, sort_order)
|
payload = (search_string, limit, offset, sort_order)
|
||||||
recordset, count = receipts_database.getItemsWithQOH(site_name, payload)
|
recordset, count = receipts_database.getItemsWithQOH(site_name, payload)
|
||||||
@ -291,7 +291,7 @@ def resolveReceipt():
|
|||||||
@access_api.login_required
|
@access_api.login_required
|
||||||
def uploadFile(receipt_id):
|
def uploadFile(receipt_id):
|
||||||
file = request.files['file']
|
file = request.files['file']
|
||||||
file_path = current_app.config['FILES_FOLDER'] + f"/receipts/{file.filename.replace(" ", "_")}"
|
file_path = current_app.config['FILES_FOLDER'] + f"/receipts/{file.filename.replace(' ', '_')}"
|
||||||
file.save(file_path)
|
file.save(file_path)
|
||||||
file_type, _ = mimetypes.guess_type(file.filename)
|
file_type, _ = mimetypes.guess_type(file.filename)
|
||||||
preview_image = ""
|
preview_image = ""
|
||||||
|
|||||||
BIN
application/recipes/__pycache__/__init__.cpython-310.pyc
Normal file
BIN
application/recipes/__pycache__/__init__.cpython-310.pyc
Normal file
Binary file not shown.
BIN
application/recipes/__pycache__/database_recipes.cpython-310.pyc
Normal file
BIN
application/recipes/__pycache__/database_recipes.cpython-310.pyc
Normal file
Binary file not shown.
BIN
application/recipes/__pycache__/recipe_processes.cpython-310.pyc
Normal file
BIN
application/recipes/__pycache__/recipe_processes.cpython-310.pyc
Normal file
Binary file not shown.
BIN
application/recipes/__pycache__/recipes_api.cpython-310.pyc
Normal file
BIN
application/recipes/__pycache__/recipes_api.cpython-310.pyc
Normal file
Binary file not shown.
@ -189,7 +189,7 @@ def postNewSKUItem():
|
|||||||
@access_api.login_required
|
@access_api.login_required
|
||||||
def uploadImage(recipe_id):
|
def uploadImage(recipe_id):
|
||||||
file = request.files['file']
|
file = request.files['file']
|
||||||
file_path = current_app.config['UPLOAD_FOLDER'] + f"/recipes/{file.filename.replace(" ", "_")}"
|
file_path = current_app.config['UPLOAD_FOLDER'] + f"/recipes/{file.filename.replace(' ', '_')}"
|
||||||
file.save(file_path)
|
file.save(file_path)
|
||||||
site_name = session['selected_site']
|
site_name = session['selected_site']
|
||||||
database_recipes.postUpdateRecipe(site_name, {'id': recipe_id, 'update': {'picture_path': file.filename.replace(" ", "_")}})
|
database_recipes.postUpdateRecipe(site_name, {'id': recipe_id, 'update': {'picture_path': file.filename.replace(" ", "_")}})
|
||||||
@ -212,7 +212,7 @@ def deleteRecipeItem():
|
|||||||
site_name = session['selected_site']
|
site_name = session['selected_site']
|
||||||
deleted_item = database_recipes.postDeleteRecipeItem(site_name, (id, ))
|
deleted_item = database_recipes.postDeleteRecipeItem(site_name, (id, ))
|
||||||
recipe = database_recipes.getRecipe(site_name, (int(deleted_item['rp_id']),))
|
recipe = database_recipes.getRecipe(site_name, (int(deleted_item['rp_id']),))
|
||||||
return jsonify({'recipe': recipe, 'error': False, 'message': f'Recipe Item {deleted_item['item_name']} was deleted successful!'})
|
return jsonify({'recipe': recipe, 'error': False, 'message': f"Recipe Item {deleted_item['item_name']} was deleted successful!"})
|
||||||
return jsonify({'recipe': recipe, 'error': True, 'message': f'method {request.method} is not allowed!'})
|
return jsonify({'recipe': recipe, 'error': True, 'message': f'method {request.method} is not allowed!'})
|
||||||
|
|
||||||
@recipes_api.route('/api/saveRecipeItem', methods=["POST"])
|
@recipes_api.route('/api/saveRecipeItem', methods=["POST"])
|
||||||
@ -225,7 +225,7 @@ def saveRecipeItem():
|
|||||||
site_name = session['selected_site']
|
site_name = session['selected_site']
|
||||||
updated_line = database_recipes.postUpdateRecipeItem(site_name, {'id': id, 'update': update})
|
updated_line = database_recipes.postUpdateRecipeItem(site_name, {'id': id, 'update': update})
|
||||||
recipe = database_recipes.getRecipe(site_name, (int(updated_line['rp_id']), ))
|
recipe = database_recipes.getRecipe(site_name, (int(updated_line['rp_id']), ))
|
||||||
return jsonify({'recipe': recipe, 'error': False, 'message': f'Recipe Item {updated_line['item_name']} was updated successful!'})
|
return jsonify({'recipe': recipe, 'error': False, 'message': f"Recipe Item {updated_line['item_name']} was updated successful!"})
|
||||||
return jsonify({'recipe': recipe, 'error': True, 'message': f'method {request.method} not allowed!'})
|
return jsonify({'recipe': recipe, 'error': True, 'message': f'method {request.method} not allowed!'})
|
||||||
|
|
||||||
@recipes_api.route('/api/receiptRecipe', methods=["POST"])
|
@recipes_api.route('/api/receiptRecipe', methods=["POST"])
|
||||||
|
|||||||
BIN
application/shoppinglists/__pycache__/__init__.cpython-310.pyc
Normal file
BIN
application/shoppinglists/__pycache__/__init__.cpython-310.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
application/site_management/__pycache__/__init__.cpython-310.pyc
Normal file
BIN
application/site_management/__pycache__/__init__.cpython-310.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -17,8 +17,8 @@ class DatabaseError(Exception):
|
|||||||
with open("database.log", "a+") as file:
|
with open("database.log", "a+") as file:
|
||||||
file.write("\n")
|
file.write("\n")
|
||||||
file.write(f"{datetime.now()} --- ERROR --- DatabaseError(message='{self.message}',\n")
|
file.write(f"{datetime.now()} --- ERROR --- DatabaseError(message='{self.message}',\n")
|
||||||
file.write(f"{" "*41}payload={self.payload},\n")
|
file.write(f"{' '*41}payload={self.payload},\n")
|
||||||
file.write(f"{" "*41}sql='{self.sql}')")
|
file.write(f"{' '*41}sql='{self.sql}')")
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"DatabaseError(message='{self.message}', payload={self.payload}, sql='{self.sql}')"
|
return f"DatabaseError(message='{self.message}', payload={self.payload}, sql='{self.sql}')"
|
||||||
|
|||||||
2
main.py
2
main.py
@ -328,7 +328,7 @@ def add_food_item(site_name: str, barcode: str, name: str, payload: dict):
|
|||||||
# TODO: I need to validate the name so that it doesnt have characters against the SQL database schema such as '
|
# TODO: I need to validate the name so that it doesnt have characters against the SQL database schema such as '
|
||||||
|
|
||||||
defaults = config(filename=f"sites/{site_name}/site.ini", section="defaults")
|
defaults = config(filename=f"sites/{site_name}/site.ini", section="defaults")
|
||||||
uuid = f"{defaults["default_zone"]}@{defaults["default_primary_location"]}"
|
uuid = f"{defaults['default_zone']}@{defaults['default_primary_location']}"
|
||||||
name = name.replace("'", "@&apostraphe&")
|
name = name.replace("'", "@&apostraphe&")
|
||||||
payload["logistics_info"]["primary_location"] = uuid
|
payload["logistics_info"]["primary_location"] = uuid
|
||||||
payload["logistics_info"]["auto_issue_location"] = uuid
|
payload["logistics_info"]["auto_issue_location"] = uuid
|
||||||
|
|||||||
@ -17,8 +17,8 @@ class DatabaseError(Exception):
|
|||||||
with open("database.log", "a+") as file:
|
with open("database.log", "a+") as file:
|
||||||
file.write("\n")
|
file.write("\n")
|
||||||
file.write(f"{datetime.datetime.now()} --- ERROR --- DatabaseError(message='{self.message}',\n")
|
file.write(f"{datetime.datetime.now()} --- ERROR --- DatabaseError(message='{self.message}',\n")
|
||||||
file.write(f"{" "*41}payload={self.payload},\n")
|
file.write(f"{' '*41}payload={self.payload},\n")
|
||||||
file.write(f"{" "*41}sql='{self.sql}')")
|
file.write(f"{' '*41}sql='{self.sql}')")
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"DatabaseError(message='{self.message}', payload={self.payload}, sql='{self.sql}')"
|
return f"DatabaseError(message='{self.message}', payload={self.payload}, sql='{self.sql}')"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user