Ejemplo n.º 1
0
        /// <summary>
        /// ��ȡro��Ʊ
        /// </summary>
        /// <param name="roSysNo"></param>
        /// <returns></returns>
        public ROInvoiceInfo GetROInvoice(int refundSysNo)
        {
            ROInvoiceInfo invoice = new ROInvoiceInfo();
            RMARefundInfo oRma = this.Load(refundSysNo);

            IcsonInfo icson = new IcsonInfo();
            invoice.AuditUserSysNo = oRma.AuditUserSysNo;
            invoice.CompanyAddress = icson.CompanyAddress;
            //invoice.InvoiceNote = so.InvoiceNote;
            invoice.SOID = oRma.SOSysNo.ToString();
            invoice.ROID = oRma.RefundID;

            CustomerInfo customer = CustomerManager.GetInstance().Load(oRma.CustomerSysNo);
            invoice.CustomerName = customer.CustomerName;
            invoice.CustomerSysNo = customer.SysNo;
            invoice.ReceiveName = customer.ReceiveName;
            invoice.ReceivePhone = customer.ReceivePhone;

            this.InitPageList(oRma, invoice);
            invoice.TotalPage = invoice.ItemHash.Count;
            invoice.TotalWeight = 0;

            return invoice;
        }
Ejemplo n.º 2
0
        private void InitPageList(ROInfo ro, ROInvoiceInfo invoice)
        {
            int index = 0;
            ROInvoicePageInfo page = new ROInvoicePageInfo();
            invoice.ItemHash.Add(index++, page);
            Hashtable sysHash = new Hashtable(5);
            foreach (ROItemInfo item in ro.ItemHash.Values)
            {
                sysHash.Add(item.ProductSysNo, null);
            }
            Hashtable pbHash = ProductManager.GetInstance().GetProductBoundle(sysHash);
            foreach (ROItemInfo item in ro.ItemHash.Values)
            {
                ROInvoicePageItemInfo printItem = new ROInvoicePageItemInfo();
                printItem.pk = ((ProductBasicInfo)pbHash[item.ProductSysNo]).ProductID;  //add by lucky 2008/04/16
                printItem.ProductID = ((ProductBasicInfo)pbHash[item.ProductSysNo]).ProductID;
                printItem.ProductName = ((ProductBasicInfo)pbHash[item.ProductSysNo]).ProductName;
                printItem.Quantity = item.Quantity * (-1);
                printItem.Weight = item.Weight;
                printItem.Total = (-1) * item.RefundCash;
                printItem.Price = (decimal)(item.RefundCash / item.Quantity);
                printItem.isRoItem = true;
                if (page.AddItem(printItem) == true)
                {
                    continue;
                }
                else
                {
                    page = new ROInvoicePageInfo();
                    page.AddItem(printItem);
                    invoice.ItemHash.Add(index++, page);
                }
                sysHash.Add(item.ProductSysNo, null);
            }

            if (ro.PointAmt != 0)
            {
                ROInvoicePageItemInfo printItem = new ROInvoicePageItemInfo();
                printItem.pk = "Ӱ�����"; //add by lucky 2008/04/16
                printItem.ProductID = "Ӱ�����";
                printItem.Total = Convert.ToDecimal(ro.PointAmt);
                printItem.isRoItem = false;
                printItem.isPoint = true;
                if (page.AddItem(printItem) == false)
                {
                    page = new ROInvoicePageInfo();
                    page.AddItem(printItem);
                    invoice.ItemHash.Add(index++, page);
                }
            }

            if (ro.RedeemAmt != 0)
            {
                ROInvoicePageItemInfo printItem = new ROInvoicePageItemInfo();
                printItem.pk = "������"; //add by lucky 2008/04/16
                printItem.ProductID = "������";
                printItem.Total = ro.RedeemAmt;
                printItem.isRoItem = false;
                if (page.AddItem(printItem) == false)
                {
                    page = new ROInvoicePageInfo();
                    page.AddItem(printItem);
                    invoice.ItemHash.Add(index++, page);
                }
            }
        }
Ejemplo n.º 3
0
        private void InitPageList(RMARefundInfo oRma, ROInvoiceInfo invoice)
        {
            int index = 0;
            ROInvoicePageInfo page = new ROInvoicePageInfo();
            invoice.ItemHash.Add(index++, page);
            DataSet ds = GetRefundItemDs(oRma.SysNo);

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                ROInvoicePageItemInfo printItem = new ROInvoicePageItemInfo();
                printItem.pk = dr["registersysno"].ToString();
                printItem.ProductID = Util.TrimNull(dr["ProductID"]);
                printItem.ProductName = Util.TrimNull(dr["ProductName"]);

                decimal refundCash = Util.TrimDecimalNull(dr["RefundCash"]);
                if (oRma.RefundPayType == (int)AppEnum.RMARefundPayType.TransferPointRefund)
                    refundCash = 0;

                printItem.Quantity = -1;
                printItem.Weight = 0;
                printItem.Total = (-1) * refundCash;
                printItem.Price = refundCash;
                printItem.isRoItem = true;
                if (page.AddItem(printItem) == true)
                {
                    continue;
                }
                else
                {
                    page = new ROInvoicePageInfo();
                    page.AddItem(printItem);
                    invoice.ItemHash.Add(index++, page);
                }
            }

            if (oRma.DeductPointFromCurrentCash != 0)
            {
                ROInvoicePageItemInfo printItem = new ROInvoicePageItemInfo();
                printItem.pk = "��ػ���";
                printItem.ProductID = "��ػ���";
                printItem.Total = Convert.ToDecimal(oRma.DeductPointFromCurrentCash);
                printItem.isRoItem = false;
                //				printItem.isPoint = true;
                if (page.AddItem(printItem) == false)
                {
                    page = new ROInvoicePageInfo();
                    page.AddItem(printItem);
                    invoice.ItemHash.Add(index++, page);
                }
            }

            if (oRma.CompensateShipPrice != 0)
            {
                ROInvoicePageItemInfo printItem = new ROInvoicePageItemInfo();
                printItem.pk = "�����˷�";
                printItem.ProductID = "�����˷�";
                printItem.Total = Convert.ToDecimal(-1 * oRma.CompensateShipPrice);
                printItem.isRoItem = false;
                if (page.AddItem(printItem) == false)
                {
                    page = new ROInvoicePageInfo();
                    page.AddItem(printItem);
                    invoice.ItemHash.Add(index++, page);
                }
            }

            if (oRma.PointAmt != 0)
            {
                ROInvoicePageItemInfo printItem = new ROInvoicePageItemInfo();
                printItem.pk = "Ӱ�����";
                printItem.ProductID = "Ӱ�����";

                int affectedPoint = oRma.PointAmt;
                if (oRma.RefundPayType == (int)AppEnum.RMARefundPayType.TransferPointRefund)
                    affectedPoint += Convert.ToInt32(Decimal.Round(oRma.CashAmt * AppConst.ExchangeRate, 0));

                printItem.Total = affectedPoint;
                printItem.isRoItem = false;
                printItem.isPoint = true;
                if (page.AddItem(printItem) == false)
                {
                    page = new ROInvoicePageInfo();
                    page.AddItem(printItem);
                    invoice.ItemHash.Add(index++, page);
                }
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// ��ȡro��Ʊ
 /// </summary>
 /// <param name="roSysNo"></param>
 /// <returns></returns>
 public ROInvoiceInfo GetROInvoice(int roSysNo)
 {
     ROInvoiceInfo invoice = new ROInvoiceInfo();
     ROInfo ro = this.LoadRO(roSysNo);
     RMAInfo rma = RMAManager.GetInstance().Load(ro.RMASysNo);
     SOInfo so = SaleManager.GetInstance().LoadSO(rma.SOSysNo);
     IcsonInfo son = new IcsonInfo();
     invoice.AuditUserSysNo = ro.AuditUserSysNo;
     invoice.CompanyAddress = son.CompanyAddress;
     invoice.InvoiceNote = so.InvoiceNote;
     invoice.SOID = so.SOID;
     PayTypeInfo ptInfo = ASPManager.GetInstance().LoadPayType(so.PayTypeSysNo);
     invoice.PayTypeName = ptInfo.PayTypeName;
     invoice.ReceiveAddress = ro.ReceiveAddress;
     CustomerInfo customer = CustomerManager.GetInstance().Load(so.CustomerSysNo);
     invoice.CustomerName = customer.CustomerName;
     invoice.CustomerSysNo = customer.SysNo;
     invoice.ReceiveName = ro.ReceiveName;
     invoice.ReceivePhone = ro.ReceivePhone;
     invoice.ROID = ro.ROID;
     invoice.ROSysNo = ro.SysNo;
     ShipTypeInfo stInfo = ASPManager.GetInstance().LoadShipType(so.ShipTypeSysNo);
     invoice.ShipTypeName = stInfo.ShipTypeName;
     UserInfo employee = SysManager.GetInstance().LoadUser(so.OutUserSysNo);
     if (employee != null)
     {
         invoice.WarehouseUserCode = employee.UserID;
     }
     else
     {
         invoice.WarehouseUserCode = "";
     }
     this.InitPageList(ro, invoice);
     invoice.TotalPage = invoice.ItemHash.Count;
     invoice.TotalWeight = ro.GetTotalWeight();
     return invoice;
 }