public void SyncSHD() { //经gamal确认,款到发货、货到付款订单审核时均生成送货单记录 //if (CurrentSO.BaseInfo.PayWhenReceived == false) //{ // return; //} var soItem = CurrentSO.Items; soItem = soItem.Where(p => p.InventoryType == ProductInventoryType.Company || p.InventoryType == ProductInventoryType.TwoDoor).ToList(); //同步送货单 foreach (var item in soItem) { //大件一个商品一个送货单。 ERPSHDInfo erpinfo = new ERPSHDInfo(); erpinfo.SHDTypeMemo = "送货单"; erpinfo.RefOrderNo = SOSysNo.ToString(); erpinfo.RefOrderType = "销售订单"; erpinfo.SysMemo = erpinfo.RefOrderNo + "/" + erpinfo.RefOrderType; erpinfo.ZDR = ServiceContext.Current.UserSysNo; erpinfo.ZDSJ = DateTime.Now; erpinfo.ZXR = ServiceContext.Current.UserSysNo; erpinfo.ZXSJ = DateTime.Now; erpinfo.SHDItemList = new List <ERPSHDItem>(); ERPSHDItem erpitem = new ERPSHDItem(); erpitem.ProductSysNo = item.ProductSysNo; erpitem.SL = item.Quantity; erpinfo.SHDItemList.Add(erpitem); //ObjectFactory<ISyncERPBizRecord>.Instance.CreateSHD(erpinfo); } }
public void CancelAudit() { // 1. 业务检查:商家订单不能取消审核;订单状态不是待主管审核/待出库状态,不能取消审核 if (CurrentSO.ShippingInfo != null && CurrentSO.ShippingInfo.StockType == ECCentral.BizEntity.Invoice.StockType.MET) { BizExceptionHelper.Throw("SO_CancelAudit_SOIsMETOrder", SOSysNo.ToString()); } SOStatus status = CurrentSO.BaseInfo.Status.Value; if (status != SOStatus.WaitingManagerAudit && status != SOStatus.WaitingOutStock) { BizExceptionHelper.Throw("SO_CancelAudit_SOStatusIsError"); } // 2. 取消审核不管本地是否是锁定都需要去检测仓库是否扫描,这里必须先锁定 CurrentSO.BaseInfo.HoldReason = "CancelAuditSO"; CurrentSO.BaseInfo.HoldUser = ECCentral.Service.Utility.ServiceContext.Current.UserSysNo; CurrentSO.BaseInfo.HoldTime = DateTime.Now; bool isSyn = Holder.Hold(SOHolder.SOHoldReason.CancelAuditOrder, OPCCallBackType.CancelAuditCallBack); // 3. 如果是同步锁定订单则执行取消审核操作 if (isSyn) { SaveCancelAudit(); } else { BizExceptionHelper.Throw("SO_CancelAudit_HoldIsAsyn"); } }