added checks emergency fixed bugs

This commit is contained in:
2024-09-27 14:13:44 -04:00
parent 0e827053de
commit fec638a5c8
13 changed files with 262 additions and 68 deletions

View File

@@ -24,7 +24,7 @@ class Delivery_Delivery(db.Model):
# if customer asked for a fill
customer_asked_for_fill = db.Column(db.INTEGER)
# integer value if delivered, waiting, cancelled etc
gallons_delivered =db.Column(db.DECIMAL(50, 2))
gallons_delivered =db.Column(db.DECIMAL(6, 2))
# if customer has a full tank
customer_filled = db.Column(db.INTEGER)
# integer value if delivered, waiting, cancelled etc
@@ -36,9 +36,9 @@ class Delivery_Delivery(db.Model):
# issue = 5
# finalized = 10
delivery_status = db.Column(db.INTEGER)
emergency = db.Column(db.INTEGER)
# when the call to order took place
when_ordered = db.Column(db.DATE(), default=datetime.utcnow())
when_ordered = db.Column(db.DATE(), default=None)
# when the delivery date happened
when_delivered = db.Column(db.DATE(), default=None)
# when the delivery is expected ie what day
@@ -48,14 +48,18 @@ class Delivery_Delivery(db.Model):
automatic_id = db.Column(db.INTEGER)
# OIL info and id from table
oil_id = db.Column(db.INTEGER)
supplier_price = db.Column(db.DECIMAL(50, 2))
customer_price = db.Column(db.DECIMAL(50, 2))
supplier_price = db.Column(db.DECIMAL(6, 2))
customer_price = db.Column(db.DECIMAL(6, 2))
# weather
customer_temperature = db.Column(db.DECIMAL(50, 2))
customer_temperature = db.Column(db.DECIMAL(6, 2))
# services
dispatcher_notes = db.Column(db.TEXT())
prime = db.Column(db.INTEGER)
same_day = db.Column(db.INTEGER)
emergency = db.Column(db.INTEGER)
# cash = 0
# credit = 1
# credit/cash = 2
@@ -63,15 +67,15 @@ class Delivery_Delivery(db.Model):
# other = 4
payment_type = db.Column(db.INTEGER)
payment_card_id = db.Column(db.INTEGER)
cash_recieved = db.Column(db.DECIMAL(50, 2))
cash_recieved = db.Column(db.DECIMAL(6, 2))
driver_employee_id = db.Column(db.INTEGER)
driver_first_name = db.Column(db.VARCHAR(140))
driver_last_name = db.Column(db.VARCHAR(140))
pre_charge_amount = db.Column(db.DECIMAL(50, 2))
total_price = db.Column(db.DECIMAL(50, 2))
final_price = db.Column(db.DECIMAL(50, 2))
pre_charge_amount = db.Column(db.DECIMAL(6, 2))
total_price = db.Column(db.DECIMAL(6, 2))
final_price = db.Column(db.DECIMAL(6, 2))
check_number = db.Column(db.VARCHAR(20))
class Delivery_Delivery_schema(ma.SQLAlchemyAutoSchema):