/// <summary>
        /// Builds a AlbaranProveedorList from IList<!--<AlbaranProveedor>--> and retrieve AlbaranProveedorInfo Childs from DB
        /// </summary>
        /// <param name="list"></param>
        /// <returns>AlbaranProveedorList</returns>
        public static InputDeliveryList GetChildList(IList <InputDelivery> list)
        {
            InputDeliveryList flist = new InputDeliveryList();

            if (list != null)
            {
                int        sessionCode = InputDelivery.OpenSession();
                CriteriaEx criteria    = null;

                flist.IsReadOnly = false;

                foreach (InputDelivery item in list)
                {
                    criteria = InputDeliveryLine.GetCriteria(sessionCode);
                    criteria.AddEq("OidAlbaran", item.Oid);
                    item.Conceptos = InputDeliveryLines.GetChildList(criteria.List <InputDeliveryLine>());

                    flist.AddItem(item.GetInfo());
                }

                flist.IsReadOnly = true;

                InputDelivery.CloseSession(sessionCode);
            }

            return(flist);
        }
Exemplo n.º 2
0
        protected override void UpdateDeliveryAction()
        {
            InputDeliveryLine item     = Lines_BS.Current as InputDeliveryLine;
            ProductInfo       producto = ProductInfo.Get(item.OidProducto, false, true);

            _entity.CalculateTotal();

            ControlsMng.UpdateBinding(Lines_BS);
        }
Exemplo n.º 3
0
        public static string SELECT(InputDeliveryLine item)
        {
            string query = SELECT(new QueryConditions {
                ConceptoAlbaranProveedor = item.GetInfo()
            });

            query += " ORDER BY ST.\"OID_BATCH\", ST.\"OID\"";
            return(query);
        }
Exemplo n.º 4
0
        /// Constructor
        /// </summary>
        public InputDeliveryLineUIForm(InputDeliveryLine line, InputDelivery delivery, SerieInfo serie, IAcreedorInfo provider, Form parent)
            : base(true, parent)
        {
            InitializeComponent();

            _entity   = line;
            _delivery = delivery;
            _serie    = serie;
            _provider = provider;
        }
Exemplo n.º 5
0
        protected override void RefreshMainData()
        {
            _entity            = InputDeliveryLine.NewChild(_delivery);
            _entity.PImpuestos = _serie.PImpuesto;
            PgMng.Grow();

            Datos.DataSource = _entity;
            PgMng.Grow();

            base.RefreshMainData();
        }
Exemplo n.º 6
0
        private static InputDeliveryLineList GetList(string query, bool childs)
        {
            CriteriaEx criteria = InputDeliveryLine.GetCriteria(InputDeliveryLine.OpenSession());

            criteria.Childs = childs;

            criteria.Query = query;
            InputDeliveryLineList list = DataPortal.Fetch <InputDeliveryLineList>(criteria);

            CloseSession(criteria.SessionCode);
            return(list);
        }
Exemplo n.º 7
0
        public static ExpenseList GetByConceptoAlbaranList(long oidLine, bool childs)
        {
            QueryConditions conditions = new QueryConditions
            {
                ConceptoAlbaranProveedor = InputDeliveryLine.NewChild().GetInfo(),
                CategoriaGasto           = ECategoriaGasto.Expediente
            };

            conditions.ConceptoAlbaranProveedor.Oid = oidLine;

            return(GetList(conditions, childs));
        }
Exemplo n.º 8
0
        public static InputDeliveryLineList GetChildList(InputDeliveryInfo parent, bool childs)
        {
            CriteriaEx criteria = InputDeliveryLine.GetCriteria(InputDeliveryLine.OpenSession());

            criteria.Query  = InputDeliveryLineList.SELECT(parent);
            criteria.Childs = childs;

            InputDeliveryLineList list = DataPortal.Fetch <InputDeliveryLineList>(criteria);

            CloseSession(criteria.SessionCode);

            return(list);
        }
Exemplo n.º 9
0
        protected void AddCacheItem(InputDeliveryLine item)
        {
            if (item == null)
            {
                return;
            }

            _oidAlmacenes.Add(item.OidAlmacen);
            _oidExpedientes.Add(item.OidExpediente);
            _oidPartidas.Add(item.OidPartida);
            _oidProductos.Add(item.OidProducto);
            _oidPedidos.Add(item.OidPedido);
        }
Exemplo n.º 10
0
        public static InputDeliveryLineList GetByExpedienteStockList(QueryConditions conditions
                                                                     , ExpedientInfo ini
                                                                     , ExpedientInfo fin)
        {
            CriteriaEx criteria = InputDeliveryLine.GetCriteria(InputDeliveryLine.OpenSession());

            criteria.Childs = false;

            criteria.Query = InputDeliveryLineList.SELECT_BY_EXPEDIENTE_STOCK(conditions, ini, fin);

            InputDeliveryLineList list = DataPortal.Fetch <InputDeliveryLineList>(criteria);

            CloseSession(criteria.SessionCode);
            return(list);
        }
Exemplo n.º 11
0
        internal void CopyValues(InputDeliveryLine source)
        {
            if (source == null)
            {
                return;
            }

            _record.CopyValues(source._base.Record);

            _store      = source.Almacen;
            _store_id   = source.IDAlmacen;
            _expediente = source.Expediente;
            _ayuda_kilo = source.AyudaKilo;
            _oid_stock  = source.OidStock;
            _oid_pedido = source.OidPedido;
            _id_batch   = source.IDBatch;
        }
Exemplo n.º 12
0
        protected override void SelectLineTaxAction()
        {
            if (Lines_BS.Current == null)
            {
                return;
            }

            InputDeliveryLine item = Lines_BS.Current as InputDeliveryLine;

            ImpuestoSelectForm form = new ImpuestoSelectForm(this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ImpuestoInfo source = (ImpuestoInfo)form.Selected;

                item.OidImpuesto = source.Oid;
                item.PImpuestos  = source.Porcentaje;
            }
        }
Exemplo n.º 13
0
        protected override void EditLineAction()
        {
            if (Lines_BS.Current == null)
            {
                return;
            }

            InputDeliveryLine cf = (InputDeliveryLine)Lines_BS.Current;

            _provider = Providers_BS.Current as ProviderBaseInfo;

            InputDeliveryLineEditForm form = null;

            form = new InputDeliveryLineEditForm(_entity, _serie, _provider, cf, this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                _entity.CalculateTotal();
            }
        }
Exemplo n.º 14
0
        protected override void SelectLineExpedientAction()
        {
            if (Lines_BS.Current == null)
            {
                return;
            }

            InputDeliveryLine item = Lines_BS.Current as InputDeliveryLine;

            ExpedienteSelectForm form = new ExpedienteSelectForm(this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ExpedientInfo source = (ExpedientInfo)form.Selected;

                item.OidExpediente = source.Oid;
                item.Expediente    = source.Codigo;

                AddCacheItem(source);
            }
        }
Exemplo n.º 15
0
        protected override void SelectLineStoreAction()
        {
            if (Lines_BS.Current == null)
            {
                return;
            }

            InputDeliveryLine item = Lines_BS.Current as InputDeliveryLine;

            AlmacenSelectForm form = new AlmacenSelectForm(this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                StoreInfo source = (StoreInfo)form.Selected;

                item.OidAlmacen = source.Oid;
                item.Almacen    = source.Nombre;

                AddCacheItem(source);
            }
        }
Exemplo n.º 16
0
        public Batch NewItem(Almacen parent, Expedient expedient, InputDelivery delivery, InputDeliveryLine source)
        {
            Batch item = Batch.NewChild(parent, expedient, delivery, source);

            this.AddItem(item);
            if (MaxSerial == 0)
            {
                ResetMaxSerial(item.OidProducto, delivery.Fecha.Year);
            }
            SetNextCode(item);
            item.FechaCompra = item.FechaCompra.AddSeconds(item.Serial);

            //Entrada de stock asociada a la partida
            Stock stock = parent.Stocks.NewItem(this[Count - 1], ETipoStock.Compra);

            stock.Inicial            = true;
            stock.Kilos              = source.CantidadKilos;
            stock.Bultos             = source.CantidadBultos;
            stock.OidKit             = source.OidKit;
            stock.OidAlbaran         = delivery.Oid;
            stock.OidConceptoAlbaran = source.Oid;
            stock.OidLineaPedido     = source.OidLineaPedido;
            stock.OidExpediente      = source.OidExpediente;
            stock.Fecha              = delivery.Fecha;
            stock.Observaciones      = String.Format(Resources.Messages.ENTRADA_POR_ALBARAN, delivery.Codigo);

            if (expedient != null)
            {
                switch (expedient.ETipoExpediente)
                {
                //Cabeza de ganado para expedientes de Ganado
                case ETipoExpediente.Ganado:
                    item.KilosIniciales  = 1;
                    item.BultosIniciales = 1;
                    //Cabeza cabeza = expediente.Cabezas.NewItem(expediente);
                    //cabeza.CopyFrom(item);
                    //cabeza.Observaciones = source.Concepto;
                    break;

                //Maquina para expedientes de Maquinaria
                case ETipoExpediente.Maquinaria:
                    item.KilosIniciales  = 1;
                    item.BultosIniciales = 1;
                    Maquinaria maquina = expedient.Maquinarias.NewItem(expedient);
                    maquina.CopyFrom(this[Count - 1]);
                    maquina.Observaciones = source.Concepto;
                    item.Machine          = maquina;
                    break;
                }

                expedient.TipoMercancia = item.Producto;
            }

            return(item);
        }
 public InputDeliveryLineEditForm(InputDelivery delivery, SerieInfo serie, IAcreedorInfo provider, InputDeliveryLine line, Form parent)
     : base(line, delivery, serie, provider, parent)
 {
     InitializeComponent();
     SetFormData();
 }