Ejemplo n.º 1
0
        private bool GetEquivalentItem(clsScSalesHistory proBase, int productEquiID)
        {
            string sql = "SELECT [ScSalesHistoryID],[ScenarioID],[SeasonID],[CollectionID],SH.[ProductID],SH.[ProductColorID],[ProductDimID]," +
                         "[ProductCatID],[SizeOrder],SH.[ColorID],[DimID],[CatID],[ProductGroupID],[ProductSubGroupID],[CollectionName],[CollectionCode]," +
                         "[ProductCode],[ShortProductCode],[ProductDesc_eng],[GroupName],[SubGroupName],[ColorCode],[ColorName_eng],[DimCode],[SizeDesc]," +
                         "[CatCode],[ProductStatusDesc],[ProductColorStatusDesc],[BarcodeSKU],[QtyVI1],[QtyCI1a],[QtyCI1b],[QtyCI1ToInvoice],[QtyVOOpen1]," +
                         "[QtyCO1],[QtyVI2],[QtyCI2a],[QtyCI2b],[QtyCI2ToInvoice],[QtyVOOpen2],[QtyCO2],[QtyStock],[QtyStock2],[QtyPick],[QtyPack]," +
                         "[DefEstPrice],[DefFOBPrice],[SalesPrice],[RetailPrice],[AmountCI1],[AmountCI2],[QtyInvBF],[QtyInvAF],[QtyAchat],[VOStatus] " +
                         "FROM [sxUnimageDevGI].[dbo].[tblGIScSalesHistory] AS SH " +
                         "INNER JOIN [sxUnimageDevGI].[dbo].[tblGIProduct] AS GIP " +
                         "ON GIP.ProductColorID=SH.ProductColorID " +
                         "WHERE[GIProductID]= " + productEquiID + " " +
                         "AND [CatCode]= '" + proBase.CatCode + "' " +
                         "AND [ScenarioID]= " + clsGlobals.GIPar.ScenarioID + " " +
                         "AND [DimID]= " + proBase.DimID + " " +
                         "AND [SizeDesc]= '" + proBase.SizeDesc + "'";
            //Conexion.StartSession();
            DataTable myTb = Conexion.GDatos.GetDataTableSql(sql);

            Conexion.EndSession();
            if (myTb.Rows.Count > 0)
            {
                this.CopyDataRow(myTb.Rows[0]);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        internal void CalculateStatisticsBooking(clsScSalesHistory ele, int v)
        {
            clsGIParameter myPa = new clsGIParameter();

            //General parameters
            myPa = clsGlobals.GIPar;

            //Product Information
            ProductID         = ele.ProductID;
            ProductColorID    = ele.ProductColorID;
            ProductDimID      = ele.ProductDimID;
            ProductCatID      = ele.ProductCatID;
            SizeOrder         = ele.SizeOrder;
            ColorID           = ele.ColorID;
            DimID             = ele.DimID;
            CatID             = ele.CatID;
            ProductGroupID    = ele.ProductGroupID;
            ProductSubGroupID = ele.ProductSubGroupID;
            this.Dim          = ele.DimCode;
            this.Size         = ele.SizeDesc;
            this.RP1          = ele.QtyVI1;
            this.VP1          = ele.QtyCI1a + ele.QtyCI1ToInvoice;
            this.RP2          = ele.QtyVI2;
            this.VP2          = ele.QtyCI2a + ele.QtyCI2ToInvoice;
            this.ACH          = ele.QtyVOOpen1 + ele.QtyVOOpen2;
            this.CMD          = ele.QtyCO1 + ele.QtyCO2;
            this.VTOT         = ele.QtyCI2a + ele.QtyCI2ToInvoice + ele.QtyCO2;
            this.CSS          = ele.QtyCO2 - ele.QtyPack;
            this.Var          = this.VTOT - this.VP1;
            this.VTEM         = (this.VTOT + this.VP1) / 2;
            if (v == 1)
            {
                this.IBF = ele.GetInvBF();
                this.IAF = ele.GetInvAF();
            }
            if (v == 2)
            {
                this.IBF = ele.GetInvBF();
                this.IAF = 0;
            }
            if (v == 3)
            {
                this.IBF = 0;
                this.IAF = ele.GetInvAF();
            }
            if (v == 4)
            {
                this.IBF = 0;
                this.IAF = 0;
            }
            this.IC = ele.QtyStock;

            //Calcul des besoins.
            Besoin = Math.Floor(((ele.QtyCO1 + ele.QtyCI2a + ele.QtyCI2ToInvoice + ele.QtyCO2) * (1 + clsGlobals.ActiveRatio / 100))
                                - ele.QtyVOOpen1 - ele.QtyCI2a - ele.QtyCI2ToInvoice - ele.QtyVOOpen2 - ele.QtyStock);
            this.QVO = ele.QtyAchat;

            //compras + IC - cmd
            this.Available = this.ACH + this.IC - this.CMD;
        }
Ejemplo n.º 3
0
        internal void UpdateOneItems(int productEquiID)
        {
            clsScSalesHistory myItemEqui = new clsScSalesHistory();

            if (myItemEqui.GetEquivalentItem(this, productEquiID))
            {
                this.QtyVI1          = myItemEqui.QtyVI1;
                this.QtyCI1a         = myItemEqui.QtyCI1a;
                this.QtyCI1b         = myItemEqui.QtyCI1b;
                this.QtyCI1ToInvoice = myItemEqui.QtyCI1ToInvoice;
                this.QtyVOOpen1      = myItemEqui.QtyVOOpen1;
                this.QtyCO1          = myItemEqui.QtyCO1;

                this.UpdateQuantities();
            }
        }
Ejemplo n.º 4
0
 public clsProductAvailableOS(clsScSalesHistory ele, double available)
 {
     this.CatID             = ele.CatID;
     this.CollectionID      = ele.CollectionID;
     this.ColorID           = ele.ColorID;
     this.DimID             = ele.DimID;
     this.ProductCatID      = ele.ProductCatID;
     this.ProductColorID    = ele.ProductColorID;
     this.ProductDimID      = ele.ProductDimID;
     this.ProductGroupID    = ele.ProductGroupID;
     this.ProductID         = ele.ProductID;
     this.ProductSubGroupID = ele.ProductSubGroupID;
     this.ScenarioID        = clsGlobals.GIPar.ScenarioID;
     this.SizeOrder         = ele.SizeOrder;
     this.SizeDesc          = ele.SizeDesc;
     this.QtyAvailable      = available;
 }