def addtoitems():
    business_name = request.args.get('business_name')
    invoice = request.args.get("invoice")
    item = request.args.get('item')
    qty = request.args.get('qty')
    temp = request.args.get('temp')
    therm = request.args.get('therm')
    ubd = request.args.get('ubd')
    dest = request.args.get("dest")
    comment = request.args.get('status')

    delivery.add_delivered_item(business_name, invoice, ubd, item,
        temp, dest, therm, qty, comment, c_u.user_id)
    success = {"true": True}
    return json.dumps(success)
def enter():
    business_name = request.args.get('business_name')
    invoice = request.args.get("invoice")
    item = request.args.get('item')
    qty = request.args.get('qty')
    temp = request.args.get('temp')
    therm = request.args.get('therm')
    ubd = request.args.get('ubd')
    dest = request.args.get("dest")
    comment = request.args.get('status')
    supplier_id = request.args.get('supplier_id')

    if business_name is not None:
        delivery.start_new_delivery(business_name, invoice)
        delivery.add_delivered_item(business_name, invoice, ubd, item, temp, 
                dest, therm, qty, comment, c_u.user_id)
    else:
        delivery.add_delivered_item(supplier_id, invoice, ubd, item, temp, dest,
                therm, qty, comment, c_u.user_id)
    success = {"true": True}
    return json.dumps(success)