|
@@ -248,13 +248,15 @@ def create_movement(db,movement:list,io_number,io_flag,user_id):
|
|
|
|
|
|
return '剩余库存小于出库量'
|
|
|
remaining_stock = material_info.remaining_stock-changed_stock
|
|
|
-
|
|
|
+ else:
|
|
|
+ if io_flag == 'O':
|
|
|
+ return '物资不存在,无法出库'
|
|
|
new_movement = ResourceProvisionWarehouseMovement(
|
|
|
- material_id=material_id,#Column(String(255), nullable=False, comment='物资id')
|
|
|
- io_number = io_number,#Column(String(255), nullable=False, comment='出入库单号')
|
|
|
- io_flag = io_flag,#Column(String(10), nullable=False, comment='出入库标识')
|
|
|
- changed_stock = changed_stock,#Column(Integer, nullable=False, comment='变动库存')
|
|
|
- remaining_stock = remaining_stock,#Column(Integer, nullable=False, comment='剩余库存')
|
|
|
+ material_id=material_id, # Column(String(255), nullable=False, comment='物资id')
|
|
|
+ io_number=io_number, # Column(String(255), nullable=False, comment='出入库单号')
|
|
|
+ io_flag=io_flag, # Column(String(10), nullable=False, comment='出入库标识')
|
|
|
+ changed_stock=changed_stock, # Column(Integer, nullable=False, comment='变动库存')
|
|
|
+ remaining_stock=remaining_stock, # Column(Integer, nullable=False, comment='剩余库存')
|
|
|
create_by=user_id
|
|
|
)
|
|
|
db.add(new_movement)
|