feat: add borrowed quantity column and update stocktake export formulas
Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) <aider@aider.chat>
This commit is contained in:
@ -115,6 +115,22 @@ def clear_draft():
|
||||
return jsonify({"message": "Cleared"}), 200
|
||||
|
||||
|
||||
@bp.route('/borrowed-quantities', methods=['POST'])
|
||||
@permission_required('inventory_stocktake')
|
||||
def get_borrowed_quantities():
|
||||
"""批量获取借出未还数量"""
|
||||
from app.models.transaction import TransBorrow
|
||||
data = request.json.get('items', [])
|
||||
result = {}
|
||||
for item in data:
|
||||
source = item.get('source_table')
|
||||
stock_id = item.get('stock_id')
|
||||
if source and stock_id is not None:
|
||||
qty = TransBorrow.get_borrowed_quantity(source, stock_id)
|
||||
result[f"{source}_{stock_id}"] = qty
|
||||
return jsonify(result), 200
|
||||
|
||||
|
||||
# --- 打印接口 ---
|
||||
|
||||
@bp.route('/print/selection', methods=['POST'])
|
||||
|
||||
Reference in New Issue
Block a user