private void CheckGasto(ExpenseList gastos, InputDeliveryInfo albaran)
        {
            foreach (ExpenseInfo info in gastos)
            {
                if (info.OidFactura == albaran.OidFactura)
                {
                    return;
                }
            }

            switch (albaran.ETipoAcreedor)
            {
            case ETipoAcreedor.Proveedor:
                Proveedor += albaran.Codigo + " - " + albaran.NombreAcreedor + "\n";
                break;

            case ETipoAcreedor.Naviera:
                Naviera += albaran.Codigo + " - " + albaran.NombreAcreedor + "\n";
                break;

            case ETipoAcreedor.Despachante:
                Despachante += albaran.Codigo + " - " + albaran.NombreAcreedor + "\n";
                break;

            case ETipoAcreedor.TransportistaOrigen:
                TransportistaOrigen += albaran.Codigo + " - " + albaran.NombreAcreedor + "\n";
                break;

            case ETipoAcreedor.TransportistaDestino:
                TransportistaDestino += albaran.Codigo + " - " + albaran.NombreAcreedor + "\n";
                break;
            }
        }
        public static string SELECT(InputDeliveryInfo item)
        {
            string query = SELECT(new QueryConditions {
                InputDelivery = item
            });

            query += " ORDER BY ST.\"OID_BATCH\", ST.\"OID\"";
            return(query);
        }
Exemple #3
0
        public static InputDeliveryLineList GetByAlbaranList(long oid, bool childs)
        {
            QueryConditions conditions = new QueryConditions
            {
                InputDelivery = InputDeliveryInfo.New(oid)
            };

            return(GetList(InputDeliveryLineSQL.SELECT(conditions, false), childs));
        }
        public AlbaranRecibidoRpt GetDetailRpt(InputDeliveryInfo item, FormatConfFacturaAlbaranReport conf)
        {
            if (item == null)
            {
                return(null);
            }

            AlbaranRecibidoRpt doc = new AlbaranRecibidoRpt();

            List <InputDeliveryLinePrint> conceptos = new List <InputDeliveryLinePrint>();
            List <InputDeliveryPrint>     pList     = new List <InputDeliveryPrint>();

            foreach (InputDeliveryLineInfo cfi in item.ConceptoAlbaranes)
            {
                conceptos.Add(cfi.GetPrintObject());
            }

            //Si no existen conceptos, no tiene sentido un informe detallado. Además, falla en Crystal Reports
            if (conceptos.Count <= 0)
            {
                return(null);
            }

            pList.Add(item.GetPrintObject());

            ProductList productos = ProductList.GetList(false);

            foreach (InputDeliveryLinePrint cfp in conceptos)
            {
                if (cfp.OidProducto == 0)
                {
                    continue;
                }
                ProductInfo prod = productos.GetItem(cfp.OidProducto);
                if (prod != null)
                {
                    if (prod.AyudaKilo > 0)
                    {
                        cfp.Concepto += " *";
                    }
                }
            }

            doc.Subreports["ConceptosRpt"].SetDataSource(conceptos);

            doc.SetDataSource(pList);
            CompanyInfo empresa = CompanyInfo.Get(Schema.Oid);

            doc.SetParameterValue("nombreEmpresa", empresa.Name);
            doc.SetParameterValue("dirEmpresa", empresa.Direccion);
            doc.SetParameterValue("CIFEmpresa", empresa.VatNumber);
            doc.SetParameterValue("nota", (conf.nota != null) ? conf.nota : string.Empty);

            return(doc);
        }
Exemple #5
0
        public static string SELECT(InputDeliveryInfo delivery)
        {
            string query;

            QueryConditions conditions = new QueryConditions {
                InputDelivery = delivery
            };

            query = InputDeliveryLineSQL.SELECT(conditions, false);

            return(query);
        }
        public void Remove(InputInvoice factura, InputDeliveryInfo AlbaranProveedor)
        {
            foreach (AlbaranFacturaProveedor item in this)
            {
                if (item.OidFactura == factura.Oid && item.OidAlbaran == AlbaranProveedor.Oid)
                {
                    this.Remove(item);
                    break;
                }
            }

            factura.SetAlbaranes();
        }
Exemple #7
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);
        }
        public static Batchs GetChildListByAlbaranRecibido(Almacen parent, long oidDelivery, bool childs)
        {
            CriteriaEx criteria = Stock.GetCriteria(parent.SessionCode);

            criteria.Childs = childs;

            QueryConditions conditions = new QueryConditions
            {
                Almacen       = parent.GetInfo(false),
                InputDelivery = InputDeliveryInfo.New(oidDelivery)
            };

            criteria.Query = Batchs.SELECT(conditions);

            return(DataPortal.Fetch <Batchs>(criteria));
        }
Exemple #9
0
        public InputInvoice NewItem(InputDeliveryInfo albaran)
        {
            InputInvoice item = NewItem();

            ProviderBaseInfo acreedor = ProviderBaseInfo.Get(albaran.OidAcreedor, albaran.ETipoAcreedor, true);

            item.CopyFrom(acreedor);
            item.CopyFrom(albaran);
            item.Insert(albaran);
            item.Fecha    = albaran.Fecha;
            item.NFactura = "SIN NUMERO";

            SetNextCode(item);

            return(item);
        }
Exemple #10
0
        public static AlbaranFacturaProveedor NewChild(InputInvoice factura, InputDeliveryInfo albaran)
        {
            if (!CanAddObject())
            {
                throw new System.Security.SecurityException(
                          moleQule.Resources.Messages.USER_NOT_ALLOWED);
            }

            AlbaranFacturaProveedor obj = new AlbaranFacturaProveedor();

            obj.OidFactura      = factura.Oid;
            obj.OidAlbaran      = albaran.Oid;
            obj.CodigoFactura   = factura.Codigo;
            obj.CodigoAlbaran   = albaran.Codigo;
            obj.FechaAsignacion = DateTime.Today;

            return(obj);
        }
        /// <summary>
        /// Copia los atributos del objeto
        /// </summary>
        /// <param name="source">Objeto origen</param>
        protected void CopyValues(AlbaranFacturaProveedorInfo source, IAcreedorInfo acreedor, InputInvoiceInfo factura, InputDeliveryInfo albaran)
        {
            if (source == null)
            {
                return;
            }

            Oid = source.Oid;
            _base.Record.OidAlbaran = source.OidAlbaran;
            _base.Record.OidFactura = source.OidFactura;

            SerieInfo serie = SerieInfo.Get(factura.OidSerie, false);

            _base.CodigoFactura = factura.Codigo;
            _total_factura      = factura.Total;
            _numero_serie       = serie.Identificador;
            _fecha_factura      = factura.Fecha;
            _prevision          = factura.Prevision;

            //INNER JOIN
            _codigo_cliente = acreedor.Codigo;
            _nombre         = acreedor.Nombre;
            _telefonos      = acreedor.Telefono;
            _dias_pago      = albaran.Fecha.Subtract(factura.Fecha).Days;
        }
 public AlbaranFacturaProveedor NewItem(InputInvoice factura, InputDeliveryInfo AlbaranProveedor)
 {
     this.AddItem(AlbaranFacturaProveedor.NewChild(factura, AlbaranProveedor));
     factura.SetAlbaranes();
     return(this[Count - 1]);
 }
Exemple #13
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));
        }