first commit

This commit is contained in:
2024-02-28 16:10:40 -05:00
commit b71bbe2dc5
49 changed files with 3582 additions and 0 deletions

24
app/reports/views.py Normal file
View File

@@ -0,0 +1,24 @@
from flask import request, jsonify
from flask_login import current_user
from sqlalchemy.sql import func
from datetime import date, timedelta
from app.reports import reports
from app import db
from datetime import datetime
from app.classes.auth import Auth_User
from app.classes.customer import Customer_Customer
from app.classes.service import Service_Call, Service_Call_schema
from app.classes.employee import Employee_Employee
from app.classes.service import Service_Call_Notes_Dispatcher, Service_Call_Notes_Technician
from app.classes.delivery import Delivery_Delivery
@reports.route("/oil/total", methods=["GET"])
def oil_total_gallons():
total_oil = db.session\
.query(func.sum(Delivery_Delivery.gallons_delivered))\
.group_by(Delivery_Delivery.id)\
.all()
return jsonify({"ok": True }), 200