Ejemplo n.º 1
0
        public static InputDeliveryLineList GetByExpedienteStockList(long oid, bool childs, InputDeliveryInfo albaran)
        {
            QueryConditions conditions = new QueryConditions
            {
                Expedient    = ExpedientInfo.New(oid),
                TipoAcreedor = new ETipoAcreedor[1] {
                    ETipoAcreedor.Proveedor
                }
            };

            InputDeliveryLineList list = GetList(InputDeliveryLineSQL.SELECT_STOCK(conditions, false), childs);

            List <InputDeliveryLineInfo> merge = new List <InputDeliveryLineInfo>();

            foreach (InputDeliveryLineInfo ca in albaran.ConceptoAlbaranes)
            {
                if (ca.OidExpediente == oid)
                {
                    merge.Add(ca);
                }
            }

            foreach (InputDeliveryLineInfo ca in list)
            {
                if (ca.OidAlbaran != albaran.Oid)
                {
                    merge.Add(ca);
                }
            }

            return(InputDeliveryLineList.GetChildList(merge));
        }
        protected void CopyValues(ExpedientInfo source)
        {
            if (source == null)
            {
                return;
            }

            _base.CopyValues(source);

            if (source.Teus20)
            {
                _contenedor_teus20 = source.Contenedor;
            }
            else
            {
                _contenedor_teus40 = source.Contenedor;
            }

            _base.AyudaEstimada  = source.AyudaEstimada;
            _base.AyudaCobrada   = source.AyudaCobrada;
            _base.AyudaPendiente = source.AyudaPendiente;

            _base.StockBultos = source.StockBultos;
            _base.StockKilos  = source.StockKilos;

            _base.KilosTotal      = source.Kilos;
            _base.BultosTotal     = source.Bultos;
            _base.Proveedor       = source.Proveedor;
            _base.Despachante     = source.Despachante;
            _base.NombreTransDest = source.NombreTransDest;
            _base.NombreTransOrig = source.NombreTransOrig;
            _base.Naviera         = source.Naviera;
        }
Ejemplo n.º 3
0
        public static string SELECT_PRODUCT(QueryConditions conditions, ExpedientInfo from, ExpedientInfo till, bool soloStock)
        {
            string query = string.Empty;

            query = Stock.SELECT_MOVEMENTS_PRODUCT(conditions);

            if (from != null)
            {
                query += " AND EX.\"CODIGO\" >='" + from.Codigo + "'";
            }

            if (till != null)
            {
                query += " AND EX.\"CODIGO\" <='" + till.Codigo + "'";
            }

            if (soloStock)
            {
                query += " AND (ST2.\"STOCK_KG\" > 0) AND (ST2.\"STOCK_BULTO\" > 0)";
            }

            query += " ORDER BY ST.\"OID_PRODUCTO\", ST.\"FECHA\", ST.\"OID\"";

            return(query);
        }
        public static WorkReportList GetByExpedientList(long oidExpedient, bool childs)
        {
            QueryConditions conditions = new QueryConditions {
                Expedient = ExpedientInfo.New(oidExpedient)
            };

            return(GetList(SELECT(conditions), childs));
        }
Ejemplo n.º 5
0
        public static string SELECT(ExpedientInfo item)
        {
            string query = SELECT(new QueryConditions {
                Expedient = item
            });

            query += " ORDER BY \"ID_PARTIDA\", ST.\"FECHA\", ST.\"OID\"";
            return(query);
        }
        public static InputDeliveryList GetListByPartidasExpediente(bool childs, long oidExp)
        {
            QueryConditions conditions = new QueryConditions
            {
                Expedient = ExpedientInfo.New(oidExp)
            };

            return(GetList(childs, SELECT(conditions)));
        }
        public static LivestockBookLineList GetByExpedienteList(long oidExpedient, bool childs)
        {
            QueryConditions conditions = new QueryConditions
            {
                Expedient = ExpedientInfo.New(oidExpedient)
            };

            return(GetList(SELECT_BY_EXPEDIENTE(conditions), false));
        }
Ejemplo n.º 8
0
        public static LivestockBooks GetByExpedienteList(long oidExpediente, bool childs)
        {
            QueryConditions conditions = new QueryConditions
            {
                Expedient      = ExpedientInfo.New(oidExpediente),
                TipoExpediente = ETipoExpediente.Ganado
            };

            return(GetList(LivestockBooks.SELECT(conditions), childs));
        }
Ejemplo n.º 9
0
        public static LineaFomentoList GetChildList(ExpedientInfo parent, bool childs)
        {
            CriteriaEx criteria = LineaFomento.GetCriteria(LineaFomento.OpenSession());

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

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

            CloseSession(criteria.SessionCode);
            return(list);
        }
Ejemplo n.º 10
0
        public static ExpedienteREAList GetChildList(ExpedientInfo parent, bool childs)
        {
            CriteriaEx criteria = REAExpedient.GetCriteria(REAExpedient.OpenSession());

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

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

            CloseSession(criteria.SessionCode);
            return(list);
        }
        public static InputInvoiceList GetCostesByExpedienteList(long oid, bool childs)
        {
            QueryConditions conditions = new QueryConditions
            {
                Expedient    = ExpedientInfo.New(oid),
                TipoAcreedor = new ETipoAcreedor[1] {
                    ETipoAcreedor.Proveedor
                },
            };

            return(GetList(InputInvoiceSQL.SELECT_COSTES_EXPEDIENTE(conditions), childs));
        }
Ejemplo n.º 12
0
        public static InputDeliveryLineList GetByExpedienteList(long oid, bool childs)
        {
            QueryConditions conditions = new QueryConditions
            {
                Expedient    = ExpedientInfo.New(oid),
                TipoAcreedor = new ETipoAcreedor[1] {
                    ETipoAcreedor.Proveedor
                }
            };

            return(GetList(InputDeliveryLineSQL.SELECT(conditions, false), childs));
        }
Ejemplo n.º 13
0
        public static PayrollList GetList(QueryConditions conditions, ExpedientInfo ini, ExpedientInfo fin)
        {
            CriteriaEx criteria = Stock.GetCriteria(Payroll.OpenSession());

            criteria.Childs = false;

            criteria.Query = PayrollList.SELECT(conditions, ini, fin);

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

            CloseSession(criteria.SessionCode);
            return(list);
        }
Ejemplo n.º 14
0
        public static PayrollList GetChildList(ExpedientInfo parent, bool childs)
        {
            CriteriaEx criteria = Payroll.GetCriteria(Payroll.OpenSession());

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

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

            CloseSession(criteria.SessionCode);

            return(list);
        }
Ejemplo n.º 15
0
        public static ExpenseList GetList(QueryConditions conditions, ExpedientInfo fromExp, ExpedientInfo tillExp)
        {
            CriteriaEx criteria = Stock.GetCriteria(Expense.OpenSession());

            criteria.Childs = false;

            criteria.Query = ExpenseList.SELECT(conditions, fromExp, tillExp);

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

            CloseSession(criteria.SessionCode);
            return(list);
        }
Ejemplo n.º 16
0
        public static CabezaList GetChildList(ExpedientInfo parent, bool childs)
        {
            CriteriaEx criteria = Cabeza.GetCriteria(Cabeza.OpenSession());

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

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

            list.CloseSession();

            return(list);
        }
Ejemplo n.º 17
0
        public static StockList GetChildList(ExpedientInfo parent, bool childs, bool throwStockException)
        {
            CriteriaEx criteria = Stock.GetCriteria(Stock.OpenSession());

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

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

            list.UpdateStocksByBatch(throwStockException);

            CloseSession(criteria.SessionCode);
            return(list);
        }
        protected void CopyValues(ExpedientInfo source, ExpenseList list
                                  , InputDeliveryLineList conceptos
                                  , InputDeliveryList albaranes)
        {
            if (source == null)
            {
                return;
            }

            Oid        = source.Oid;
            Expediente = source.Codigo;

            foreach (ExpenseInfo item in list)
            {
                if (item.OidExpediente == source.Oid)
                {
                    CheckGasto(item);
                }
            }

            foreach (InputDeliveryLineInfo item in conceptos)
            {
                if (item.OidExpediente == source.Oid)
                {
                    CheckGasto(list, albaranes.GetItem(item.OidAlbaran));
                }
            }

            if (Proveedor != null)
            {
                Proveedor = Proveedor.Substring(0, Proveedor.Length - 1);
            }
            if (Naviera != null)
            {
                Naviera = Naviera.Substring(0, Naviera.Length - 1);
            }
            if (Despachante != null)
            {
                Despachante = Despachante.Substring(0, Despachante.Length - 1);
            }
            if (TransportistaOrigen != null)
            {
                TransportistaOrigen = TransportistaOrigen.Substring(0, TransportistaOrigen.Length - 1);
            }
            if (TransportistaDestino != null)
            {
                TransportistaDestino = TransportistaDestino.Substring(0, TransportistaDestino.Length - 1);
            }
        }
        /// <summary>
        /// Retrieve the complete list from db
        /// </summary>
        /// <param name="get_childs">retrieving the childs</param>
        /// <returns></returns>
        public static InventarioValoradoList GetListStock(ETipoExpediente tipo,
                                                          ExpedientInfo expediente,
                                                          DateTime fecha)
        {
            CriteriaEx criteria = Product.GetCriteria(Product.OpenSession());

            criteria.Childs = false;

            criteria.Query = InventarioValoradoList.SELECT_WITH_STOCK(tipo, expediente, fecha);

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

            CloseSession(criteria.SessionCode);
            return(list);
        }
Ejemplo n.º 20
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);
        }
Ejemplo n.º 21
0
        public static ProductList GetListByExpediente(long oid, bool childs)
        {
            CriteriaEx criteria = Product.GetCriteria(Product.OpenSession());

            criteria.Childs = childs;

            ExpedientInfo item = Expedient.New().GetInfo();

            item.Oid       = oid;
            criteria.Query = ProductList.SELECT(item);

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

            CloseSession(criteria.SessionCode);
            return(list);
        }
        public static LivestockBookLines GetChildListByExpediente(LivestockBook parent, long oidExpediente, bool childs)
        {
            CriteriaEx criteria = Stock.GetCriteria(parent.SessionCode);

            criteria.Childs = childs;

            QueryConditions conditions = new QueryConditions
            {
                LibroGanadero = parent.GetInfo(false),
                Expedient     = ExpedientInfo.New(oidExpediente)
            };

            criteria.Query = LivestockBookLines.SELECT(conditions);

            return(DataPortal.Fetch <LivestockBookLines>(criteria));
        }
Ejemplo n.º 23
0
        public static Batchs GetChildListByExpediente(Almacen parent, long oidExpedient, bool childs)
        {
            CriteriaEx criteria = Stock.GetCriteria(parent.SessionCode);

            criteria.Childs = childs;

            QueryConditions conditions = new QueryConditions
            {
                Almacen   = parent.GetInfo(false),
                Expedient = ExpedientInfo.New(oidExpedient)
            };

            criteria.Query = Batchs.SELECT(conditions);

            return(DataPortal.Fetch <Batchs>(criteria));
        }
        public static WorkReportResourceList GetList(long oidExpedient, ETipoEntidad entityType, bool clustered, bool childs = true)
        {
            QueryConditions conditions = new QueryConditions
            {
                Expedient  = ExpedientInfo.New(oidExpedient),
                EntityType = entityType
            };

            if (clustered)
            {
                conditions.Groups = new GroupList();
                conditions.Groups.NewGroup("OidResource", typeof(WorkReportResource));
                conditions.Groups.NewGroup("EntityType", typeof(WorkReportResource));
            }

            return(GetList(SELECT(conditions), childs));
        }
        public static InputInvoiceList GetListByExpediente(long oid, bool childs)
        {
            CriteriaEx criteria = InputInvoice.GetCriteria(InputInvoice.OpenSession());

            criteria.Childs = childs;

            QueryConditions conditions = new QueryConditions
            {
                Expedient = ExpedientInfo.New(oid)
            };

            criteria.Query = InputInvoiceSQL.SELECT_EXPEDIENTES(conditions);
            InputInvoiceList list = DataPortal.Fetch <InputInvoiceList>(criteria);

            CloseSession(criteria.SessionCode);
            return(list);
        }
        public static WorkReportResourceList GetByCategoryList(long oidCategory, long oidExpedient, bool clustered, bool childs = true)
        {
            QueryConditions conditions = new QueryConditions
            {
                Expedient          = (oidExpedient != 0) ? ExpedientInfo.New(oidExpedient) : null,
                WorkReportCategory = (oidCategory != 0) ? WorkReportCategoryInfo.New(oidCategory) : null,
                Orders             = new OrderList()
            };

            conditions.Orders.NewOrder("CategoryMax", ListSortDirection.Ascending, typeof(WorkReportCategory));

            if (clustered)
            {
                conditions.Groups = new GroupList();
                conditions.Groups.NewGroup("OidCategory", typeof(WorkReportResource));
            }

            return(GetList(SELECT(conditions), childs));
        }
Ejemplo n.º 27
0
        public static StockList GetList(QueryConditions conditions,
                                        ExpedientInfo from,
                                        ExpedientInfo till,
                                        bool soloStock,
                                        bool throwStockException)
        {
            CriteriaEx criteria = Stock.GetCriteria(Stock.OpenSession());

            criteria.Childs = true;

            criteria.Query = StockList.SELECT_BATCH(conditions, from, till, soloStock);

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

            list.UpdateStocksByBatch(throwStockException);

            CloseSession(criteria.SessionCode);
            return(list);
        }
Ejemplo n.º 28
0
        public static string SELECT(QueryConditions conditions, ExpedientInfo ini, ExpedientInfo fin)
        {
            string query = string.Empty;

            query = SELECT(conditions);

            if (ini != null)
            {
                query += " AND EX.\"CODIGO\" >='" + ini.Codigo + "'";
            }

            if (fin != null)
            {
                query += " AND EX.\"CODIGO\" <='" + fin.Codigo + "'";
            }

            query += " ORDER BY EX.\"CODIGO\", GT.\"CODIGO\"";

            return(query);
        }
Ejemplo n.º 29
0
        public static string SELECT_BY_EXPEDIENTE_STOCK(QueryConditions conditions, ExpedientInfo ini, ExpedientInfo fin)
        {
            string query = string.Empty;

            query = SELECT_BY_EXPEDIENTE_STOCK(conditions);

            if (ini != null)
            {
                query += " AND GA.\"CODIGO\" >='" + ini.Codigo + "'";
            }

            if (fin != null)
            {
                query += " AND GA.\"CODIGO\" <='" + fin.Codigo + "'";
            }

            query += " GROUP BY CA.\"OID_ALBARAN\", GA.\"CODIGO\"" +
                     " ORDER BY GA.\"CODIGO\", \"OID\"";

            return(query);
        }
Ejemplo n.º 30
0
        public static Stocks GetListByExpediente(long oidExpedient)
        {
            if (!Stock.CanEditObject())
            {
                throw new System.Security.SecurityException(moleQule.Resources.Messages.USER_NOT_ALLOWED);
            }

            CriteriaEx criteria = Stock.GetCriteria(Stock.OpenSession());

            criteria.Childs = false;

            QueryConditions conditions = new QueryConditions {
                Expedient = ExpedientInfo.New(oidExpedient)
            };

            criteria.Query = Stocks.SELECT(conditions);

            Stock.BeginTransaction(criteria.SessionCode);

            return(DataPortal.Fetch <Stocks>(criteria));
        }