unsure
This commit is contained in:
0
app/classes/__init__.py
Normal file → Executable file
0
app/classes/__init__.py
Normal file → Executable file
0
app/classes/admin.py
Normal file → Executable file
0
app/classes/admin.py
Normal file → Executable file
0
app/classes/auth.py
Normal file → Executable file
0
app/classes/auth.py
Normal file → Executable file
0
app/classes/auto.py
Normal file → Executable file
0
app/classes/auto.py
Normal file → Executable file
0
app/classes/cards.py
Normal file → Executable file
0
app/classes/cards.py
Normal file → Executable file
0
app/classes/company.py
Normal file → Executable file
0
app/classes/company.py
Normal file → Executable file
0
app/classes/customer.py
Normal file → Executable file
0
app/classes/customer.py
Normal file → Executable file
22
app/classes/delivery.py
Normal file → Executable file
22
app/classes/delivery.py
Normal file → Executable file
@@ -72,28 +72,6 @@ class Delivery_Delivery_schema(ma.SQLAlchemyAutoSchema):
|
||||
model = Delivery_Delivery
|
||||
|
||||
|
||||
class Delivery_Payment(db.Model):
|
||||
__tablename__ = 'delivery_payment'
|
||||
__bind_key__ = 'eamco'
|
||||
__table_args__ = {"schema": "public"}
|
||||
|
||||
id = db.Column(db.Integer,
|
||||
primary_key=True,
|
||||
autoincrement=True,
|
||||
unique=False)
|
||||
|
||||
delivery_id = db.Column(db.INTEGER)
|
||||
time_added = db.Column(db.TIMESTAMP(), default=datetime.utcnow())
|
||||
total_amount_oil = db.Column(db.DECIMAL(50, 2))
|
||||
total_amount_emergency = db.Column(db.DECIMAL(50, 2))
|
||||
total_amount_prime = db.Column(db.DECIMAL(50, 2))
|
||||
total_amount_fee = db.Column(db.DECIMAL(50, 2))
|
||||
total_amount = db.Column(db.DECIMAL(50, 2))
|
||||
|
||||
class Delivery_Payment_schema(ma.SQLAlchemyAutoSchema):
|
||||
class Meta:
|
||||
model = Delivery_Payment
|
||||
|
||||
|
||||
class Delivery_Notes_Driver(db.Model):
|
||||
__tablename__ = 'delivery_notes'
|
||||
|
||||
0
app/classes/employee.py
Normal file → Executable file
0
app/classes/employee.py
Normal file → Executable file
48
app/classes/money.py
Normal file
48
app/classes/money.py
Normal file
@@ -0,0 +1,48 @@
|
||||
from app import db, ma
|
||||
from datetime import datetime, timezone
|
||||
|
||||
|
||||
class Money_delivery(db.Model):
|
||||
__tablename__ = 'money_delivery'
|
||||
__bind_key__ = 'eamco'
|
||||
__table_args__ = {"schema": "public"}
|
||||
|
||||
id = db.Column(db.Integer,
|
||||
primary_key=True,
|
||||
autoincrement=True,
|
||||
unique=False)
|
||||
|
||||
delivery_id = db.Column(db.INTEGER)
|
||||
time_added = db.Column(db.TIMESTAMP(), datetime.now(timezone.utc).replace(tzinfo=None))
|
||||
gallons_delivered = db.Column(db.DECIMAL(50, 2))
|
||||
supplier_price = db.Column(db.DECIMAL(50, 2))
|
||||
customer_price = db.Column(db.DECIMAL(50, 2))
|
||||
|
||||
total_amount_oil = db.Column(db.DECIMAL(50, 2))
|
||||
total_amount_prime = db.Column(db.DECIMAL(50, 2))
|
||||
total_amount_same_day = db.Column(db.DECIMAL(50, 2))
|
||||
total_amount_fee = db.Column(db.DECIMAL(50, 2))
|
||||
total_amount = db.Column(db.DECIMAL(50, 2))
|
||||
|
||||
taxes_paid = db.Column(db.DECIMAL(50, 2))
|
||||
total_profit = db.Column(db.DECIMAL(50, 2))
|
||||
|
||||
|
||||
class Money_delivery_schema(ma.SQLAlchemyAutoSchema):
|
||||
class Meta:
|
||||
model = Money_delivery
|
||||
|
||||
|
||||
|
||||
class Pricing_Taxes(db.Model):
|
||||
__tablename__ = 'pricing_taxes'
|
||||
__bind_key__ = 'eamco'
|
||||
__table_args__ = {"schema": "public"}
|
||||
|
||||
id = db.Column(dn.Integer,
|
||||
primary_key=True,
|
||||
autoincrement=True,
|
||||
unique=False)
|
||||
state_id = db.Column(db.Integer)
|
||||
taxes_oil = db.Column(db.DECIMAL(50, 2))
|
||||
taxes_other = db.Column(db.DECIMAL(50, 2))
|
||||
21
app/classes/pricing.py
Normal file → Executable file
21
app/classes/pricing.py
Normal file → Executable file
@@ -2,28 +2,7 @@ from app import db, ma, login_manager
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class Pricing_Service_General(db.Model):
|
||||
__tablename__ = 'pricing_service_general'
|
||||
__bind_key__ = 'eamco'
|
||||
__table_args__ = {"schema": "public"}
|
||||
|
||||
id = db.Column(db.Integer,
|
||||
primary_key=True,
|
||||
autoincrement=True,
|
||||
unique=False)
|
||||
|
||||
price_service_hour = db.Column(db.DECIMAL(50, 2))
|
||||
price_emergency_service_hour = db.Column(db.DECIMAL(50, 2))
|
||||
price_emergency_call = db.Column(db.DECIMAL(50, 2))
|
||||
price_out_of_oil = db.Column(db.DECIMAL(50, 2))
|
||||
price_prime = db.Column(db.DECIMAL(50, 2))
|
||||
price_cleaning = db.Column(db.DECIMAL(50, 2))
|
||||
date = db.Column(db.TIMESTAMP(), default=datetime.utcnow())
|
||||
|
||||
|
||||
class Pricing_Service_General_schema(ma.SQLAlchemyAutoSchema):
|
||||
class Meta:
|
||||
model = Pricing_Service_General
|
||||
|
||||
|
||||
class Pricing_Oil_Oil(db.Model):
|
||||
|
||||
0
app/classes/query.py
Normal file → Executable file
0
app/classes/query.py
Normal file → Executable file
@@ -1,126 +0,0 @@
|
||||
|
||||
from app import db, ma
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class Service_Call(db.Model):
|
||||
__tablename__ = 'service_call'
|
||||
__bind_key__ = 'eamco'
|
||||
__table_args__ = {"schema": "public"}
|
||||
|
||||
id = db.Column(db.Integer,
|
||||
primary_key=True,
|
||||
autoincrement=True,
|
||||
unique=False)
|
||||
|
||||
customer_id = db.Column(db.INTEGER)
|
||||
customer_last_name = db.Column(db.VARCHAR(250))
|
||||
customer_first_name = db.Column(db.VARCHAR(250))
|
||||
customer_town = db.Column(db.VARCHAR(140))
|
||||
customer_state = db.Column(db.INTEGER)
|
||||
customer_zip = db.Column(db.VARCHAR(25))
|
||||
customer_apt = db.Column(db.VARCHAR(140))
|
||||
customer_address = db.Column(db.VARCHAR(1000))
|
||||
|
||||
#0 = closed
|
||||
#1 = open
|
||||
status = db.Column(db.INTEGER)
|
||||
|
||||
# 0 = unknown
|
||||
# 1 = cleaning / tuneup
|
||||
# 2 = problem
|
||||
# 3 = install
|
||||
# 3 = callback
|
||||
service_type = db.Column(db.INTEGER)
|
||||
# when the call to service took place
|
||||
when_called = db.Column(db.DATE(), default=datetime.utcnow())
|
||||
# what day the call will take place
|
||||
scheduled_date = db.Column(db.DATE(), default=datetime.utcnow())
|
||||
# what day the call will take place
|
||||
scheduled_time = db.Column(db.INTEGER)
|
||||
# when the service took place
|
||||
when_serviced = db.Column(db.DATE(), default=datetime.utcnow())
|
||||
# is the call finished or not
|
||||
# 0 = open
|
||||
#1 = finished
|
||||
completed = db.Column(db.INTEGER)
|
||||
tech_id = db.Column(db.INTEGER)
|
||||
tech_first_name = db.Column(db.VARCHAR(300))
|
||||
tech_last_name = db.Column(db.VARCHAR(300))
|
||||
|
||||
payment_type = db.Column(db.INTEGER)
|
||||
payment_card_id = db.Column(db.INTEGER)
|
||||
|
||||
|
||||
class Service_Call_schema(ma.SQLAlchemyAutoSchema):
|
||||
class Meta:
|
||||
model = Service_Call
|
||||
|
||||
|
||||
class Service_Call_Money(db.Model):
|
||||
__tablename__ = 'service_money'
|
||||
__bind_key__ = 'eamco'
|
||||
__table_args__ = {"schema": "public"}
|
||||
|
||||
id = db.Column(db.Integer,
|
||||
primary_key=True,
|
||||
autoincrement=True,
|
||||
unique=False)
|
||||
|
||||
service_call_id = db.Column(db.INTEGER)
|
||||
hours = db.Column(db.DECIMAL(50, 2))
|
||||
cost_per_hour = db.Column(db.DECIMAL(50, 2))
|
||||
parts_cost = db.Column(db.DECIMAL(50, 2))
|
||||
|
||||
|
||||
class Service_Call_Money_schema(ma.SQLAlchemyAutoSchema):
|
||||
class Meta:
|
||||
model = Service_Call_Money
|
||||
|
||||
|
||||
class Service_Call_Notes_Dispatcher(db.Model):
|
||||
__tablename__ = 'service_notes_dispatcher'
|
||||
__bind_key__ = 'eamco'
|
||||
__table_args__ = {"schema": "public"}
|
||||
|
||||
id = db.Column(db.Integer,
|
||||
primary_key=True,
|
||||
autoincrement=True,
|
||||
unique=False)
|
||||
|
||||
service_call_id = db.Column(db.INTEGER)
|
||||
dispatcher_notes = db.Column(db.TEXT)
|
||||
dispatcher_subject = db.Column(db.VARCHAR(1024))
|
||||
time_added = db.Column(db.TIMESTAMP(), default=datetime.utcnow())
|
||||
dispatcher_id = db.Column(db.INTEGER)
|
||||
dispatcher_name = db.Column(db.VARCHAR(140))
|
||||
|
||||
|
||||
class Service_Call_Notes_Dispatcher_schema(ma.SQLAlchemyAutoSchema):
|
||||
class Meta:
|
||||
model = Service_Call_Notes_Dispatcher
|
||||
|
||||
|
||||
class Service_Call_Notes_Technician(db.Model):
|
||||
__tablename__ = 'service_notes_technician'
|
||||
__bind_key__ = 'eamco'
|
||||
__table_args__ = {"schema": "public"}
|
||||
|
||||
id = db.Column(db.Integer,
|
||||
primary_key=True,
|
||||
autoincrement=True,
|
||||
unique=False)
|
||||
|
||||
service_call_id = db.Column(db.INTEGER)
|
||||
technician_comments = db.Column(db.TEXT)
|
||||
time_added = db.Column(db.TIMESTAMP(), default=datetime.utcnow())
|
||||
technician_id = db.Column(db.INTEGER)
|
||||
technician_name = db.Column(db.VARCHAR(140))
|
||||
|
||||
|
||||
class Service_Call_Notes_Technician_schema(ma.SQLAlchemyAutoSchema):
|
||||
class Meta:
|
||||
model = Service_Call_Notes_Technician
|
||||
|
||||
|
||||
|
||||
0
app/classes/stats_customer.py
Normal file → Executable file
0
app/classes/stats_customer.py
Normal file → Executable file
26
app/classes/stats_employee.py
Normal file → Executable file
26
app/classes/stats_employee.py
Normal file → Executable file
@@ -1,5 +1,5 @@
|
||||
|
||||
from app import db, ma, login_manager
|
||||
from app import db, ma
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
@@ -12,11 +12,10 @@ class Stats_Employee_Oil(db.Model):
|
||||
primary_key=True,
|
||||
autoincrement=True,
|
||||
unique=False)
|
||||
|
||||
employee_id = db.Column(db.INTEGER)
|
||||
total_deliveries = db.Column(db.INTEGER)
|
||||
total_gallons_delivered = db.Column(db.INTEGER)
|
||||
total_primes = db.Column(db.INTEGER)
|
||||
total_gallons_fuel = db.Column(db.INTEGER)
|
||||
oil_total_profit_delivered = db.Column(db.DECIMAL(50, 2))
|
||||
|
||||
class Stats_Employee_Oil_schema(ma.SQLAlchemyAutoSchema):
|
||||
@@ -26,8 +25,10 @@ class Stats_Employee_Oil_schema(ma.SQLAlchemyAutoSchema):
|
||||
|
||||
|
||||
|
||||
class Stats_Employee_Service(db.Model):
|
||||
__tablename__ = 'stats_employee_service'
|
||||
|
||||
|
||||
class Stats_Employee_Office(db.Model):
|
||||
__tablename__ = 'stats_employee_office'
|
||||
__bind_key__ = 'eamco'
|
||||
__table_args__ = {"schema": "public"}
|
||||
|
||||
@@ -36,11 +37,12 @@ class Stats_Employee_Service(db.Model):
|
||||
autoincrement=True,
|
||||
unique=False)
|
||||
|
||||
total_service_calls = db.Column(db.INTEGER)
|
||||
total_service_calls_hours = db.Column(db.INTEGER)
|
||||
total_gallons_fuel = db.Column(db.INTEGER)
|
||||
total_amount_billed= db.Column(db.DECIMAL(50, 2))
|
||||
total_profit_made = db.Column(db.DECIMAL(50, 2))
|
||||
class Stats_Employee_Service_schema(ma.SQLAlchemyAutoSchema):
|
||||
employee_id = db.Column(db.INTEGER)
|
||||
total_orders = db.Column(db.INTEGER)
|
||||
total_credit_cards_proccessed = db.Column(db.INTEGER)
|
||||
|
||||
class Stats_Employee_Office_schema(ma.SQLAlchemyAutoSchema):
|
||||
class Meta:
|
||||
model = Stats_Employee_Service
|
||||
model = Stats_Employee_Office
|
||||
|
||||
|
||||
|
||||
0
app/classes/stripe.py
Normal file → Executable file
0
app/classes/stripe.py
Normal file → Executable file
Reference in New Issue
Block a user