Example #1
0
        public void SetValues(Expedient parent, InputInvoiceInfo factura, LineaFomento linea)
        {
            LineasFomento lista = GetListByFactura(factura, linea);

            if (lista.Count == 0)
            {
                linea.SetValues(factura);
            }
            else
            {
                decimal total_kilos = linea.Kilos;

                foreach (LineaFomento item in lista)
                {
                    total_kilos += item.Kilos;
                }

                linea.SetValues(factura, (linea.Kilos / total_kilos));

                foreach (LineaFomento item in lista)
                {
                    item.SetValues(factura, (item.Kilos / total_kilos));
                }
            }

            parent.UpdateTotalCostesCompensables();
        }
Example #2
0
        public Expense NewItem(Expedient parent, InputInvoiceInfo fac)
        {
            Expense item = Expense.NewChild(parent, fac);

            this.AddItem(item);
            return(item);
        }
Example #3
0
        public Expense NewItem(Expedient parent, InputInvoiceInfo fac, ECategoriaGasto tipo)
        {
            Expense item = Expense.NewChild(parent, fac, tipo);

            this.AddItem(item);
            return(item);
        }
Example #4
0
 public void EditItem(Expedient parent, InputInvoiceInfo fac, Expense gasto, bool throwStockException)
 {
     if (gasto == null)
     {
         return;
     }
     gasto.CopyFrom(parent, fac, gasto.ECategoriaGasto);
     parent.UpdateGastosPartidas(throwStockException);
 }
Example #5
0
        public Expense NewItem(Expedient parent, InputInvoiceInfo fac, InputInvoiceLineInfo cf, InputDeliveryLineInfo ca)
        {
            Expense item = Expense.NewChild(parent, fac, cf, ca);

            SetNextCode(item);
            this.AddItem(item);
            //parent.UpdateGastos();
            return(item);
        }
        public static InputDeliveryList GetListByFactura(bool childs, long oidInvoice)
        {
            QueryConditions conditions = new QueryConditions
            {
                FacturaRecibida = InputInvoiceInfo.New(oidInvoice)
            };

            return(GetList(childs, SELECT(conditions)));
        }
Example #7
0
        public Expense GetItemByFactura(InputInvoiceInfo source, Expedient expediente)
        {
            foreach (Expense item in this)
            {
                if ((item.OidFactura == source.Oid) && (item.OidExpediente == expediente.Oid))
                {
                    return(item);
                }
            }

            return(null);
        }
Example #8
0
        public void SetValues(InputInvoiceInfo invoice)
        {
            if (Items.Count != 1)
            {
                return;
            }

            foreach (REAExpedient item in this)
            {
                item.CopyFrom(invoice);
            }
        }
Example #9
0
        public static string SELECT(InputInvoiceInfo factura)
        {
            string query;

            QueryConditions conditions = new QueryConditions {
                FacturaRecibida = factura
            };

            query = InputInvoiceLine.SELECT(conditions, false);

            return(query);
        }
Example #10
0
        public void SetValues(Expedient parent, InputInvoiceInfo factura)
        {
            if (Items.Count != 1)
            {
                return;
            }

            LineaFomento item = Items[0];

            item.SetValues(factura);

            parent.UpdateTotalCostesCompensables();
        }
Example #11
0
        public static InputInvoiceLineList GetChildList(InputInvoiceInfo parent, bool childs)
        {
            CriteriaEx criteria = InputInvoiceLine.GetCriteria(InputInvoiceLine.OpenSession());

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

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

            CloseSession(criteria.SessionCode);

            return(list);
        }
Example #12
0
        public QRCodeRpt GetQRCodeReport(InputInvoiceInfo item)
        {
            if (item == null)
            {
                return(null);
            }

            List <InputInvoicePrint> pList = new List <InputInvoicePrint>();

            pList.Add(InputInvoicePrint.New(item, null));

            QRCodeRpt doc = new QRCodeRpt();

            doc.SetDataSource(pList);

            return(doc);
        }
Example #13
0
        public LineasFomento GetListByFactura(InputInvoiceInfo factura, LineaFomento linea)
        {
            LineasFomento lista = LineasFomento.NewChildList();

            foreach (LineaFomento item in this)
            {
                if (item.EEstado == EEstado.Anulado)
                {
                    continue;
                }

                if ((item.Conocimiento == factura.NFactura) && (item.OidNaviera == factura.OidAcreedor) && (item.Oid != linea.Oid))
                {
                    lista.AddItem(item);
                }
            }

            return(lista);
        }
Example #14
0
        public void Remove(Expedient parent, InputInvoiceInfo fac)
        {
            List <Expense> gastos = new List <Expense>();

            foreach (Expense item in this)
            {
                if (item.OidFactura == fac.Oid)
                {
                    gastos.Add(item);
                }
            }

            foreach (Expense item in gastos)
            {
                base.Remove(item);
            }

            parent.UpdateGastosPartidas(true);
        }
Example #15
0
        protected void CopyValues(InputInvoiceInfo factura, IAcreedorInfo acreedor, bool get_QRCode)
        {
            if (factura == null)
            {
                return;
            }

            Oid = factura.Oid;
            _base.CopyValues(factura);
            if (acreedor != null)
            {
                _telefonos = acreedor.Telefono;
            }

            if (get_QRCode)
            {
                _qr_code_print.LoadQRCode(_qr_code_print.Encode(QREncodeVersion.v1, moleQule.Common.Structs.ETipoEntidad.FacturaRecibida, this), QRCodeVersion.v8);
            }
        }
Example #16
0
        public List <Expense> GetSubList(InputInvoiceInfo factura)
        {
            List <Expense> list = new List <Expense>();

            if (factura == null)
            {
                return(list);
            }

            foreach (Expense item in this)
            {
                if (item.OidFactura == factura.Oid)
                {
                    list.Add(item);
                }
            }

            return(list);
        }
Example #17
0
        protected void CopyValues(InputInvoiceInfo factura, ExpedientInfo expediente, PaymentSummary resumen)
        {
            if (factura == null)
            {
                return;
            }

            _base.Record.NFactura = factura.NFactura;
            _fecha_fac            = factura.Fecha;
            _fecha_prev           = factura.Prevision;
            _base._fecha_pago     = factura.FechaPagoFactura;
            _base._id_pago        = factura.IDPago;
            _base.Record.Total    = factura.Total;
            _base.Pagado          = factura.Pagado;
            _base.Pendiente       = factura.Pendiente;
            _detalles             = factura.CuentaBancaria;
            _nombre_elemento      = factura.Acreedor;
            _tipo_elemento        = moleQule.Common.Structs.EnumText <ETipoAcreedor> .GetLabel(factura.ETipoAcreedor);

            _base._efectos_negociados     = factura.PendienteVencimiento;
            _base._efectos_devueltos      = factura.Vencido;
            _base._efectos_pendientes_vto = factura.EfectosPendientesVto;

            if (expediente != null)
            {
                _contenedor       = expediente.Contenedor;
                _base._expediente = expediente.Codigo;
            }
            else
            {
                _contenedor       = "---";
                _base._expediente = "No Asignado";
            }

            if (resumen != null)
            {
                _total_estimado = resumen.TotalEstimado;
            }
        }
Example #18
0
        protected void CopyValues(TransactionPaymentInfo source, InputInvoiceInfo factura)
        {
            if (source == null)
            {
                return;
            }

            Oid = source.Oid;

            _base.CopyValues(source);

            if (factura != null)
            {
                _pagado     = factura.Pagado;
                _pendiente  = factura.Pendiente;
                _prevision  = factura.Prevision;
                _fecha_pago = factura.FechaPagoFactura;
                if (_base.NExpediente == string.Empty && factura.Expediente != string.Empty)
                {
                    _base.NExpediente = factura.Expediente;
                }
            }
        }
Example #19
0
        public ReportClass GetDetailReport(InputInvoiceInfo item, FormatConfFacturaAlbaranReport conf)
        {
            if (item == null)
            {
                return(null);
            }

            List <InputInvoiceLinePrint> conceptos = new List <InputInvoiceLinePrint>();
            List <InputInvoicePrint>     pList     = new List <InputInvoicePrint>();

            foreach (InputInvoiceLineInfo cfi in item.Conceptos)
            {
                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 (InputInvoiceLinePrint cfp in conceptos)
            {
                if (cfp.OidProducto == 0)
                {
                    continue;
                }
                ProductInfo prod = productos.GetItem(cfp.OidProducto);
                if (prod != null)
                {
                    if (prod.AyudaKilo > 0)
                    {
                        cfp.Concepto += " *";
                    }
                }
            }

            List <ImpuestoResumen> irpf_list = new List <ImpuestoResumen>();

            foreach (DictionaryEntry irpf in item.GetIRPF())
            {
                irpf_list.Add((ImpuestoResumen)irpf.Value);
            }

            ReportClass doc = null;

            try
            {
                doc = GetReportFromName("Invoice", "InputInvoiceRpt");
            }
            catch
            {
                doc = new InputInvoiceRpt();
            }

            doc.Subreports["LinesSubRpt"].SetDataSource(conceptos);
            if (doc.Subreports["IRPFSubListRpt"] != null)
            {
                doc.Subreports["IRPFSubListRpt"].SetDataSource(irpf_list);
            }

            doc.SetDataSource(pList);
            CompanyInfo company = CompanyInfo.Get(Schema.Oid, false);

            doc.SetParameterValue("nombreEmpresa", company.Name);
            doc.SetParameterValue("dirEmpresa", company.Direccion);
            doc.SetParameterValue("dir2Empresa", company.CodPostal + ". " + company.Municipio + ". " + company.Provincia);
            doc.SetParameterValue("CIFEmpresa", company.VatNumber);
            doc.SetParameterValue("nota", conf.nota);
            doc.SetParameterValue("copia", (conf.copia != null) ? conf.copia : string.Empty);
            doc.SetParameterValue("cuentaBancaria", (conf.cuenta_bancaria != string.Empty) ? conf.cuenta_bancaria : company.CuentaBancaria);

            return(doc);
        }
        /// <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;
        }
 internal virtual void CopyFrom(InputInvoiceInfo source)
 {
     Fecha = (source != null) ? source.Fecha : DateTime.MinValue;
 }
Example #22
0
 public Expense GetItemByFactura(InputInvoiceInfo source)
 {
     return(GetItemByFactura(source.Oid, source.ETipoAcreedor));
 }
Example #23
0
        public void EditItem(Expedient parent, InputInvoiceInfo fac, bool throwStockException)
        {
            Expense gasto = GetItemByFactura(fac);

            EditItem(parent, fac, gasto, throwStockException);
        }
Example #24
0
 public static string SELECT(InputInvoiceInfo item)
 {
     return(SELECT(new Library.Store.QueryConditions {
         FacturaRecibida = item
     }));
 }