feat: 采购和其他入库可入已有批次

This commit is contained in:
caoqianming 2025-04-18 11:29:32 +08:00
parent b44fec0695
commit 6678e39518
1 changed files with 8 additions and 2 deletions

View File

@ -242,6 +242,9 @@ class InmService:
BatchLog.clear(mio=instance)
else:
for item in MIOItem.objects.filter(mio=instance):
if item.mb: # 说明录入到已有批次
BatchSt.g_create(batch=item.batch)
else:
BatchSt.g_create(batch=item.batch, mio=instance, material_start=item.material)
from apps.pum.services import PumService
if is_reverse:
@ -254,6 +257,9 @@ class InmService:
BatchLog.clear(mio=instance)
else:
for item in MIOItem.objects.filter(mio=instance):
if item.mb:
BatchSt.g_create(batch=item.batch)
else:
BatchSt.g_create(batch=item, mio=instance, material_start=item.material)
if is_reverse:
cls.update_mb(instance, -1)