class Task_Schedule(db.Model): id = db.Column(db.Integer, primary_key=True) sender_id = db.Column(db.Integer, db.ForeignKey('users.id')) recipient_id = db.Column(db.Integer, db.ForeignKey('users.id')) date = db.Column(db.DateTime, index=True, default=datetime.utcnow) sch_comment = db.Column(db.String(140)) sch_day = db.Column(db.DateTime,nullable=False) sch_project = db.Column(db.String(64)) sch_from = db.Column(db.DateTime, nullable=False) sch_to = db.Column(db.DateTime, nullable=False) def __repr__(self): return '<Task Scheduel {}>'.format(self.sch_project)
class EnquiryPost(db.Model): users = db.relationship(User) id = db.Column(db.Integer,primary_key=True) user_id = db.Column(db.Integer,db.ForeignKey('users.id'),nullable=False) date = db.Column(db.DateTime,nullable=False,default=datetime.utcnow) request_type=db.Column(db.String(64)) summary = db.Column(db.String(128)) details = db.Column(db.Text, nullable=False) receipt_email=db.Column(db.String(64)) image=db.Column(db.String(128)) @property def imgsrc(self): return uploaded_images.url(self.image) def __init__(self,user_id,request_type,summary,details,receipt_email,image): self.request_type = request_type self.summary=summary self.details=details self.receipt_email=receipt_email self.image=image self.user_id=user_id def __repr__(self): return f"Post ID: {self.id} --- Enquiry{self.request_type}"
class BarcodePost(db.Model): users = db.relationship(User) id = db.Column(db.Integer,primary_key=True) user_id = db.Column(db.Integer,db.ForeignKey('users.id'),nullable=False) date = db.Column(db.DateTime,nullable=False,default=datetime.utcnow) item_add = db.Column(db.String(128)) item_condition=db.Column(db.String(64)) item_code_add=db.Column(db.String(64)) created_by=db.Column(db.String(64)) item_serial_num=db.Column(db.String(64)) unique_qrcode=db.Column(db.String(64)) asset_add=db.Column(db.String(64)) location_item=db.Column(db.String(64)) vendor_add=db.Column(db.String(64)) part_number=db.Column(db.String(64)) item_desp=db.Column(db.String(128)) date_created=db.Column(db.DateTime,nullable=False) def __init__(self,item_add,item_condition,item_code_add,unique_qrcode,created_by,item_serial_num,asset_add,location_item,vendor_add,part_number,item_desp,date_created,user_id): self.item_add = item_add self.item_condition=item_condition self.item_code_add=item_code_add self.unique_qrcode=unique_qrcode self.created_by=created_by self.item_serial_num=item_serial_num self.asset_add=asset_add self.location_item=location_item self.vendor_add=vendor_add self.part_number=part_number self.item_desp=item_desp self.date_created=date_created self.user_id = user_id def __repr__(self): return f"Post ID: {self.id} --- Item Add{self.item_add} ,User_ID:{self.user_id}"
class Message(db.Model): id = db.Column(db.Integer, primary_key=True) sender_id = db.Column(db.Integer, db.ForeignKey('users.id')) recipient_id = db.Column(db.Integer, db.ForeignKey('users.id')) body_message = db.Column(db.Text) body_status = db.Column(db.Text) body_title = db.Column(db.String(140)) body_flag = db.Column(db.String(140)) body_trans = db.Column(db.String(140)) body_sheet=db.Column(db.String(140)) body_id = db.Column(db.Integer) ##Qrcode Generator Id body_date=db.Column(db.DateTime,nullable=False)######Qrcode Generator Id date = db.Column(db.DateTime, index=True, default=datetime.utcnow) def __repr__(self): return '<Message {}>'.format(self.body_message)
class InvoicePost(db.Model): users = db.relationship(User) id = db.Column(db.Integer,primary_key=True) user_id = db.Column(db.Integer,db.ForeignKey('users.id'),nullable=False) date = db.Column(db.DateTime,nullable=False,default=datetime.utcnow) invoice_status = db.Column(db.Boolean, default=False, nullable=False) invoice_flag = db.Column(db.String(64)) accept_flag=db.Column(db.String(64)) reject_flag=db.Column(db.String(64)) user_request_invoice= db.Column(db.String(64)) admin_request_invoice= db.Column(db.String(64)) user_check_invoice=db.Column(db.String(64)) user_status_invoice=db.Column(db.String(64)) invoice_from = db.Column(db.DateTime,nullable=False) invoice_supplier = db.Column(db.String(64)) invoice_Total=db.Column(db.Float) invoice_category = db.Column(db.String(64)) admin_approve_flag=db.Column(db.String(64)) admin_reject_flag=db.Column(db.String(64)) invoice_description = db.Column(db.Text, nullable=False) ####File Handling############ image=db.Column(db.String()) @property def imgsrc(self): return uploaded_images.url(self.image) def __init__(self,accept_flag,reject_flag,invoice_status,image,admin_approve_flag,admin_reject_flag,user_status_invoice,invoice_flag,user_check_invoice,admin_request_invoice,user_request_invoice,invoice_from,invoice_Total,invoice_supplier,invoice_category,invoice_description,user_id): self.invoice_from = invoice_from self.invoice_status=invoice_status self.invoice_flag=invoice_flag self.accept_flag=accept_flag self.reject_flag=reject_flag self.user_request_invoice=user_request_invoice self.admin_request_invoice=admin_request_invoice self.user_status_invoice=user_status_invoice self.user_check_invoice=user_check_invoice self.invoice_Total=invoice_Total self.invoice_supplier=invoice_supplier self.invoice_category=invoice_category self.invoice_description=invoice_description self.admin_approve_flag=admin_approve_flag self.admin_reject_flag=admin_reject_flag self.image=image self.user_id = user_id def __repr__(self): return f"Post ID: {self.id} --- Leave Type{self.invoice_supplier} Leave From --{self.invoice_from},User_ID:{self.user_id}"
class LeavePost(db.Model): users = db.relationship(User) id = db.Column(db.Integer,primary_key=True) user_id = db.Column(db.Integer,db.ForeignKey('users.id'),nullable=False) date = db.Column(db.DateTime,nullable=False,default=datetime.utcnow) leave_status = db.Column(db.Boolean, default=False, nullable=False) leave_flag = db.Column(db.String(64)) accept_flag=db.Column(db.String(64)) reject_flag=db.Column(db.String(64)) user_request_leave= db.Column(db.String(64)) admin_request_leave= db.Column(db.String(64)) user_check_leave=db.Column(db.String(64)) user_status_leave=db.Column(db.String(64)) leave_from = db.Column(db.DateTime,nullable=False) leave_to = db.Column(db.DateTime,nullable=False) leave_type = db.Column(db.String(64)) leave_note = db.Column(db.Text, nullable=False) leave_days = db.Column(db.Integer,nullable=False) ####File Handling############ image=db.Column(db.String()) @property def imgsrc(self): return uploaded_images.url(self.image) def __init__(self,accept_flag,reject_flag,leave_status,image,user_status_leave,leave_flag,user_request_leave,admin_request_leave,user_check_leave,leave_from,leave_note,leave_to,leave_type,leave_days,user_id): self.leave_from = leave_from self.leave_status=leave_status self.accept_flag=accept_flag self.reject_flag=reject_flag self.leave_flag=leave_flag self.user_request_leave=user_request_leave self.admin_request_leave=admin_request_leave self.user_check_leave=user_check_leave self.user_status_leave=user_status_leave self.leave_to=leave_to self.leave_type=leave_type self.leave_note=leave_note self.leave_days=leave_days self.image=image self.user_id = user_id def __repr__(self): return f"Post ID: {self.id} --- Leave Type{self.leave_type} Leave From --{self.leave_from},User_ID:{self.user_id}"
class TimeSheetPost(db.Model): users = db.relationship(User) id = db.Column(db.Integer,primary_key=True) user_id = db.Column(db.Integer,db.ForeignKey('users.id'),nullable=False) date = db.Column(db.DateTime,nullable=False,default=datetime.utcnow) timesheet_status = db.Column(db.Boolean, default=False, nullable=False) timesheet_flag = db.Column(db.String(64)) accept_flag=db.Column(db.String(64)) reject_flag=db.Column(db.String(64)) user_request_timesheet= db.Column(db.String(64)) user_check_timesheet=db.Column(db.String(64)) admin_request_timesheet= db.Column(db.String(64)) user_status_timesheet=db.Column(db.String(64)) day_clock = db.Column(db.DateTime,nullable=False) project = db.Column(db.String(64)) job_num=db.Column(db.String(64)) task = db.Column(db.String(64)) status_clock = db.Column(db.String(64)) remainder = db.Column(db.String(64)) meal_allowance = db.Column(db.String(64)) meal_rate_day=db.Column(db.Float) meal_type = db.Column(db.String(64)) OverTime_15=db.Column(db.Float) OverTime_2=db.Column(db.Float) OverTime_25=db.Column(db.Float) NormalTime=db.Column(db.Float) Launch_Break=db.Column(db.Float) clock_in = db.Column(db.DateTime, nullable=False) clock_out = db.Column(db.DateTime, nullable=False) travel_choice = db.Column(db.String(64)) distance = db.Column(db.String(64)) location = db.Column(db.String(64)) comment = db.Column(db.Text, nullable=False) def __init__(self,timesheet_status,meal_allowance,meal_type,meal_rate_day,accept_flag,reject_flag,remainder,job_num,user_status_timesheet,user_request_timesheet,user_check_timesheet,admin_request_timesheet,timesheet_flag,day_clock,OverTime_15,OverTime_2,OverTime_25,NormalTime,Launch_Break,project,task,clock_in,clock_out,travel_choice,distance,location,comment,user_id): self.day_clock = day_clock self.timesheet_status=timesheet_status self.accept_flag=accept_flag self.reject_flag=reject_flag self.remainder=remainder self.job_num=job_num self.meal_allowance=meal_allowance self.meal_type=meal_type self.meal_rate_day=meal_rate_day self.user_request_timesheet=user_request_timesheet self.admin_request_timesheet=admin_request_timesheet self.user_check_timesheet=user_check_timesheet self.user_status_timesheet=user_status_timesheet self.timesheet_flag=timesheet_flag self.OverTime_25=OverTime_25 self.OverTime_15=OverTime_15 self.OverTime_2=OverTime_2 self.NormalTime=NormalTime self.Launch_Break=Launch_Break self.project = project self.task = task self.clock_in = clock_in self.clock_out = clock_out self.travel_choice=travel_choice self.distance=distance self.location=location self.comment=comment self.user_id = user_id def __repr__(self): return f"Post ID: {self.id} --- Project{self.project} Day --{self.day_clock},,User_ID:{self.user_id}"