diff --git a/WarehouseMgr/Tnb.WarehouseMgr/ErpToWmsService.cs b/WarehouseMgr/Tnb.WarehouseMgr/ErpToWmsService.cs index a4022061..3a539887 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/ErpToWmsService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/ErpToWmsService.cs @@ -2313,6 +2313,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"); @@ -2322,7 +2324,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();