Exemplo n.º 1
0
        public static BindingList<SoCompress> CompressSO(List<Shipment> Shipments)
        {
            Dictionary<string, SoCompress> DictSoCompress = new Dictionary<string, SoCompress>();
            BindingList<SoCompress> SOCompresses = new BindingList<SoCompress>();
            SoCompress SOCompress;
            string Key;

            foreach (Shipment Shipment in Shipments)
            {
                Key = Shipment.SalesOrderNo + Shipment.ItemNo + Shipment.ShipMethod;
                Shipment.Item = Item.Load(Shipment.ItemNo);

                if (DictSoCompress.ContainsKey(Key))
                {
                    SOCompress = DictSoCompress[Key];
                    SOCompress.ShipQty = SOCompress.ShipQty + Shipment.MoveQty;
                }
                else
                {
                    SOCompress = new SoCompress();
                    SOCompress.Shipment = Shipment;
                    SOCompress.ShipMethod = Shipment.ShipMethod;
                    SOCompress.SalesOrderNo = Shipment.SalesOrderNo;
                    if (Shipment.Item != null)
                        SOCompress.BoxQty = Shipment.Item.BoxQty;

                    if (SOCompress.SalesOrderNo == "存仓")
                        SOCompress.BoxQty = 0;

                    SOCompress.ShipQty = Shipment.MoveQty;
                    DictSoCompress.Add(Key, SOCompress);
                }
            }

            foreach (KeyValuePair<string, SoCompress> KVP in DictSoCompress)
            {
                SOCompress = KVP.Value;
                SOCompress.Calc();

                do
                {
                    SoCompress TmpSOCompress = new SoCompress();
                    TmpSOCompress.Shipment = SOCompress.Shipment;
                    TmpSOCompress.Item = TmpSOCompress.Shipment.Item;
                    TmpSOCompress.ShipMethod = TmpSOCompress.Shipment.ShipMethod;
                    TmpSOCompress.SalesOrderNo = TmpSOCompress.Shipment.SalesOrderNo;
                    TmpSOCompress.MaxQty = SOCompress.MaxQty;
                    TmpSOCompress.BoxQty = SOCompress.BoxQty;

                    if (SOCompress.MaxQty > SOCompress.ShipQty)
                    {
                        TmpSOCompress.ShipQty = SOCompress.ShipQty;
                        SOCompress.ShipQty = 0;
                    }
                    else
                    {
                        TmpSOCompress.ShipQty = SOCompress.MaxQty;
                        SOCompress.ShipQty = SOCompress.ShipQty - SOCompress.MaxQty;
                    }

                    TmpSOCompress.Calc();
                    SOCompresses.Add(TmpSOCompress);

                } while (SOCompress.ShipQty > 0);
            }

            return SOCompresses;
        }
Exemplo n.º 2
0
        private void ShipToWH(ref BindingList<SoCompress> SOCompressList, ref double WHQty)
        {
            ProdOrderFinish ProdOrderFinish = new ProdOrderFinish();
            ProdOrderFinish.ItemNo = txtPartNo.Text;
            ProdOrderFinish.ItemName = txtPartName.Text;
            ProdOrderFinish.ItemType = txtPartType.Text;
            ProdOrderFinish.OKQty = WHQty;
            ProdOrderFinish.RefNo = txtJSNo.Text;
            ProdOrderFinish.IOType = WHIOType.Input;
            ProdOrderFinish.Supplier = "FQC";
            ProdOrderFinish.Remark = txtRevision.Text;
            ProdOrderFinish.CreatedBy = Glob.UserName;
            ProdOrderFinish.Save();

            SoCompress SoComp = new SoCompress();
            SoComp.Item = Item.Load(txtPartNo.Text);
            SoComp.ShipMethod = "Air";
            SoComp.SalesOrderNo = "存仓";
            SoComp.BoxQty = 0;
            SoComp.ShipQty = WHQty;
            SoComp.Calc();
            SOCompressList.Add(SoComp);

            WHQty = 0;
        }
Exemplo n.º 3
0
        public void PrintLabel(SoCompress SoCompress)
        {
            Item = SoCompress.Item;

            if (Item != null)
            {
                ItemNo = Item.CustomerItemNo;
                ItemName = Item.ItemName;
                ItemType = Item.ItemType;
                Material = Item.Material;

                if (ItemType == "BandAccessories") // endpiece, springbar, pin , bracelet
                {
                    SourceType = SOURCE_TYPE_BAND;
                }
                else
                {
                    SourceType = SOURCE_TYPE_CASE;
                }
            }

            Revision = SoCompress.Revision;
            SalesOrderNo = SoCompress.SalesOrderNo;
            Inspector = SoCompress.Inspector;
            InspectSpec = SoCompress.InspectSpec;
            InspectStatus = SoCompress.InspectStatus;
            JSNo = SoCompress.JSNo;

            if (SoCompress.Box1 == 0)
                return;

            ShipQty = SoCompress.Box1;
            PrintLabel();

            if (SoCompress.Box2 == 0)
                return;

            ShipQty = SoCompress.Box2;
            PrintLabel();

            if (SoCompress.Box3 == 0)
                return;

            ShipQty = SoCompress.Box3;
            PrintLabel();

            if (SoCompress.Box4 == 0)
                return;

            ShipQty = SoCompress.Box4;
            PrintLabel();

            if (SoCompress.Box5 == 0)
                return;

            ShipQty = SoCompress.Box5;
            PrintLabel();
        }