Exemple #1
0
 public bool Update(YB_DP_Item_Swap yb)
 {
     ABi_Company abi_company = new ABi_Company();
     string company_id = abi_company.GetCompanyCodeByID(yb.Bukrs);
     if (string.IsNullOrEmpty(company_id) == false)
     {
         this.invoiceNumber = yb.Invoice_no;
         string selStr = "update ABi_Invoice set PaymentStatus='" + yb.Status_i + "' where invoiceNumber='" + this.invoiceNumber + "' and aBi_Company_ID='" + company_id + "' and PaymentStatus not in('3','4')";
         return this.ExecCommand(selStr);
     }
     else
         return false;
 }
        public ABi_PO(YB_PO_Report_Swap po)
        {
            if (po.Lifnr.Length >= 6)
                po.Lifnr = po.Lifnr.Substring(po.Lifnr.Length-6,6);
            ABi_Vendor abi_wendor = new ABi_Vendor(po.Lifnr);//去abi_vendor找,如果没找到,等待下一轮处理
            if (string.IsNullOrEmpty(abi_wendor.VendorCode) == false)
            {
                this.aBi_Vendor_ID = abi_wendor.ABi_Vendor_ID;
            }
            else
            {
                utils.WriteLog(String.Format("YB_PO_Report_Swap编号:{0} 未找到供应商编号: {1}", po.Ebeln, po.Lifnr));
                return;
            }
            //根据Code在ABi表中找
            ABi_Company abi_company=new ABi_Company(po.Bukrs);
            CompanyCode = po.Bukrs;
            if (abi_company.ABi_Company_ID == 0)//如果没找到,插入一条
            {
                YB_CompanyCode yb = new YB_CompanyCode(po.Bukrs);
                abi_company.CompanyCode = yb.Companycode;
                abi_company.CompanyName = yb.Name;
                abi_company.SaveABi_Company();//插入一条
                abi_company = new ABi_Company(po.Bukrs);
                this.aBi_Company_ID = abi_company.ABi_Company_ID;
            }
            else//如果找到直接赋值
            {
                this.aBi_Company_ID = abi_company.ABi_Company_ID;
            }
            //查找bai_plant_id
            ABi_Plant abi_plant = new ABi_Plant(po.Werks);
            //如果在abi_plant查不到 则在abi_plant里面加一条数据
            if (abi_plant.ABi_Plant_ID == 0)
            {
                YB_Plant_Masterdata yb_plant = new YB_Plant_Masterdata(po.Werks);
                if (yb_plant.IsNULL() == false)
                {
                    abi_plant = new ABi_Plant();
                    abi_plant.PlantCode = yb_plant.Plant;
                    abi_plant.PlantName = yb_plant.Plant_name;
                    abi_plant.SaveABi_Plant();
                    this.aBi_Plant_ID = new ABi_Plant(po.Werks).ABi_Plant_ID;
                }
                else
                {
                    new ABi_Plant(po.Werks).SaveABi_Plant();
                    this.aBi_Plant_ID = new ABi_Plant(po.Werks).ABi_Plant_ID;
                }
            }
            else
                this.aBi_Plant_ID = abi_plant.ABi_Plant_ID;
            this.pONumber = po.Ebeln;
            this.pOItemNumber = po.Ebelp;
            this.pOCreator = po.Name_text;
            this.pOCreateDate = po.Aedat;
            this.paymentTerm = po.Zterm;
            this.meterialNumber = String.IsNullOrEmpty(po.Matnr) ? "" : long.Parse(po.Matnr).ToString();
            this.meterialName = po.Txz01;
            this.taxCode = po.Mwskz;
            this.isReturn = (!String.IsNullOrEmpty(po.retpo) && po.retpo == "X") ? 1 : 0 ;//退的订单,PO数据库中无该字段
            this.quantity = (isReturn == 0) ? po.Menge : -po.Menge;
            this.quantityUnit = po.Meins;
            this.netPrice = po.Netpr;
            this.pirceUnit = po.Peinh;
            this.currency = po.Waers;
            this.amount = (isReturn == 0) ? po.Netwr : -po.Netwr;
            this.deliveryDate = po.Eindt;
            this.purchaseGroup = po.Ekgrp;
            this.dateCreated =DateTime.Now;
            this.dateModified=DateTime.Now;
            switch (po.Loekz)
            {
                case "001": this.deletion = "0"; break;
                case "002": this.deletion = "0"; break;
                case "003": this.deletion = "1"; break;
            }

            //this.movieType=
            this.deliverCompleted = po.Elikz;
            this.POStatus = po.bsart;
        }
Exemple #3
0
 public bool Update(YB_Miro_IV_Swap yb)
 {
     ABi_Company abi_company = new ABi_Company();
     string company_id = abi_company.GetCompanyCodeByID(yb.Bukrs);
     if (string.IsNullOrEmpty(company_id) == false)
     {
         this.iVNumber = yb.Belnr;
         this.invoiceNumber = yb.Invoice_no;
         this.dueDate = yb.Zfbdt;
         this.IVPostDate = yb.Budat;
         this.aBi_Company_ID = Convert.ToInt32(company_id);
         this.payAmount = yb.Dmbtr;
         string selStr = "update ABi_Invoice set payAmount='" + this.payAmount + "', PaymentStatus='" + yb.Status_i + "',iVNumber='" + iVNumber + "',dueDate='" + dueDate + "',IVPostDate='" + IVPostDate + "' where invoiceNumber='" + invoiceNumber + "' and aBi_Company_ID='" + aBi_Company_ID + "' and PaymentStatus!=4";
         return this.ExecCommand(selStr);
     }
     else
         return false;
 }
Exemple #4
0
 public bool Update(YB_Payment_Report_Swap yb)
 {
     //是否只是更新invocestatus,paymentStatus要不要改
     ABi_Company abi_company = new ABi_Company();
     string company_id = abi_company.GetCompanyCodeByID(yb.Bukrs);
     if (string.IsNullOrEmpty(company_id) == false)//如果系统里面找不到这个company
     {
         //如果原先没IVNuber的话 去IV找出IVNuber赋值进取
         this.invoiceNumber = yb.Invoice_no;//是用yb.Invoice_no还是bukrs 需要确定唯一主建
         this.datePayment = yb.Budat;
         string selStr = "update ABi_Invoice set datePayment='" + datePayment + "',PaymentStatus='" + yb.Status_i + "' where invoiceNumber='" + invoiceNumber + "' and aBi_Company_ID='" + company_id + "'";
         return this.ExecCommand(selStr);
     }
     else
         return false;
 }
 public bool Update(YB_DP_Item_Swap yb)
 {
     ABi_Company abi_company = new ABi_Company();
     string company_id = abi_company.GetCompanyCodeByID(yb.Bukrs);
     if (string.IsNullOrEmpty(company_id) == false)
     {
         this.invoiceNumber = yb.Invoice_no;
         if (String.IsNullOrEmpty(yb.Lifnr) || yb.Lifnr.Trim().Length < 6)
         {
             string selStr = "update ABi_Invoice set PaymentStatus='" + yb.Status_i + "' where invoiceNumber='" + this.invoiceNumber + "' and aBi_Company_ID='" + company_id + "' and PaymentStatus not in('3','4')";
             return this.ExecCommand(selStr);
         }
         else
         {
             String strVC = yb.Lifnr.Trim();
             ABi_Vendor v = new ABi_Vendor(strVC.Substring(strVC.Length - 6));
             string selStr = String.Format(@"update ABi_Invoice set PaymentStatus='{0}' where
                                             InvoiceNumber='{1}' and
                                             ABi_Company_ID='{2}' and
                                             ABi_Vendor_ID='{3}' and
                                             LEFT(InvoiceDate, 4) = '{4}' and  PaymentStatus not in('3','4')",
                                             yb.Status_i, invoiceNumber, company_id, v.ABi_Vendor_ID, yb.Invoice_date.Year); // "update ABi_Invoice set PaymentStatus='" + yb.Status_i + "' where invoiceNumber='" + this.invoiceNumber + "' and aBi_Company_ID='" + company_id + "' and PaymentStatus not in('3','4')";
             return this.ExecCommand(selStr);
         }
     }
     else
         return false;
 }
        public bool Update(YB_Miro_IV_Swap yb)
        {
            ABi_Company abi_company = new ABi_Company();
            string company_id = abi_company.GetCompanyCodeByID(yb.Bukrs);
            if (string.IsNullOrEmpty(company_id) == false)
            {
                this.iVNumber = yb.Belnr;
                this.invoiceNumber = yb.Invoice_no;
                this.dueDate = yb.Zfbdt;
                this.IVPostDate = yb.Budat;
                this.aBi_Company_ID = Convert.ToInt32(company_id);
                this.payAmount = yb.Dmbtr;

                if (String.IsNullOrEmpty(yb.Lifnr) || yb.Lifnr.Trim().Length < 6)
                {
                    string selStr = "update ABi_Invoice set payAmount='" + this.payAmount + "', PaymentStatus='" + yb.Status_i + "',iVNumber='" + iVNumber + "',dueDate='" + dueDate + "',IVPostDate='" + IVPostDate + "' where invoiceNumber='" + invoiceNumber + "' and aBi_Company_ID='" + aBi_Company_ID + "' and PaymentStatus!=4";
                    return this.ExecCommand(selStr);
                }
                else
                {
                    String strVC = yb.Lifnr.Trim();
                    ABi_Vendor v = new ABi_Vendor(strVC.Substring(strVC.Length - 6));
                    string selStr = String.Format(@"update ABi_Invoice set payAmount='{0}', PaymentStatus='{1}', IVNumber={2}, DueDate='{3}', IVPostDate='{4}' where
                                                    InvoiceNumber='{5}' and
                                                    ABi_Company_ID='{6}' and
                                                    ABi_Vendor_ID='{7}' and
                                                    LEFT(InvoiceDate, 4) = '{8}' and  PaymentStatus != 4 ",
                                                    payAmount, yb.Status_i, iVNumber, DueDate, IVPostDate,
                                                   invoiceNumber, company_id, v.ABi_Vendor_ID, yb.Invoice_date.Year); // "update ABi_Invoice set payAmount='" + this.payAmount + "', PaymentStatus='" + yb.Status_i + "',iVNumber='" + iVNumber + "',dueDate='" + dueDate + "',IVPostDate='" + IVPostDate + "' where invoiceNumber='" + invoiceNumber + "' and aBi_Company_ID='" + aBi_Company_ID + "' and PaymentStatus!=4";
                    return this.ExecCommand(selStr);

                }
            }
            else
                return false;
        }
 public bool Update(YB_Payment_Report_Swap yb)
 {
     //是否只是更新invocestatus,paymentStatus要不要改
     ABi_Company abi_company = new ABi_Company();
     string company_id = abi_company.GetCompanyCodeByID(yb.Bukrs);
     if (string.IsNullOrEmpty(company_id) == false)//如果系统里面找不到这个company
     {
         //如果原先没IVNuber的话 去IV找出IVNuber赋值进取
         this.invoiceNumber = yb.Invoice_no;//是用yb.Invoice_no还是bukrs 需要确定唯一主建
         this.datePayment = yb.Budat;
         if (String.IsNullOrEmpty(yb.Lifnr) || yb.Lifnr.Trim().Length < 6)
         {
             string selStr = "update ABi_Invoice set datePayment='" + datePayment + "',PaymentStatus='" + yb.Status_i + "' where invoiceNumber='" + invoiceNumber + "' and aBi_Company_ID='" + company_id + "'";
             return this.ExecCommand(selStr);
         }
         else
         {
             String strVC = yb.Lifnr.Trim();
             ABi_Vendor v = new ABi_Vendor(strVC.Substring(strVC.Length - 6));
             string selStr = String.Format(@"update ABi_Invoice set datePayment='{0}', PaymentStatus='{1}' where
                                             InvoiceNumber='{2}' and
                                             ABi_Company_ID='{3}' and
                                             ABi_Vendor_ID='{4}' and
                                             LEFT(InvoiceDate, 4) = '{5}'",
                                             datePayment, yb.Status_i,
                                             invoiceNumber, company_id, v.ABi_Vendor_ID, yb.Invoice_date.Year); // "update ABi_Invoice set datePayment='" + datePayment + "',PaymentStatus='" + yb.Status_i + "' where invoiceNumber='" + invoiceNumber + "' and aBi_Company_ID='" + company_id + "'";
             return this.ExecCommand(selStr);
         }
     }
     else
         return false;
 }