铁芯打印

入库单明细拆分,打印拆分
出库对账(仓库建使用)
This commit is contained in:
zgf committed 2024-01-14 13:48:13 +08:00
1 parent d19f62e48b
commit cec65caa32
11 files changed
+170 -57

No files matched your search

@@ -479,29 +479,47 @@ namespace HHWMS.Web.Controllers
{
return JsonMore(null, 500, "ERP无足够库存!");
}
if(ship.Qty <= item.QTYSTU_0)
var qty = ship.Qty;
int skipNum = 0;
while(qty > 0)
{
ship.Batch = item.LOT_0;
ship.InventoryStatus = item.STA_0;
_unitwork.Update(ship);
}
else if(ship.Qty > item.QTYSTU_0)
{
var newShip = ship;
newShip.ID = null;
newShip.Qty = ship.Qty - item.QTYSTU_0;
_unitwork.Add(newShip);
item = data.Skip(skipNum).Take(1).FirstOrDefault();
// 新建明细
var newShip = new ShipmentDetail2();
newShip.WarehouseId = ship.WarehouseId;
newShip.ShipmentId = ship.ShipmentId;
newShip.ShipmentCode = ship.ShipmentCode;
newShip.SourceCode = ship.SourceCode;
newShip.SourceLine = ship.SourceLine;
newShip.MaterialCode = ship.MaterialCode;
newShip.MaterialName = ship.MaterialName;
newShip.Lot = ship.Lot;
newShip.Unit = ship.Unit;
newShip.PurchasQty = ship.PurchasQty;
newShip.PurchasUnits = ship.PurchasUnits;
newShip.Status = 0;
newShip.CreateTime = DateTime.Now;
if (qty <= item.QTYSTU_0)
{
ship.Qty = qty;
ship.Batch = item.LOT_0;
ship.InventoryStatus = item.STA_0;
_unitwork.Update(ship);
ship.Qty = item.QTYSTU_0;
ship.Batch = item.LOT_0;
ship.InventoryStatus = item.STA_0;
_unitwork.Update(ship);
qty = 0;
}
else if (qty > item.QTYSTU_0)
{
newShip.Qty = item.QTYSTU_0;
newShip.Batch = item.LOT_0;
newShip.InventoryStatus = item.STA_0;
_unitwork.Add(newShip);
data.Remove(item);
Check(newShip.ID.ToString(), data);
}
qty = qty - item.QTYSTU_0;
skipNum++;
}
};
return JsonMore(null);
}