示例#1
0
        private void Acta_Load(object sender, EventArgs e)
        {
            ReportParameter[] parametros = new ReportParameter[14];

            parametros[0]  = new ReportParameter("ID", asignacion.id.ToString());
            parametros[1]  = new ReportParameter("CODINV", asignacion.codigo.ToString());
            parametros[2]  = new ReportParameter("EMP_CEDULA", asignacion.documento);
            parametros[3]  = new ReportParameter("EMP_NOMBRES", asignacion.nombreCompleto);
            parametros[4]  = new ReportParameter("FECHA", asignacion.fecha);
            parametros[5]  = new ReportParameter("USU_NOMBRE", asignacion.usuarioNombres);
            parametros[6]  = new ReportParameter("USU_DOCUMENTO", asignacion.usuarioDocumento);
            parametros[7]  = new ReportParameter("OBSERVACION", asignacion.observacion);
            parametros[8]  = new ReportParameter("MOUSE", asignacion.asiMouse == true ? "X" : "");
            parametros[9]  = new ReportParameter("TECLADO", asignacion.asiTeclado == true ? "X" : "");
            parametros[10] = new ReportParameter("BASE", asignacion.asiBase == true ? "X" : "");
            parametros[11] = new ReportParameter("MORRAL", asignacion.asiMorral == true ? "X" : "");
            parametros[12] = new ReportParameter("CORREO", asignacion.asiCorreo == true ? "X" : "");
            parametros[13] = new ReportParameter("PUESTO", asignacion.asiPuesto == true ? "X" : "");

            ReporteDevolucion.LocalReport.SetParameters(parametros);


            ReportDataSource Sourse = new ReportDataSource();

            Sourse.Name  = "EQUIPOS";
            Sourse.Value = asignaciones.CargarDevolucionDetalle(asignacion.id);
            ReporteDevolucion.LocalReport.DataSources.Add(Sourse);


            ReporteDevolucion.RefreshReport();
            ReporteDevolucion.SetDisplayMode(DisplayMode.PrintLayout);
        }
示例#2
0
 public static ReporteDevolucion generar_reporte(int tienda_id, ICollection <objeto_devolucion> articulos, DateTime Fecha)
 {
     using (var db = new TiendaDbContext())
     {
         var reporte = new ReporteDevolucion
         {
             Fecha     = Fecha,
             Articulos = new List <ArticuloDevolucion>(),
             ShopId    = tienda_id,
         };
         foreach (var art in articulos)
         {
             reporte.Articulos.Add(art.generar_articulo());
         }
         db.ReporteDevoluciones.Add(reporte);
         db.SaveChanges();
         return(reporte);
     }
 }
示例#3
0
 public static InformeLiquidacion genera_informe(int tienda_id, ReporteDeuda deuda, ReporteDevolucion devolucion, ReporteVenta venta, DateTime Fecha)
 {
     using (var db = new TiendaDbContext())
     {
         var informe = new InformeLiquidacion
         {
             Fecha               = Fecha,
             ShopId              = tienda_id,
             ReporteDeudaId      = deuda.ReporteDeudaId,
             ReporteDevolucionId = devolucion.ReporteDevolucionId,
             ReporteVentaId      = venta.ReporteVentaId
         };
         db.InformeLiquidaciones.Add(informe);
         db.SaveChanges();
         return(informe);
     }
 }
        public void PopulateValueCrystalReportI()
        {
            if (Session[_nombreSession] == null)
            {
                //**crear nota de credito la copia
                string  nc_id = Returns_Hdr.ejecuta_duplica_nc(_user._bas_id, Convert.ToDecimal(_noReturn));
                DataSet ds_nc = Returns_Hdr.getRetunrHdr(nc_id);

                // Cosultar la cabecera de la factura
                DataTable dtReturnHdr = new DataTable();

                if (string.IsNullOrEmpty(_status))
                {
                    //dtReturnHdr = Returns_Hdr.getRetunrHdr(_user._usv_co, _noReturn);
                    dtReturnHdr = ds_nc.Tables[0].Copy();
                }
                else if (_status.Equals(Constants.StatusReturnForAprob))
                {
                    dtReturnHdr = Returns_Hdr.getRetunrHdrDea(_user._usv_co, _noReturn);
                }

                if (dtReturnHdr.Rows.Count > 0)
                {
                    /// Crear el array list con el cual se le va a pasar toda la informacion al archivo de crystal
                    articlesReturnedValues = new ArrayList();

                    //
                    string idCoordinador = Convert.ToString(dtReturnHdr.Rows[0]["Not_BasId"]);
                    //
                    string coordEmail = Convert.ToString(dtReturnHdr.Rows[0]["Bas_Correo"]);
                    //
                    string nameCoord = Convert.ToString(dtReturnHdr.Rows[0]["nombres"]);
                    //
                    string coordDocument = Convert.ToString(dtReturnHdr.Rows[0]["Documento"]);
                    //
                    string coordAdress = Convert.ToString(dtReturnHdr.Rows[0]["Bas_Direccion"]);
                    //
                    string coordPhone = Convert.ToString(dtReturnHdr.Rows[0]["Bas_Telefono"]);
                    //
                    string coordUbication = Convert.ToString(dtReturnHdr.Rows[0]["ubicacion"]);
                    //
                    DateTime dateReturn = Convert.ToDateTime(dtReturnHdr.Rows[0]["Not_Fecha"]);
                    //
                    string rhvTransaction = "";// dtReturnHdr.Rows[0]["rhv_transaction"].ToString();
                    //
                    string rhnPerson = dtReturnHdr.Rows[0]["Not_BasId"].ToString();
                    //
                    string rhnEmployee = "";      // dtReturnHdr.Rows[0]["rhn_employee"].ToString();
                    //PERCEPCION
                    Decimal percepcion = 0;       //Convert.ToDecimal(dtReturnHdr.Rows[0]["percepcion"]);
                    //
                    Decimal porc_percepcion = 0;  //Convert.ToDecimal(dtReturnHdr.Rows[0]["porc_percepcion"]);

                    string _direccionfiscal = ""; //dtReturnHdr.Rows[0]["direccionf"].ToString();

                    // Id Bodega, para consultar la info de la bodega donde se genera la factura
                    //string stvWarehouse = "";// dtReturnHdr.Rows[0]["stv_warehouse"].ToString();
                    String mcpConcepto    = dtReturnHdr.Rows[0]["Con_Descripcion"].ToString();
                    String varNotaCredito = dtReturnHdr.Rows[0]["notaCredito"].ToString();

                    decimal varSubTotal = Convert.ToDecimal(dtReturnHdr.Rows[0]["SUBTOTAL"]);
                    decimal varIGV      = Convert.ToDecimal(dtReturnHdr.Rows[0]["IGV"]);
                    decimal varTotal    = Convert.ToDecimal(dtReturnHdr.Rows[0]["TOTAL"]);

                    ///
                    //warehouses objW = new warehouses(_user._usv_co, stvWarehouse);
                    //DataTable dtInfoWarehouse = objW.getWarehouseByPk();

                    string wavDescription = "";
                    string wavAddress     = "";
                    string wavPhone       = "";
                    string wavUbication   = "";
                    //
                    //if (dtInfoWarehouse != null && dtInfoWarehouse.Rows.Count > 0)
                    //{
                    ///
                    wavDescription = dtReturnHdr.Rows[0]["Alm_Descripcion"].ToString().ToUpper();
                    wavAddress     = dtReturnHdr.Rows[0]["Alm_Direccion"].ToString();
                    wavPhone       = dtReturnHdr.Rows[0]["Alm_Telefono"].ToString();
                    wavUbication   = "";// dtReturnHdr.Rows[0]["ubication"].ToString();
                    //}

                    // Consultar los datos de la persona a quien se le facturo
                    //DataTable dtInfoPersonInvoiced = Basic_Data.searchPerson(_user._usv_co, "-1", "", rhnPerson, "", "").Tables[0];

                    string facturadoDestinatario = "";
                    string facturadoUbicacion    = "";
                    string facturadoTelefono     = "";

                    ///
                    //if (dtInfoPersonInvoiced != null && dtInfoPersonInvoiced.Rows.Count > 0)
                    // {
                    ///
                    facturadoDestinatario = dtReturnHdr.Rows[0]["nombres"].ToString();
                    facturadoUbicacion    = dtReturnHdr.Rows[0]["ubicacion"].ToString();
                    facturadoTelefono     = dtReturnHdr.Rows[0]["Bas_Telefono"].ToString();
                    // }

                    // DETALLE DE LA DEVOLUCION
                    //DataTable dtReturnDtl = Returns_Dtl.getRetunrDtl(_user._usv_co, _noReturn);
                    DataTable dtReturnDtl = new DataTable();
                    dtReturnDtl = ds_nc.Tables[1].Copy();

                    //
                    foreach (DataRow drLine in dtReturnDtl.Rows)
                    {
                        //
                        string rhvInvoice = drLine["ven_id"].ToString();
                        //
                        string article = drLine["Not_Det_ArtId"].ToString();
                        //
                        string articleName = drLine["articulo"].ToString();
                        //
                        string articleColor = drLine["color"].ToString();
                        //
                        string size = drLine["Not_Det_TalId"].ToString();
                        //
                        decimal qty = Convert.ToDecimal(drLine["Not_Det_Cantidad"]);
                        //
                        decimal sellPrice = Convert.ToDecimal(drLine["Not_Det_Precio"]);
                        //
                        decimal disscountLin = 0;// Convert.ToDecimal(drLine["rdn_disscount_lin"]);
                        //
                        decimal commision = Convert.ToDecimal(drLine["Not_Det_ComisionM"]);
                        //
                        decimal handling = 0;     // Convert.ToDecimal(drLine["rdn_handling"]);
                        //
                        decimal disscountGen = 0; // Convert.ToDecimal(drLine["rdn_disscount_gen"]);
                        //
                        decimal taxes = Convert.ToDecimal(drLine["igvm"]);

                        DateTime FecEmisionFactura = Convert.ToDateTime(drLine["FecEmisionFactura"]);

                        //
                        ReporteDevolucion objAR = new ReporteDevolucion(idCoordinador, coordEmail, nameCoord,
                                                                        coordDocument, coordAdress, coordPhone, coordUbication, facturadoDestinatario,
                                                                        facturadoUbicacion, facturadoTelefono, wavDescription, wavAddress,
                                                                        wavPhone, wavUbication, _user._usv_co, _noReturn, dateReturn, rhvTransaction,
                                                                        rhnPerson, rhnEmployee, rhvInvoice, article, articleName, articleColor, size, qty, sellPrice, disscountLin,
                                                                        commision, handling, disscountGen, taxes, mcpConcepto, FecEmisionFactura, varNotaCredito, varSubTotal, varIGV, varTotal, percepcion, porc_percepcion, _direccionfiscal);

                        // Adicionar el nuevo objeto al arreglo
                        articlesReturnedValues.Add(objAR);
                    }
                }
                //
                Session[_nombreSession] = articlesReturnedValues;
            }
            else
            {
                articlesReturnedValues = (ArrayList)Session[_nombreSession];
            }
        }