lets add settings new to css
This commit is contained in:
@@ -2382,6 +2382,41 @@ def generate_location_label_pdf():
|
||||
from app.warehouse import generate_location_label_pdf
|
||||
return generate_location_label_pdf()
|
||||
|
||||
@warehouse_bp.route('/update_location', methods=['POST'])
|
||||
def update_location():
|
||||
from app.warehouse import update_location
|
||||
try:
|
||||
data = request.get_json()
|
||||
location_id = data.get('location_id')
|
||||
location_code = data.get('location_code')
|
||||
size = data.get('size')
|
||||
description = data.get('description')
|
||||
|
||||
if not location_id or not location_code:
|
||||
return jsonify({'success': False, 'error': 'Location ID and code are required'})
|
||||
|
||||
result = update_location(location_id, location_code, size, description)
|
||||
return jsonify(result)
|
||||
|
||||
except Exception as e:
|
||||
return jsonify({'success': False, 'error': str(e)})
|
||||
|
||||
@warehouse_bp.route('/delete_location', methods=['POST'])
|
||||
def delete_location():
|
||||
from app.warehouse import delete_location_by_id
|
||||
try:
|
||||
data = request.get_json()
|
||||
location_id = data.get('location_id')
|
||||
|
||||
if not location_id:
|
||||
return jsonify({'success': False, 'error': 'Location ID is required'})
|
||||
|
||||
result = delete_location_by_id(location_id)
|
||||
return jsonify(result)
|
||||
|
||||
except Exception as e:
|
||||
return jsonify({'success': False, 'error': str(e)})
|
||||
|
||||
|
||||
# NOTE for frontend/extension developers:
|
||||
# To print labels, call the Chrome extension and pass the PDF URL:
|
||||
|
||||
Reference in New Issue
Block a user