updated page amount
This commit is contained in:
@@ -20,4 +20,28 @@ def oil_total_gallons():
|
||||
.group_by(Delivery_Delivery.id)\
|
||||
.all()
|
||||
|
||||
return jsonify({"ok": True }), 200
|
||||
return jsonify({"ok": True }), 200
|
||||
|
||||
@reports.route("/customers/list", methods=["GET"])
|
||||
def customer_list():
|
||||
"""
|
||||
Retrieve a list of customers with selected fields for printing.
|
||||
Returns account number, first name, last name, address, town, and phone number.
|
||||
Ordered by last name from A to Z.
|
||||
"""
|
||||
|
||||
customers = db.session.query(Customer_Customer).order_by(Customer_Customer.customer_last_name.asc()).all()
|
||||
customer_data = [
|
||||
{
|
||||
"account_number": customer.account_number,
|
||||
"first_name": customer.customer_first_name,
|
||||
"last_name": customer.customer_last_name,
|
||||
"address": customer.customer_address,
|
||||
"town": customer.customer_town,
|
||||
"phone_number": customer.customer_phone_number
|
||||
}
|
||||
for customer in customers
|
||||
]
|
||||
response = jsonify({"ok": True, "customers": customer_data})
|
||||
|
||||
return response, 200
|
||||
|
||||
Reference in New Issue
Block a user