Example #1
0
        protected override void ProcessReferencePayableInfoForCreate(PayItemInfo entity)
        {
            //如果该付款单对应的应付款已经Abandon,那么此时需要重新激活该应付款并将其更新
            if (ReferencePayableInfo != null)
            {
                if (ReferencePayableInfo.PayStatus == PayableStatus.Abandon)
                {
                    ReferencePayableInfo.OrderAmt = entity.PayAmt;
                    ReferencePayableInfo.PayStatus = PayableStatus.UnPay;

                    if (entity.OrderType == PayableOrderType.VendorSettleOrder)
                    {
                        ReferencePayableInfo.EIMSNo = ExternalDomainBroker.GetConsignSettlementReturnPointSysNo(entity.OrderSysNo.Value);
                    }
                    else
                    {
                        ReferencePayableInfo.EIMSNo = null;
                    }
                    PayableBizProcessor.UpdateStatusAndOrderAmt(ReferencePayableInfo);

                    entity.PaySysNo = ReferencePayableInfo.SysNo.Value;
                    entity.CurrencySysNo = 1;
                    entity.OrderType = ReferencePayableInfo.OrderType;
                    entity.OrderSysNo = ReferencePayableInfo.OrderSysNo;
                }

                if (ReferencePayableInfo.PayStatus == PayableStatus.UnPay)
                {
                    entity.PaySysNo = ReferencePayableInfo.SysNo.Value;
                    entity.CurrencySysNo = 1;
                    entity.OrderType = ReferencePayableInfo.OrderType;
                    entity.OrderSysNo = ReferencePayableInfo.OrderSysNo;
                }
            }
            else
            {
                ReferencePayableInfo = new PayableInfo();
                ReferencePayableInfo.OrderSysNo = entity.OrderSysNo.Value;
                ReferencePayableInfo.OrderType = entity.OrderType.Value;
                ReferencePayableInfo.AlreadyPayAmt = 0;
                ReferencePayableInfo.OrderAmt = entity.PayAmt;
                ReferencePayableInfo.CurrencySysNo = 1;
                ReferencePayableInfo.PayStatus = PayableStatus.UnPay;
                ReferencePayableInfo.InvoiceStatus = PayableInvoiceStatus.Absent;
                ReferencePayableInfo.AuditStatus = PayableAuditStatus.NotAudit;
                ReferencePayableInfo.InvoiceFactStatus = PayableInvoiceFactStatus.Corrent;
                ReferencePayableInfo.Note = "Auto created by system!";
                ReferencePayableInfo.CompanyCode = entity.CompanyCode;

                ReferencePayableInfo = PayableBizProcessor.Create(ReferencePayableInfo);

                entity.PaySysNo = ReferencePayableInfo.SysNo.Value;
                entity.CurrencySysNo = 1;
                entity.OrderType = ReferencePayableInfo.OrderType;
                entity.OrderSysNo = ReferencePayableInfo.OrderSysNo;
            }
        }
Example #2
0
        protected override void ProcessReferencePayableInfoForCreate(PayItemInfo entity)
        {
            var now = DateTime.Now;

            //如果该付款单对应的应付款已经Abandon,那么此时需要重新激活该应付款并将其更新
            if (ReferencePayableInfo != null)
            {
                if (ReferencePayableInfo.PayStatus == PayableStatus.Abandon)
                {
                    ReferencePayableInfo.OrderAmt  = entity.PayAmt;
                    ReferencePayableInfo.PayStatus = PayableStatus.UnPay;

                    ReferencePayableInfo.InStockAmt  = entity.InStockAmt;
                    ReferencePayableInfo.EIMSAmt     = entity.EIMSAmt;
                    ReferencePayableInfo.RawOrderAmt = entity.RawOrderAmt;

                    CaclETP(entity, now);

                    PayableBizProcessor.UpdateStatusAndOrderAmt(ReferencePayableInfo);
                }
                entity.PaySysNo      = ReferencePayableInfo.SysNo.Value;
                entity.CurrencySysNo = m_POInfo.PurchaseOrderBasicInfo.CurrencyCode;
                entity.OrderType     = ReferencePayableInfo.OrderType;
                entity.OrderSysNo    = ReferencePayableInfo.OrderSysNo;
            }
            else
            {
                ReferencePayableInfo                    = new PayableInfo();
                ReferencePayableInfo.OrderSysNo         = entity.OrderSysNo.Value;
                ReferencePayableInfo.OrderType          = entity.OrderType.Value;
                ReferencePayableInfo.CurrencySysNo      = m_POInfo.PurchaseOrderBasicInfo.CurrencyCode;
                ReferencePayableInfo.OrderAmt           = entity.PayAmt;
                ReferencePayableInfo.AlreadyPayAmt      = 0;
                ReferencePayableInfo.PayStatus          = PayableStatus.UnPay;
                ReferencePayableInfo.InvoiceStatus      = PayableInvoiceStatus.Absent;
                ReferencePayableInfo.AuditStatus        = PayableAuditStatus.NotAudit;
                ReferencePayableInfo.InvoiceFactStatus  = PayableInvoiceFactStatus.Corrent;
                ReferencePayableInfo.Note               = "Auto created by system!";
                ReferencePayableInfo.BatchNumber        = entity.BatchNumber.HasValue ? entity.BatchNumber : 1;
                ReferencePayableInfo.EIMSAmt            = entity.EIMSAmt;
                ReferencePayableInfo.InStockAmt         = entity.InStockAmt;
                ReferencePayableInfo.RawOrderAmt        = entity.RawOrderAmt;
                ReferencePayableInfo.OrderStatus        = entity.OrderStatus;
                ReferencePayableInfo.EstimatedTimeOfPay = entity.EstimatedTimeOfPay;
                ReferencePayableInfo.CompanyCode        = entity.CompanyCode;

                CaclETP(entity, now);

                ReferencePayableInfo = PayableBizProcessor.Create(ReferencePayableInfo);

                entity.PaySysNo      = ReferencePayableInfo.SysNo.Value;
                entity.CurrencySysNo = m_POInfo.PurchaseOrderBasicInfo.CurrencyCode;
                entity.OrderType     = ReferencePayableInfo.OrderType;
                entity.OrderSysNo    = ReferencePayableInfo.OrderSysNo;
            }
        }
Example #3
0
        protected override void ProcessReferencePayableInfoForCreate(PayItemInfo entity)
        {
            var now = System.DateTime.Now;
            List <PayableInfo> payList = PayableBizProcessor.GetListByCriteria(new PayableInfo
            {
                OrderSysNo = entity.OrderSysNo,
                OrderType  = entity.OrderType
            });

            if (payList != null && payList.Count > 0)
            {
                ReferencePayableInfo = payList[0];
                if (ReferencePayableInfo.PayStatus == PayableStatus.Abandon)
                {
                    ReferencePayableInfo.OrderAmt           = entity.PayAmt;
                    ReferencePayableInfo.PayStatus          = PayableStatus.UnPay;
                    ReferencePayableInfo.EIMSNo             = null;
                    ReferencePayableInfo.EstimatedTimeOfPay = now;
                    PayableBizProcessor.UpdateStatusAndOrderAmt(ReferencePayableInfo);
                }
                entity.CurrencySysNo = 1;
                entity.PaySysNo      = ReferencePayableInfo.SysNo.Value;
                entity.OrderType     = ReferencePayableInfo.OrderType;
                entity.OrderSysNo    = ReferencePayableInfo.OrderSysNo;
            }
            else
            {
                ReferencePayableInfo                    = new PayableInfo();
                ReferencePayableInfo.OrderSysNo         = entity.OrderSysNo.Value;
                ReferencePayableInfo.OrderType          = entity.OrderType.Value;
                ReferencePayableInfo.AlreadyPayAmt      = 0;
                ReferencePayableInfo.OrderAmt           = entity.PayAmt;
                ReferencePayableInfo.CurrencySysNo      = 1;// 人民币类型
                ReferencePayableInfo.PayStatus          = PayableStatus.UnPay;
                ReferencePayableInfo.InvoiceStatus      = PayableInvoiceStatus.Absent;
                ReferencePayableInfo.AuditStatus        = PayableAuditStatus.NotAudit;
                ReferencePayableInfo.InvoiceFactStatus  = PayableInvoiceFactStatus.Corrent;
                ReferencePayableInfo.Note               = "Auto created by system!";
                ReferencePayableInfo.EIMSNo             = null;
                ReferencePayableInfo.EstimatedTimeOfPay = now;
                ReferencePayableInfo.CompanyCode        = entity.CompanyCode;
                ReferencePayableInfo                    = PayableBizProcessor.Create(ReferencePayableInfo);

                entity.PaySysNo      = ReferencePayableInfo.SysNo.Value;
                entity.CurrencySysNo = 1;
                entity.OrderType     = ReferencePayableInfo.OrderType;
                entity.OrderSysNo    = ReferencePayableInfo.OrderSysNo;
            }
        }
Example #4
0
        protected override void ProcessReferencePayableInfoForCreate(PayItemInfo entity)
        {
            int currencySysNo = 1;

            if (ReferencePayableInfo != null)
            {
                if (ReferencePayableInfo.PayStatus == PayableStatus.Abandon)
                {
                    ReferencePayableInfo.OrderAmt  = entity.PayAmt;
                    ReferencePayableInfo.PayStatus = PayableStatus.UnPay;
                    ReferencePayableInfo.EIMSNo    = null;

                    PayableBizProcessor.UpdateStatusAndOrderAmt(ReferencePayableInfo);
                }

                entity.PaySysNo      = ReferencePayableInfo.SysNo.Value;
                entity.CurrencySysNo = currencySysNo;
                entity.OrderType     = ReferencePayableInfo.OrderType;
                entity.OrderSysNo    = ReferencePayableInfo.OrderSysNo;
            }
            else
            {
                ReferencePayableInfo                    = new PayableInfo();
                ReferencePayableInfo.OrderSysNo         = entity.OrderSysNo.Value;
                ReferencePayableInfo.OrderType          = entity.OrderType.Value;
                ReferencePayableInfo.AlreadyPayAmt      = 0;
                ReferencePayableInfo.OrderAmt           = entity.PayAmt;
                ReferencePayableInfo.CurrencySysNo      = currencySysNo;
                ReferencePayableInfo.PayStatus          = PayableStatus.UnPay;
                ReferencePayableInfo.InvoiceStatus      = PayableInvoiceStatus.Absent;
                ReferencePayableInfo.AuditStatus        = PayableAuditStatus.NotAudit;
                ReferencePayableInfo.InvoiceFactStatus  = PayableInvoiceFactStatus.Corrent;
                ReferencePayableInfo.Note               = "Auto created CommissionPayItem!";
                ReferencePayableInfo.InStockAmt         = 0.00m;
                ReferencePayableInfo.EstimatedTimeOfPay = DateTime.Now;
                ReferencePayableInfo.EIMSNo             = null;
                ReferencePayableInfo.CompanyCode        = entity.CompanyCode;

                ReferencePayableInfo = PayableBizProcessor.Create(ReferencePayableInfo);

                entity.PaySysNo      = ReferencePayableInfo.SysNo.Value;
                entity.CurrencySysNo = currencySysNo;
                entity.OrderType     = ReferencePayableInfo.OrderType;
                entity.OrderSysNo    = ReferencePayableInfo.OrderSysNo;
            }
        }
        protected override void ProcessReferencePayableInfoForCreate(PayItemInfo entity)
        {
            int currencySysNo = 1;

            if (ReferencePayableInfo != null)
            {
                //如果该付款单对应的应付款已经Abandon,那么此时需要重新激活该应付款并将其更新
                if (ReferencePayableInfo.PayStatus == PayableStatus.Abandon)
                {
                    ReferencePayableInfo.OrderAmt  = entity.PayAmt;
                    ReferencePayableInfo.PayStatus = PayableStatus.UnPay;
                    ReferencePayableInfo.EIMSNo    = null;

                    PayableBizProcessor.UpdateStatusAndOrderAmt(ReferencePayableInfo);

                    //计算ETP
                    ReferencePayableInfo.EstimatedTimeOfPay = ETPCalculatorHelper.GetETPByPayPeriod(new PayableInfo
                    {
                        OrderType  = PayableOrderType.CollectionSettlement,
                        OrderSysNo = entity.OrderSysNo.Value
                    }, DateTime.Now);
                    PayableBizProcessor.UpdatePayableETP(ReferencePayableInfo);

                    entity.PaySysNo      = ReferencePayableInfo.SysNo.Value;
                    entity.CurrencySysNo = currencySysNo;
                    entity.OrderType     = ReferencePayableInfo.OrderType;
                    entity.OrderSysNo    = ReferencePayableInfo.OrderSysNo;
                }

                if (ReferencePayableInfo.PayStatus == PayableStatus.UnPay)
                {
                    //计算ETP
                    ReferencePayableInfo.EstimatedTimeOfPay = ETPCalculatorHelper.GetETPByPayPeriod(new PayableInfo
                    {
                        OrderType  = PayableOrderType.CollectionSettlement,
                        OrderSysNo = entity.OrderSysNo.Value
                    }, DateTime.Now);
                    PayableBizProcessor.UpdatePayableETP(ReferencePayableInfo);

                    entity.PaySysNo      = ReferencePayableInfo.SysNo.Value;
                    entity.CurrencySysNo = currencySysNo;
                    entity.OrderType     = ReferencePayableInfo.OrderType;
                    entity.OrderSysNo    = ReferencePayableInfo.OrderSysNo;
                }
            }
            else
            {
                ReferencePayableInfo                   = new PayableInfo();
                ReferencePayableInfo.OrderSysNo        = entity.OrderSysNo.Value;
                ReferencePayableInfo.OrderType         = entity.OrderType.Value;
                ReferencePayableInfo.AlreadyPayAmt     = 0M;
                ReferencePayableInfo.OrderAmt          = entity.PayAmt;
                ReferencePayableInfo.CurrencySysNo     = currencySysNo;
                ReferencePayableInfo.PayStatus         = PayableStatus.UnPay;
                ReferencePayableInfo.InvoiceStatus     = PayableInvoiceStatus.Absent;
                ReferencePayableInfo.AuditStatus       = PayableAuditStatus.NotAudit;
                ReferencePayableInfo.InvoiceFactStatus = PayableInvoiceFactStatus.Corrent;
                ReferencePayableInfo.InStockAmt        = 0M;
                ReferencePayableInfo.Note              = "Auto created CollectionSettlementPayItem!";
                ReferencePayableInfo.CompanyCode       = entity.CompanyCode;

                //计算ETP
                ReferencePayableInfo.EstimatedTimeOfPay = ETPCalculatorHelper.GetETPByPayPeriod(new PayableInfo
                {
                    OrderType  = PayableOrderType.CollectionSettlement,
                    OrderSysNo = entity.OrderSysNo.Value
                }, DateTime.Now);
                ReferencePayableInfo.EIMSNo = null;
                ReferencePayableInfo        = PayableBizProcessor.Create(ReferencePayableInfo);

                entity.PaySysNo      = ReferencePayableInfo.SysNo.Value;
                entity.CurrencySysNo = currencySysNo;
                entity.OrderType     = ReferencePayableInfo.OrderType;
                entity.OrderSysNo    = ReferencePayableInfo.OrderSysNo;
            }
        }
Example #6
0
        protected override void ProcessReferencePayableInfoForCreate(PayItemInfo entity)
        {
            var now = System.DateTime.Now;

            //TODO:为EIMS返点创建付款单时CompanyCode怎么取得。
            //entity.CompanyCode = "8601";
            List <PayableInfo> payList = PayableBizProcessor.GetListByCriteria(new PayableInfo
            {
                OrderSysNo  = entity.OrderSysNo,
                OrderType   = entity.OrderType,
                BatchNumber = entity.BatchNumber
            });

            if (payList != null && payList.Count > 0)
            {
                ReferencePayableInfo = payList[0];
                if (ReferencePayableInfo.PayStatus == PayableStatus.Abandon)
                {
                    ReferencePayableInfo.OrderAmt           = entity.PayAmt;
                    ReferencePayableInfo.PayStatus          = PayableStatus.UnPay;
                    ReferencePayableInfo.EIMSNo             = entity.OrderSysNo.Value;
                    ReferencePayableInfo.EstimatedTimeOfPay = now;

                    PayableBizProcessor.UpdateStatusAndOrderAmt(ReferencePayableInfo);
                }
                entity.CurrencySysNo = ReferencePayableInfo.CurrencySysNo;
                entity.PaySysNo      = ReferencePayableInfo.SysNo.Value;
                entity.OrderType     = ReferencePayableInfo.OrderType;
                entity.OrderSysNo    = ReferencePayableInfo.OrderSysNo;
            }
            else
            {
                ReferencePayableInfo                    = new PayableInfo();
                ReferencePayableInfo.OrderSysNo         = entity.OrderSysNo.Value;
                ReferencePayableInfo.OrderType          = entity.OrderType.Value;
                ReferencePayableInfo.AlreadyPayAmt      = 0;
                ReferencePayableInfo.OrderAmt           = entity.PayAmt;
                ReferencePayableInfo.CurrencySysNo      = 1;// 人民币类型
                ReferencePayableInfo.PayStatus          = PayableStatus.UnPay;
                ReferencePayableInfo.InvoiceStatus      = PayableInvoiceStatus.Absent;
                ReferencePayableInfo.AuditStatus        = PayableAuditStatus.NotAudit;
                ReferencePayableInfo.InvoiceFactStatus  = PayableInvoiceFactStatus.Corrent;
                ReferencePayableInfo.EIMSNo             = entity.OrderSysNo.Value;
                ReferencePayableInfo.Note               = "Auto created by system!";
                ReferencePayableInfo.EstimatedTimeOfPay = now;
                ReferencePayableInfo.CompanyCode        = entity.CompanyCode;

                //CRL18977 Added:冲销付款单时,需记录批次号
                ReferencePayableInfo.BatchNumber = entity.BatchNumber;

                //if (ReferencePayableInfo.OrderType == PayableOrderType.SubInvoice) //新建时如果是票扣则ETP不填
                //{
                //    ReferencePayableInfo.EstimatedTimeOfPay = null;
                //}

                ReferencePayableInfo = PayableBizProcessor.Create(ReferencePayableInfo);

                entity.PaySysNo      = ReferencePayableInfo.SysNo.Value;
                entity.CurrencySysNo = ReferencePayableInfo.CurrencySysNo;
                entity.OrderType     = ReferencePayableInfo.OrderType;
                entity.OrderSysNo    = ReferencePayableInfo.OrderSysNo;
            }
        }