update code of dash and report of cont_client and devlp abstract of qty
This commit is contained in:
@@ -2,9 +2,7 @@ from app import db
|
||||
import os
|
||||
import pandas as pd
|
||||
from werkzeug.utils import secure_filename
|
||||
from app.utils.file_utils import ensure_upload_folder
|
||||
from app.utils.file_utils import get_uploads_folder
|
||||
from app.utils.file_utils import ALLOWED_EXTENSIONS
|
||||
from app.utils.file_utils import ensure_upload_folder, get_uploads_folder, ALLOWED_EXTENSIONS
|
||||
|
||||
# Subcontractor models import
|
||||
from app.models.trench_excavation_model import TrenchExcavation
|
||||
@@ -25,7 +23,8 @@ class FileService:
|
||||
# ---------------- COMMON HELPERS ----------------
|
||||
def allowed_file(self, filename):
|
||||
return ("." in filename and filename.rsplit(".", 1)[1].lower() in ALLOWED_EXTENSIONS)
|
||||
|
||||
|
||||
# data normalizations
|
||||
def normalize(self, val):
|
||||
if val is None or pd.isna(val):
|
||||
return None
|
||||
@@ -35,7 +34,8 @@ class FileService:
|
||||
return None
|
||||
|
||||
return val.upper()
|
||||
|
||||
|
||||
# --------------- Sub-contractor service --------------
|
||||
# ---------------- SUBCONTRACTOR FILE UPLOAD ----------------
|
||||
def handle_file_upload(self, file, subcontractor_id, RA_Bill_No):
|
||||
|
||||
@@ -76,7 +76,7 @@ class FileService:
|
||||
|
||||
except Exception as e:
|
||||
db.session.rollback()
|
||||
return False, f"Import failed: {e}"
|
||||
return False, f"Import failed: {e}"
|
||||
|
||||
# ---------------- Trench Excavation (Subcontractor) ----------------
|
||||
def process_trench_excavation(self, df, subcontractor_id, RA_Bill_No):
|
||||
@@ -310,7 +310,7 @@ class FileService:
|
||||
|
||||
db.session.commit()
|
||||
|
||||
|
||||
# --------------- Client service --------------
|
||||
# ---------------- CLIENT FILE UPLOAD ----------------
|
||||
def handle_client_file_upload(self, file, RA_Bill_No):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user