diff --git a/WarehouseMgr/Tnb.WarehouseMgr/ErpToWmsService.cs b/WarehouseMgr/Tnb.WarehouseMgr/ErpToWmsService.cs index e7953cd6..a4022061 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/ErpToWmsService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/ErpToWmsService.cs @@ -2181,6 +2181,8 @@ namespace Tnb.WarehouseMgr await db.Deleteable().Where(r => r.bill_id == wmsRawmatOutstockHRep.id).ExecuteCommandAsync(); } } + + OrganizeEntity dept = await db.Queryable().Where(x=>x.EnCode==input.dept_code).FirstAsync(); WmsRawmatOutstockH wmsRawmatOutstockH = new WmsRawmatOutstockH(); string code = await _billRuleService.GetBillNumber("rawmatoutstock"); @@ -2190,7 +2192,7 @@ namespace Tnb.WarehouseMgr wmsRawmatOutstockH.erp_bill_code = input.outstock_order; wmsRawmatOutstockH.warehouse_id = WmsWareHouseConst.WAREHOUSE_YCL_ID; //wmsRawmatOutstockH.biller = input.biller; - wmsRawmatOutstockH.department = input.dept_code; + wmsRawmatOutstockH.department = dept?.Id ?? input.dept_code; wmsRawmatOutstockH.erp_pk = input.erp_pk; wmsRawmatOutstockH.issuance_status = "0"; List wmsRawmatOutstockDs = new List();