diff --git a/AF/CatAF.aspx.vb b/AF/CatAF.aspx.vb index b5e500e31..14a3d44f4 100644 --- a/AF/CatAF.aspx.vb +++ b/AF/CatAF.aspx.vb @@ -458,7 +458,8 @@ Partial Class AF_CatAF Dim params As New List(Of ReportParameter) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - + Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos\CatAF.rdlc", UsuarioActual.Empresa.Ruta)) + Dim Ruta As String = "" params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) @@ -468,7 +469,13 @@ Partial Class AF_CatAF Else params.Add(New ReportParameter("LogoPath", "")) End If - ImprimirPDF(String.Format("{0}Formatos\CatAF.rdlc", UsuarioActual.Empresa.Ruta), DtActivosFijos, params, "CatalogoActivosFijos", Formato:=Formato) + + If Archivo.Exists Then + Ruta = UsuarioActual.Empresa.Ruta & "Formatos/CatAF.rdlc" + Else + Ruta = "Empresas/Grales/Formatos/CatAF.rdlc" + End If + ImprimirPDF(Ruta, DtActivosFijos, params, "CatalogoActivosFijos", Formato:=Formato) Else Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia) diff --git a/Acumuladores/EntradasUsadosResumenRep.aspx b/Acumuladores/EntradasUsadosResumenRep.aspx index 67f945d0f..5ed52d568 100644 --- a/Acumuladores/EntradasUsadosResumenRep.aspx +++ b/Acumuladores/EntradasUsadosResumenRep.aspx @@ -11,7 +11,7 @@
  • - +
  • @@ -107,7 +107,7 @@
  • Cargar Comprobante
  • -
  • - Imprimir Poliza -
  • @@ -410,7 +407,7 @@
    - + Movimiento diff --git a/Contabilidad/RegPrePoliza.aspx.vb b/Contabilidad/RegPrePoliza.aspx.vb index 279ed572d..259ae97cc 100644 --- a/Contabilidad/RegPrePoliza.aspx.vb +++ b/Contabilidad/RegPrePoliza.aspx.vb @@ -56,14 +56,14 @@ Partial Class ContabilidadC_RegPrePoliza End Property Private ReadOnly Property CvePrePoliza As Integer Get - Return ViewState("CvePrePoliza").ToString.ToEntero + Return ViewState("CvePrePoliza").ToString().ToEntero() End Get End Property 'PARA CREAR IE Private Property CveConcepto As Integer Get - Return ViewState("CveConcepto").ToString.ToEntero + Return ViewState("CveConcepto").ToString().ToEntero() End Get Set(value As Integer) ViewState("CveConcepto") = value @@ -71,7 +71,7 @@ Partial Class ContabilidadC_RegPrePoliza End Property Private Property CveTipoTransaccion As Integer Get - Return ViewState("CveTipoTransaccion").ToString.ToEntero + Return ViewState("CveTipoTransaccion").ToString().ToEntero() End Get Set(value As Integer) ViewState("CveTipoTransaccion") = value @@ -79,7 +79,7 @@ Partial Class ContabilidadC_RegPrePoliza End Property Private Property CveCuenta As Integer Get - Return ViewState("CveCuenta").ToString.ToEntero + Return ViewState("CveCuenta").ToString().ToEntero() End Get Set(value As Integer) ViewState("CveCuenta") = value @@ -87,7 +87,7 @@ Partial Class ContabilidadC_RegPrePoliza End Property Private Property Folio As String Get - Return ViewState("Folio").ToString + Return ViewState("Folio").ToString() End Get Set(value As String) ViewState("Folio") = value @@ -95,7 +95,7 @@ Partial Class ContabilidadC_RegPrePoliza End Property Private Property ImporteDocumento As Decimal Get - Return ViewState("ImporteDocumento").ToString.ToDecimal + Return ViewState("ImporteDocumento").ToString().ToDecimal() End Get Set(value As Decimal) ViewState("ImporteDocumento") = value @@ -103,7 +103,7 @@ Partial Class ContabilidadC_RegPrePoliza End Property Private Property Observaciones As String Get - Return ViewState("Observaciones").ToString + Return ViewState("Observaciones").ToString() End Get Set(value As String) ViewState("Observaciones") = value @@ -111,7 +111,7 @@ Partial Class ContabilidadC_RegPrePoliza End Property Private Property Beneficiario As String Get - Return ViewState("Beneficiario").ToString + Return ViewState("Beneficiario").ToString() End Get Set(value As String) ViewState("Beneficiario") = value @@ -119,7 +119,7 @@ Partial Class ContabilidadC_RegPrePoliza End Property Private Property RowIndex As Integer Get - Return ViewState("RowIndex").ToString.ToEntero + Return ViewState("RowIndex").ToString().ToEntero() End Get Set(value As Integer) ViewState("RowIndex") = value @@ -127,7 +127,7 @@ Partial Class ContabilidadC_RegPrePoliza End Property Private Property Actualizar As Boolean Get - Return CBool(ViewState("Actualizar").ToString) + Return CBool(ViewState("Actualizar").ToString()) End Get Set(value As Boolean) ViewState("Actualizar") = value @@ -202,6 +202,7 @@ Partial Class ContabilidadC_RegPrePoliza Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not Page.IsPostBack Then + Tick = DateTime.Now.Ticks.ToString() If UsuarioActual.Empresa.TipoContabilizacion = 1 OrElse UsuarioActual.Empresa.TipoContabilidad = 1 Then Response.Redirect(Request.Url.PathAndQuery.Replace("RegPrePoliza", "RegPrePolizaS")) @@ -234,32 +235,30 @@ Partial Class ContabilidadC_RegPrePoliza End If - If IfNull(Request("Tipo"), "").ToString = "NOMPROV" Then + If IfNull(Request("Tipo"), "").ToString() = "NOMPROV" Then DivTipoGasto.Visible = True ThTipoGasto.Visible = True CargaTiposGasto() End If - If Request("CvePrePoliza") IsNot Nothing AndAlso IsNumeric(Request("CvePrePoliza")) AndAlso Request("CvePrePoliza").ToEntero > 0 Then - ViewState("CvePrePoliza") = Request("CvePrePoliza").ToEntero + If Request("CvePrePoliza") IsNot Nothing AndAlso IsNumeric(Request("CvePrePoliza")) AndAlso Request("CvePrePoliza").ToEntero() > 0 Then + ViewState("CvePrePoliza") = Request("CvePrePoliza").ToEntero() CreaDT() CargaPrePoliza() CargaGvBitacora() - If IfNull(Request("Tipo"), "").ToString <> "NOMPROV" Then + If IfNull(Request("Tipo"), "").ToString() <> "NOMPROV" Then GvPrePoliza.Columns(4).Visible = False GvConcepto.Columns(4).Visible = False GvMov.Columns(5).Visible = False End If - LnkExcel.Visible = False - LnkImprimirPoliza.Visible = True - If IfNull(Request("Conta"), "").ToString = "1" Then + If IfNull(Request("Conta"), "").ToString() = "1" Then Contabilizar() End If Exit Sub + LnkExcel.Visible = False Else LnkExcel.Visible = True - LnkImprimirPoliza.Visible = False CreaDT() BtnEliminar.Visible = False @@ -272,7 +271,7 @@ Partial Class ContabilidadC_RegPrePoliza TipoPlantilla = 0 - If IfNull(Request("Tipo"), "").ToString = "Ing" Then + If IfNull(Request("Tipo"), "").ToString() = "Ing" Then TipoPlantilla = 1 LblEncabezado.Text = "Otros Ingresos" End If @@ -290,11 +289,11 @@ Partial Class ContabilidadC_RegPrePoliza CargaCuentas() - If Request("CvePeriodo") IsNot Nothing AndAlso IsNumeric(Request("CvePeriodo")) AndAlso Request("CvePeriodo").ToEntero > 0 Then - ViewState("CvePeriodo") = Request("CvePeriodo").ToEntero - ViewState("CveProyecto") = Request("CveProyecto").ToEntero - ViewState("CveSubProyecto") = Request("CveSubProyecto").ToEntero - ViewState("CveTurno") = Request("CveTurno").ToEntero + If Request("CvePeriodo") IsNot Nothing AndAlso IsNumeric(Request("CvePeriodo")) AndAlso Request("CvePeriodo").ToEntero() > 0 Then + ViewState("CvePeriodo") = Request("CvePeriodo").ToEntero() + ViewState("CveProyecto") = Request("CveProyecto").ToEntero() + ViewState("CveSubProyecto") = Request("CveSubProyecto").ToEntero() + ViewState("CveTurno") = Request("CveTurno").ToEntero() 'DdlPlantilla.Items.Add(New ListItem("Pago Nomina", "61")) 'DdlPlantilla.SelectedValue = "61" @@ -308,7 +307,7 @@ Partial Class ContabilidadC_RegPrePoliza RegistraScript("$(document).ready(function () { comparar(); Sys.Application.add_load(function (s, e) { comparar(); }); } );", 3) End If - If IfNull(Request("Tipo"), "").ToString <> "NOMPROV" Then + If IfNull(Request("Tipo"), "").ToString() <> "NOMPROV" Then GvPrePoliza.Columns(3).Visible = False GvConcepto.Columns(3).Visible = False GvMov.Columns(4).Visible = False @@ -362,7 +361,7 @@ Partial Class ContabilidadC_RegPrePoliza End Sub Private Sub CargaNomina() - Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero + Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero() Dim ObjNomina As New ClsNominas Dim ObjConta As New ClsContabilidad @@ -384,18 +383,18 @@ Partial Class ContabilidadC_RegPrePoliza For Each drt As DataRow In Dt.Rows Dim dr As DataRow = DtMovimientos.NewRow - If drt("NombreCompleto").ToString = "" AndAlso ObjConta.GetRetCuenta(31, UsuarioActual.CveEmpresa) Then + If drt("NombreCompleto").ToString() = "" AndAlso ObjConta.GetRetCuenta(31, UsuarioActual.CveEmpresa) Then CveConcepto = 98 Cuenta = "Nominas por Pagar" - IdCuenta = ObjConta.DtResultados(0)("IdCtaContable").ToString.ToEntero + IdCuenta = ObjConta.DtResultados(0)("IdCtaContable").ToString().ToEntero() Concepto = "Pago Nomina" Referencia = "Pago Nomina" Else Concepto = drt("NombreCompleto") Referencia = "" - CveConcepto = drt("CveConceptoContable").ToString.ToEntero - Cuenta = drt("ConceptoContable").ToString - IdCuenta = drt("IdCtaContable").ToString.ToEntero + CveConcepto = drt("CveConceptoContable").ToString().ToEntero() + Cuenta = drt("ConceptoContable").ToString() + IdCuenta = drt("IdCtaContable").ToString().ToEntero() End If Dim drr As DataRow = DtCuentasContables.FiltroPrimero($"Id={IdCuenta}") @@ -405,11 +404,11 @@ Partial Class ContabilidadC_RegPrePoliza TipoMovto = drt("TipoMovto") If TipoMovto = 0 Then - dr("Cargo") = Math.Abs(drt("Importe").ToString.ToDecimal) + dr("Cargo") = Math.Abs(drt("Importe").ToString().ToDecimal()) dr("Abono") = 0 Else dr("Cargo") = 0 - dr("Abono") = Math.Abs(drt("Importe").ToString.ToDecimal) + dr("Abono") = Math.Abs(drt("Importe").ToString().ToDecimal()) End If dr("IdCuenta") = IdCuenta @@ -450,7 +449,7 @@ Partial Class ContabilidadC_RegPrePoliza TxtConcepto.Text = dr("Concepto") DivDatosPoliza.Visible = True TipoPoliza = DdlTipoPoliza.SelectedItem.Text - Folio = dr("FolioPoliza").ToString + Folio = dr("FolioPoliza").ToString() If UsuarioActual.CveRol = 1 OrElse UsuarioActual.TienePermisoProceso(221) Then @@ -470,8 +469,8 @@ Partial Class ContabilidadC_RegPrePoliza LnkComplementoPago.Visible = True End If - IdPoliza = dr("IdPoliza").ToString.ToEntero - If dr("IdPoliza").ToString.ToEntero > 0 Then + IdPoliza = dr("IdPoliza").ToString().ToEntero() + If dr("IdPoliza").ToString().ToEntero() > 0 Then HplContabilizada.NavigateUrl = String.Format("RegPoliza.aspx?IdPoliza={0}", dr("IdPoliza")) divContabilziada.Visible = True BtnEliminar.Visible = False @@ -493,7 +492,7 @@ Partial Class ContabilidadC_RegPrePoliza RegistraScript("comparar();") - If Request("Tipo") IsNot Nothing AndAlso IsNumeric(Request("Tipo")) AndAlso Request("Tipo").ToEntero = 1 AndAlso UsuarioActual.CveUsuario <> 100 Then + If Request("Tipo") IsNot Nothing AndAlso IsNumeric(Request("Tipo")) AndAlso Request("Tipo").ToEntero() = 1 AndAlso UsuarioActual.CveUsuario <> 100 Then For Each row As GridViewRow In GvPrePoliza.Rows row.FCTextBox("TxtCargo").Enabled = False row.FCTextBox("TxtAbono").Enabled = False @@ -519,13 +518,13 @@ Partial Class ContabilidadC_RegPrePoliza 'Asignamos los Subproyectos e.Row.FCDropDownList("DdlSubProyecto").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) e.Row.FCDropDownList("DdlSubProyecto").DataBind() - e.Row.FCDropDownList("DdlSubProyecto").Items.Insert(0, New ListItem(" - ", "-1")) + 'e.Row.FCDropDownList("DdlSubProyecto").Items.Insert(0, New ListItem(" - ", "-1")) e.Row.FCDropDownList("DdlSubProyecto").SelectedValueExist(e.Row.DataKey("CveSubProyecto")) 'Asignamos los Tipos de Gasto e.Row.FCDropDownList("DdlTipoGasto").DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) e.Row.FCDropDownList("DdlTipoGasto").DataBind() - e.Row.FCDropDownList("DdlTipoGasto").Items.Insert(0, New ListItem("Sin Asignar", "-1")) + 'e.Row.FCDropDownList("DdlTipoGasto").Items.Insert(0, New ListItem("Sin Asignar", "-1")) e.Row.FCDropDownList("DdlTipoGasto").SelectedValueExist(e.Row.DataKey("CveTipoGasto")) 'ASignamos las CuentasContables @@ -534,10 +533,10 @@ Partial Class ContabilidadC_RegPrePoliza 'e.Row.FCDropDownList("DdlCtaContable").Items.Insert(0, New ListItem("Sin Asignar", "0")) e.Row.FCDropDownList("DdlCtaContable").SelectedValueExist(e.Row.DataKey("IdCtaContable")) - TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + e.Row.FCTextBox("TxtCargo").Text.ToDouble).ToString.FormatoNumero - TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + e.Row.FCTextBox("TxtAbono").Text.ToDouble).ToString.FormatoNumero + TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + e.Row.FCTextBox("TxtCargo").Text.ToDouble).ToString().FormatoNumero + TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + e.Row.FCTextBox("TxtAbono").Text.ToDouble).ToString().FormatoNumero - Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero + Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero() If CveConceptoContable.Contiene(1, 2, 12, 13, 38, 207, 203, 39, 61, 62, 63, 150, 251, 226) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveVenta")) If CveConceptoContable.Contiene(5, 6, 17, 18, 14, 19, 25, 26, 60, 205, 225, 234, 235, 240) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveCompra")) @@ -548,7 +547,7 @@ Partial Class ContabilidadC_RegPrePoliza If CveConceptoContable.Contiene(30) Then LnkImprimirPDF.Visible = True LnkComprobante.Visible = True - CveIE = e.Row.DBCampo("CveIE").ToString.ToEntero + CveIE = e.Row.DBCampo("CveIE").ToString().ToEntero() End If 'e.Row.FCHyperLink("HlReferencia").NavigateUrl = CveConceptoContable @@ -592,7 +591,7 @@ Partial Class ContabilidadC_RegPrePoliza End Sub Private Sub DdlConceptosContables_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConceptosContables.SelectedIndexChanged - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(5, 17, 201, 205, 206, 14, 15, 16, 19, 25, 26, 21, 18, 60) Then + If DdlConceptosContables.SelectedValue.ToEntero().Contiene(5, 17, 201, 205, 206, 14, 15, 16, 19, 25, 26, 21, 18, 60) Then CargaProveedores() DdlProveedores.Visible = True DdlCompras.Visible = True @@ -601,13 +600,13 @@ Partial Class ContabilidadC_RegPrePoliza DdlCompras.Visible = False End If - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(28, 29) Then + If DdlConceptosContables.SelectedValue.ToEntero().Contiene(28, 29) Then CargaPersonal() DdlPersonal.Visible = True Else DdlPersonal.Visible = False End If - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39, 12, 91) Then + If DdlConceptosContables.SelectedValue.ToEntero().Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39, 12, 91) Then CargaClientes() DdlClientes.Visible = True DdlVentas.Visible = True @@ -616,14 +615,14 @@ Partial Class ContabilidadC_RegPrePoliza DdlVentas.Visible = False End If - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(51) Then + If DdlConceptosContables.SelectedValue.ToEntero().Contiene(51) Then CargaClasificacionesE() DdlClasificacionesE.Visible = True Else DdlClasificacionesE.Visible = False End If - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(201, 202, 203, 204, 206, 207, 226, 227, 229, 233, 234, 235, 239, 242, 256, 266) Then + If DdlConceptosContables.SelectedValue.ToEntero().Contiene(201, 202, 203, 204, 206, 207, 226, 227, 229, 233, 234, 235, 239, 242, 256, 266) Then TxtTC.Text = "2" TxtTC.Visible = True Else @@ -631,7 +630,7 @@ Partial Class ContabilidadC_RegPrePoliza TxtTC.Visible = False End If - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(69) Then + If DdlConceptosContables.SelectedValue.ToEntero().Contiene(69) Then CargaClasificaciones() DdlClasificaciones.Visible = True Else @@ -644,19 +643,19 @@ Partial Class ContabilidadC_RegPrePoliza End Sub Private Sub DdlProveedores_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProveedores.SelectedIndexChanged - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(18, 60) Then - CargaNotasCreditoCompras(DdlProveedores.SelectedValue.ToEntero, DdlCompras) + If DdlConceptosContables.SelectedValue.ToEntero().Contiene(18, 60) Then + CargaNotasCreditoCompras(DdlProveedores.SelectedValue.ToEntero(), DdlCompras) Else - CargaCompras(DdlProveedores.SelectedValue.ToEntero) + CargaCompras(DdlProveedores.SelectedValue.ToEntero()) End If End Sub Private Sub DdlClientes_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClientes.selectedindexchange - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(12, 91) Then - CargaVentas(DdlClientes.SelectedValue.ToEntero) + If DdlConceptosContables.SelectedValue.ToEntero().Contiene(12, 91) Then + CargaVentas(DdlClientes.SelectedValue.ToEntero()) Else - CargaVentas(DdlClientes.SelectedValue.ToEntero) + CargaVentas(DdlClientes.SelectedValue.ToEntero()) End If End Sub @@ -689,7 +688,7 @@ Partial Class ContabilidadC_RegPrePoliza End Sub Private Sub CargaCompras(CveProveedor As Integer) - If Not DdlConceptosContables.SelectedValue.ToEntero.Contiene(21) Then + If Not DdlConceptosContables.SelectedValue.ToEntero().Contiene(21) Then Dim ObjCompras As New ClsCompras DdlCompras.ClearSelection() @@ -707,7 +706,7 @@ Partial Class ContabilidadC_RegPrePoliza End Sub Private Sub CargaNotasCreditoCompras(CveProveedor As Integer, ddl As DropDownList) - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(18, 60) Then + If DdlConceptosContables.SelectedValue.ToEntero().Contiene(18, 60) Then Dim ObjCompras As New ClsCompras ddl.ClearSelection() @@ -786,13 +785,13 @@ Partial Class ContabilidadC_RegPrePoliza TxtTotalAbonos.Text = "" TxtTotalCargos.Text = "" - If DdlPlantilla.SelectedValue.ToEntero <= 0 Then + If DdlPlantilla.SelectedValue.ToEntero() <= 0 Then Alert("Seleccione un Movimiento Válido", TipoMensaje.MsgAdvertencia) DdlPlantilla.SelectedValue = "-1" Exit Sub End If - If DdlPlantilla.SelectedValue.ToEntero = 53 Then 'Plantilla Personalizada + If DdlPlantilla.SelectedValue.ToEntero() = 53 Then 'Plantilla Personalizada DivAgregarConceptos.Visible = True Else DivAgregarConceptos.Visible = False @@ -800,7 +799,7 @@ Partial Class ContabilidadC_RegPrePoliza - Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero + Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero() Dim Dt As DataTable = GlobalDTContaPlantillasPolizasDetalle(CvePlantilla).FiltraParametros(String.Format("CveEmpresa={0}", UsuarioActual.CveEmpresa), "Orden") Dim Cuenta As String = "" @@ -812,23 +811,23 @@ Partial Class ContabilidadC_RegPrePoliza For Each drt As DataRow In Dt.Rows - Cuenta = drt("ConceptoContable").ToString + Cuenta = drt("ConceptoContable").ToString() IdCuenta = 0 CodigoCuenta = "" NombreCuenta = "" - If drt("IdCtaContable").ToString.ToEntero > 0 Then 'DtCuentasContables - Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", drt("IdCtaContable").ToString)) + If drt("IdCtaContable").ToString().ToEntero() > 0 Then 'DtCuentasContables + Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", drt("IdCtaContable").ToString())) If drr IsNot Nothing Then - IdCuenta = drt("IdCtaContable").ToString.ToEntero + IdCuenta = drt("IdCtaContable").ToString().ToEntero() CodigoCuenta = drr("CuentaFormato").ToString() NombreCuenta = drr("Nombre").ToString() - 'Cuenta = drr("Nombre").ToString() + 'Cuenta = drr("Nombre").Tostring() NombreCuenta = CodigoCuenta & "
    " & NombreCuenta End If EsComodin = 0 End If - If drt("CveCuenta").ToString.ToEntero > 0 Then + If drt("CveCuenta").ToString().ToEntero() > 0 Then NombreCuenta = String.Format("{0}
    {1}", drt("Codigo"), drt("Nombre")) End If @@ -836,9 +835,9 @@ Partial Class ContabilidadC_RegPrePoliza dr("IdCuenta") = IdCuenta dr("CodigoCuenta") = NombreCuenta dr("Cuenta") = Cuenta 'TxtCuentaContable.Text - dr("Referencia") = If(drt("CveConcepto").ToString.Contiene("29", "130"), drt("Personal"), drt("RazonSocial")) + dr("Referencia") = If(drt("CveConcepto").ToString().Contiene("29", "130"), drt("Personal"), drt("RazonSocial")) dr("Concepto") = TxtObservaciones.Text - dr("TipoMovto") = If(drt("TipoMovto").ToString = "False", 0, 1) + dr("TipoMovto") = If(drt("TipoMovto").ToString() = "False", 0, 1) dr("EsComodin") = EsComodin dr("CveConcepto") = drt("CveConcepto") dr("CveSubProyecto") = drt("CveSubProyectoNegativo") @@ -850,10 +849,7 @@ Partial Class ContabilidadC_RegPrePoliza dr("MultipleSubProyecto") = drt("MultipleSubProyecto") dr("PorcentajeImpuesto") = drt("PorcentajeImpuesto") dr("CveCuenta") = drt("CveCuenta") - If CvePrePoliza > 0 Then - dr("FolioPoliza") = drt("FolioPoliza") - End If - + dr("FolioPoliza") = drt("FolioPoliza") DtMovimientos.Rows.Add(dr) @@ -900,7 +896,7 @@ Partial Class ContabilidadC_RegPrePoliza e.Row.FCDropDownList("DdlTipoGasto").Items.Insert(0, New ListItem("Sin Asignar", "-1")) e.Row.FCDropDownList("DdlTipoGasto").SelectedValue = e.Row.DBCampo("CveTipoGasto") - If DdlPlantilla.SelectedValue.ToEntero = 53 Then 'Plantilla Personalizada + If DdlPlantilla.SelectedValue.ToEntero() = 53 Then 'Plantilla Personalizada e.Row.FCDropDownList("DdlSubProyecto").Enabled = True e.Row.FCImageButton("imgD").Visible = True Else @@ -912,17 +908,17 @@ Partial Class ContabilidadC_RegPrePoliza End If 'Agregamos la opcion para vincular los movimientos bancarios - If e.Row.DataKey("CveConcepto").ToEntero.Contiene(41) Then + If e.Row.DataKey("CveConcepto").ToEntero().Contiene(41) Then Dim ObjMovimientos As New ClsMovimientos Dim DdlSaldos As DropDownList = e.Row.FCDropDownList("DdlSaldos") - Select Case e.Row.DataKey("CveConcepto").ToEntero + Select Case e.Row.DataKey("CveConcepto").ToEntero() 'Acreedores Case 41 If (ObjMovimientos.GetAcreedoresSaldosDetalles(-1, CveMoneda, UsuarioActual.CveEmpresa)) Then DdlSaldos.Visible = True - DdlSaldos.DataSource = ObjMovimientos.DtResultados.FiltraParametros($"CveIE > 0 AND CveProveedor = {e.Row.DataKey("CveProveedor").ToEntero}") + DdlSaldos.DataSource = ObjMovimientos.DtResultados.FiltraParametros($"CveIE > 0 AND CveProveedor = {e.Row.DataKey("CveProveedor").ToEntero()}") DdlSaldos.DataBind() DdlSaldos.Items.Insert(0, New ListItem("Seleccione", "-1")) End If @@ -932,7 +928,7 @@ Partial Class ContabilidadC_RegPrePoliza ObjMovimientos.Dispose() End If - If e.Row.DataKey("CveConcepto").ToEntero.Contiene(30) Then + If e.Row.DataKey("CveConcepto").ToEntero().Contiene(30) Then e.Row.FCLinkButton("ImgBancos").Visible = True If CveTipoTransaccion > 0 And CveCuenta > 0 And Folio.Length > 0 And ImporteDocumento > 0 And Beneficiario.Length > 0 Then @@ -940,7 +936,7 @@ Partial Class ContabilidadC_RegPrePoliza End If End If - If e.Row.DataKey("CveConcepto").ToEntero.Contiene(17) Then + If e.Row.DataKey("CveConcepto").ToEntero().Contiene(17) Then e.Row.FCDropDownList("DdlProveedores").Visible = True e.Row.FCDropDownList("DdlProveedores").DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) e.Row.FCDropDownList("DdlProveedores").DataBind() @@ -958,12 +954,12 @@ Partial Class ContabilidadC_RegPrePoliza Dim TotalCargos, TotalAbonos As Decimal If CvePrePoliza > 0 Then - TotalCargos = TxtTotalCargos.Text.ToDecimal - TotalAbonos = TxtTotalAbonos.Text.ToDecimal + TotalCargos = TxtTotalCargos.Text.ToDecimal() + TotalAbonos = TxtTotalAbonos.Text.ToDecimal() Else For Each Gvr As GridViewRow In GvMov.Rows - TotalCargos += Gvr.FCTextBox("TxtCargo").Text.ToDecimal - TotalAbonos += Gvr.FCTextBox("TxtAbono").Text.ToDecimal + TotalCargos += Gvr.FCTextBox("TxtCargo").Text.ToDecimal() + TotalAbonos += Gvr.FCTextBox("TxtAbono").Text.ToDecimal() Next End If @@ -994,7 +990,7 @@ Partial Class ContabilidadC_RegPrePoliza Try Dim CvePrePoliza As Integer Dim ConceptoPoliza As String = TxtObservaciones.Text - CvePrePoliza = ObjMov.AddPrePolizas("Contabilidad/RegPrePoliza", DdlPlantilla.SelectedValue.ToEntero, TotalCargos, TotalAbonos, 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=DdlTipoPolizaAdd.SelectedValue.ToEntero) + CvePrePoliza = ObjMov.AddPrePolizas("Contabilidad/RegPrePoliza", DdlPlantilla.SelectedValue.ToEntero(), TotalCargos, TotalAbonos, 1, TxtFecha.Text.ToDate(), ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=DdlTipoPolizaAdd.SelectedValue.ToEntero()) If CvePrePoliza > 0 Then Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:

    " @@ -1013,12 +1009,12 @@ Partial Class ContabilidadC_RegPrePoliza 'inserto las compras que voy a pagarDdlSaldos For Each gvr As GridViewRow In GvMov.Rows - If gvr.DataKey("IDCuenta").ToEntero > 0 Then + If gvr.DataKey("IDCuenta").ToEntero() > 0 Then IdCtaContable = gvr.DataKey("IDCuenta") End If - CveProveedor = gvr.DataKey("CveProveedor").ToEntero - CveCompra = gvr.DataKey("CveCompra").ToEntero - CveConcepto = gvr.DataKey("CveConcepto").ToEntero + CveProveedor = gvr.DataKey("CveProveedor").ToEntero() + CveCompra = gvr.DataKey("CveCompra").ToEntero() + CveConcepto = gvr.DataKey("CveConcepto").ToEntero() If gvr.DataKey("TipoMovto").ToDouble <> 0 Then Importe = gvr.FCTextBox("TxtAbono").Text.ToDouble @@ -1029,12 +1025,12 @@ Partial Class ContabilidadC_RegPrePoliza End If 'Registra pago de compra If CveConcepto = 17 Then - CveProveedor = gvr.FCDropDownList("DdlProveedores").SelectedValue.ToEntero - CveCompra = gvr.FCDropDownList("DdlCompras").SelectedValue.ToEntero + CveProveedor = gvr.FCDropDownList("DdlProveedores").SelectedValue.ToEntero() + CveCompra = gvr.FCDropDownList("DdlCompras").SelectedValue.ToEntero() End If If CveConcepto = 41 Then - CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero + CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero() Else If CveConcepto = 30 AndAlso Importe <> 0 Then 'Registra movimieno bancario @@ -1060,14 +1056,14 @@ Partial Class ContabilidadC_RegPrePoliza End If If Importe <> 0 Then - If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, gvr.FCLiteral("LtlReferencia").Text, gvr.DataKey("CveConcepto").ToEntero, gvr.FCTextBox("TxtConcepto").Text, - TxtFecha.Text.ToDate, IdCtaContable, -1, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, CveIE:=CveIE, + If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, gvr.FCLiteral("LtlReferencia").Text, gvr.DataKey("CveConcepto").ToEntero(), gvr.FCTextBox("TxtConcepto").Text, + TxtFecha.Text.ToDate(), IdCtaContable, -1, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero(), CveIE:=CveIE, CveProveedor:=CveProveedor, CveCompra:=CveCompra, - CvePersonal:=gvr.DataKey("CvePersonal").ToEntero, CveClasificacion:=gvr.DataKey("CveClasificacion").ToEntero, - ImporteMX:=Importe, CveTipoGasto:=gvr.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero, - CveCliente:=gvr.DataKey("CveCliente").ToEntero, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=If(gvr.DataKey("TC").ToString.ToDecimal > 0, gvr.DataKey("TC").ToString.ToDecimal, 1), - ImporteME:=If(gvr.DataKey("TC").ToString.ToDecimal > 0, (Importe / (gvr.DataKey("TC").ToString.ToDecimal - 1)).RoundSQL, 0), - PorcentajeImpuesto:=gvr.DataKey("PorcentajeImpuesto").ToDecimal, CveCuenta:=gvr.DataKey("CveCuenta").ToEntero) Then + CvePersonal:=gvr.DataKey("CvePersonal").ToEntero(), CveClasificacion:=gvr.DataKey("CveClasificacion").ToEntero(), + ImporteMX:=Importe, CveTipoGasto:=gvr.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero(), + CveCliente:=gvr.DataKey("CveCliente").ToEntero(), CveVenta:=gvr.DataKey("CveVenta").ToEntero(), TipoCambio:=If(gvr.DataKey("TC").ToString().ToDecimal() > 0, gvr.DataKey("TC").ToString().ToDecimal(), 1), + ImporteME:=If(gvr.DataKey("TC").ToString().ToDecimal() > 0, (Importe / (gvr.DataKey("TC").ToString().ToDecimal() - 1)).RoundSQL, 0), + PorcentajeImpuesto:=gvr.DataKey("PorcentajeImpuesto").ToDecimal(), CveCuenta:=gvr.DataKey("CveCuenta").ToEntero()) Then Else MsgError = "No se pudo insertar el detalle de la póliza2" Exit For @@ -1097,7 +1093,7 @@ Partial Class ContabilidadC_RegPrePoliza 'MENSAJE PRINCIPAL MensajeAlert.AppendFormat("

    Folio de Póliza: {1}", ObjMov.ContaIdPoliza, ObjMov.ContaFolio) MensajeAlert.AppendFormat("

    Prepóliza: {1}", CvePrePoliza, ObjMov.ContaFolio) - 'Alert(MensajeAlert.ToString, ModExtensiones.TipoMensaje.MsgInformacion) + 'Alert(MensajeAlert.Tostring(), ModExtensiones.TipoMensaje.MsgInformacion) Else Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico") End If @@ -1115,9 +1111,9 @@ Partial Class ContabilidadC_RegPrePoliza 'MENSAJE IE If CveIE > 0 Then MensajeAlert.AppendFormat("

    Folio Bancario: {1}", CveIE, FolioIE) - Alert(MensajeAlert.ToString, ModExtensiones.TipoMensaje.MsgInformacion, "window.location.reload()") + Alert(MensajeAlert.ToString(), ModExtensiones.TipoMensaje.MsgInformacion, "window.location.reload()") Else - Alert(If(MensajeAlert.ToString = "", "Se registro con exito.", MensajeAlert.ToString), TipoMensaje.MsgInformacion, "window.location.reload()") + Alert(If(MensajeAlert.ToString() = "", "Se registro con exito.", MensajeAlert.ToString()), TipoMensaje.MsgInformacion, "window.location.reload()") End If ObjIE.Commit() @@ -1150,62 +1146,79 @@ Partial Class ContabilidadC_RegPrePoliza End Sub Private Sub ActualizarPrePoliza() - + Dim contador As Integer = 0 + 'Dim diferencia As String = "" Dim OcurrioError As Boolean = False - Dim ObjContabilidad As New ClsContabilidad - ObjContabilidad.IniciaTransacSQL() + Using ObjContabilidad As New ClsContabilidad + + ObjContabilidad.IniciaTransacSQL() - If Not ObjContabilidad.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then - OcurrioError = True - End If + If Not ObjContabilidad.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then + OcurrioError = True + End If + If ObjContabilidad.UpdatePrePoliza(MinFecha, -1, DdlTipoPoliza.SelectedValue.ToEntero(), -1, CvePrePoliza, UsuarioActual.CveEmpresa, Concepto:=TxtConcepto.Text, FechaPoliza:=TxtFechaDocumento.Text.ToDate(), CveUsuarioModifico:=UsuarioActual.CveUsuario) Then - If ObjContabilidad.UpdatePrePoliza(MinFecha, -1, DdlTipoPoliza.SelectedValue.ToEntero, -1, CvePrePoliza, UsuarioActual.CveEmpresa, Concepto:=TxtConcepto.Text, FechaPoliza:=TxtFechaDocumento.Text.ToDate, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then + For Each row As GridViewRow In GvPrePoliza.Rows + Dim CvePrePolizaDetalle As Integer = row.DataKey("CvePrePolizaDetalle").ToEntero() + Dim Concepto As String = row.FCTextBox("TxtConcepto").Text + Dim CveSubProyecto As Integer = row.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero() + Dim CtaContable As Integer = row.FCDropDownList("DdlCtaContable").SelectedValue.ToEntero() + Dim TipoMovto As Boolean = If(row.FCTextBox("TxtCargo").Text.ToDecimal() <> 0, False, True) + Dim TipoMovtoOld As Boolean = (row.DataKey("TipoMovto").ToString = "True") + Dim ImporteMN As Decimal = If(row.FCTextBox("TxtCargo").Text.ToDecimal() <> 0, row.FCTextBox("TxtCargo").Text.ToDecimal(), row.FCTextBox("TxtAbono").Text.ToDecimal()) + Dim CveTipoGastonew As Integer = If(DdlTipoGasto.Visible, row.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero(), row.DataKey("CveTipoGasto").ToEntero()) - - - For Each row As GridViewRow In GvPrePoliza.Rows - If row.DataKey("CvePrePolizaDetalle").ToEntero > 0 Then - If Not ObjContabilidad.UpdatePrepolizasDetalle(row.DataKey("CvePrePolizaDetalle").ToEntero, row.FCTextBox("TxtConcepto").Text, row.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, - row.FCDropDownList("DdlCtaContable").SelectedValue.ToEntero, If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0, - row.FCTextBox("TxtCargo").Text.ToDecimal, row.FCTextBox("TxtAbono").Text.ToDecimal), CveTipoGasto:=If(DdlTipoGasto.Visible, row.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero, row.DataKey("CveTipoGasto").ToEntero), CveUsuarioModifico:=UsuarioActual.CveUsuario) Then - OcurrioError = True - Exit For + If row.DataKey("CvePrePolizaDetalle").ToEntero() > 0 Then + Dim actualizar As Boolean + actualizar = (Concepto <> row.DataKey("Concepto") OrElse CveSubProyecto <> row.DataKey("CveSubProyecto").ToEntero() OrElse CtaContable <> row.DataKey("IdCtaContable").ToEntero() OrElse + TipoMovto <> TipoMovtoOld OrElse ImporteMN <> row.DataKey("ImporteMN").ToDecimal() OrElse CveTipoGastonew <> row.DataKey("CveTipoGasto").ToEntero()) + 'diferencia = $"{diferencia}\r\n /*{actualizar}*/actualizar = '{Concepto}' <> '{row.DataKey("Concepto")}' || '{CveSubProyecto}' <> '{row.DataKey("CveSubProyecto").ToEntero()}' || '{CtaContable}' <> '{row.DataKey("IdCtaContable").ToEntero()}' ||" + 'diferencia = $"{diferencia} '{TipoMovto}' <> '{TipoMovtoOld}' OrElse '{ImporteMN}' <> '{row.DataKey("ImporteMN").ToEntero()}' OrElse '{CveTipoGastonew}' <> '{row.DataKey("CveTipoGasto").ToEntero()}'" + If actualizar Then + contador = contador + 1 + If Not ObjContabilidad.UpdatePrepolizasDetalle(CvePrePolizaDetalle, Concepto, CveSubProyecto, + CtaContable, TipoMovto, ImporteMN, CveTipoGasto:=CveTipoGastonew, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then + OcurrioError = True + Exit For + End If + End If + Else + contador = contador + 1 + If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, If(row.FCTextBox("TxtCargo").Text.ToDecimal() <> 0, False, True), If(row.FCTextBox("TxtCargo").Text.ToDecimal() <> 0, + row.FCTextBox("TxtCargo").Text.ToDecimal(), row.FCTextBox("TxtAbono").Text.ToDecimal()), row.DataKey("Referencia").ToString(), + row.DataKey("CveConceptoContable").ToEntero(), row.FCTextBox("TxtConcepto").Text, Now, + row.FCDropDownList("DdlCtaContable").SelectedValue.ToEntero(), 0, CveSubProyecto:=row.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero(), + CveTipoGasto:=If(DdlTipoGasto.Visible, row.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero(), row.DataKey("CveTipoGasto").ToEntero()), + ImporteMX:=If(row.FCTextBox("TxtCargo").Text.ToDecimal() <> 0, + row.FCTextBox("TxtCargo").Text.ToDecimal(), row.FCTextBox("TxtAbono").Text.ToDecimal()), CveProveedor:=DdlProveedores.SelectedValue.ToEntero()) Then + OcurrioError = True + Exit For + End If End If - Else - If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0, - row.FCTextBox("TxtCargo").Text.ToDecimal, row.FCTextBox("TxtAbono").Text.ToDecimal), row.DataKey("Referencia").ToString, - row.DataKey("CveConceptoContable").ToEntero, row.FCTextBox("TxtConcepto").Text, Now, - row.FCDropDownList("DdlCtaContable").SelectedValue.ToEntero, 0, CveSubProyecto:=row.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, - CveTipoGasto:=If(DdlTipoGasto.Visible, row.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero, row.DataKey("CveTipoGasto").ToEntero), - ImporteMX:=If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0, - row.FCTextBox("TxtCargo").Text.ToDecimal, row.FCTextBox("TxtAbono").Text.ToDecimal), CveProveedor:=DdlProveedores.SelectedValue.ToEntero) Then - OcurrioError = True - Exit For - End If - End If - Next - Else - OcurrioError = True - End If + Next + Else + OcurrioError = True + End If - If Not OcurrioError Then - ObjContabilidad.Commit() - Alert("La PrePoliza se actualizó correctamente.", TipoMensaje.MsgInformacion) - Else - ObjContabilidad.RollBack() - Alert("Ocurrio un error al actualizar la PrePoliza.", TipoMensaje.MsgError) - End If + If Not OcurrioError Then + ObjContabilidad.Commit() + Alert($"La Prepoliza se actualizó correctamente.
    se actualizaron {contador} registros.", TipoMensaje.MsgInformacion) + Else + ObjContabilidad.RollBack() + Alert($"Ocurrio un error al actualizar la PrePoliza.
    {contador} registros.", TipoMensaje.MsgError) + End If + 'RegistraScript($"console.log(""{diferencia}"")".Replace("'", "\'")) + End Using - ObjContabilidad.Dispose() CargaPrePoliza() If Not OcurrioError Then - If IdPoliza > 0 Then + If IdPoliza > 0 AndAlso contador Then BtnContabilizar_Click(Nothing, Nothing) End If @@ -1229,9 +1242,9 @@ Partial Class ContabilidadC_RegPrePoliza Dim ConceptoContable As String = GvPrePoliza.Rows(IndiceGrid).FCLiteral("LtlConceptoContable").Text Dim FolioFactura As String = GvPrePoliza.Rows(IndiceGrid).FCHyperLink("HlReferencia").Text Dim Concepto As String = GvPrePoliza.Rows(IndiceGrid).FCTextBox("TxtConcepto").Text - Dim CveSubProyecto As Integer = GvPrePoliza.Rows(IndiceGrid).FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero - Dim CveTipoGasto As Integer = GvPrePoliza.Rows(IndiceGrid).FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero - Dim Id As Integer = GvPrePoliza.Rows(IndiceGrid).FCDropDownList("DdlCtaContable").SelectedValue.ToEntero + Dim CveSubProyecto As Integer = GvPrePoliza.Rows(IndiceGrid).FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero() + Dim CveTipoGasto As Integer = GvPrePoliza.Rows(IndiceGrid).FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero() + Dim Id As Integer = GvPrePoliza.Rows(IndiceGrid).FCDropDownList("DdlCtaContable").SelectedValue.ToEntero() Dim Cargo As Double = GvPrePoliza.Rows(IndiceGrid).FCTextBox("TxtCargo").Text.ToDouble Dim Abono As Double = GvPrePoliza.Rows(IndiceGrid).FCTextBox("TxtAbono").Text.ToDouble @@ -1278,10 +1291,10 @@ Partial Class ContabilidadC_RegPrePoliza - 'TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + e.Row.FCTextBox("TxtCargo").Text.ToDouble).ToString.FormatoNumero - 'TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + e.Row.FCTextBox("TxtAbono").Text.ToDouble).ToString.FormatoNumero + 'TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + e.Row.FCTextBox("TxtCargo").Text.ToDouble).Tostring().FormatoNumero + 'TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + e.Row.FCTextBox("TxtAbono").Text.ToDouble).Tostring().FormatoNumero - 'Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero + 'Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero() 'If CveConceptoContable.Contiene(1, 2, 13, 38, 207, 203, 39, 61, 62, 63) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveVenta")) 'If CveConceptoContable.Contiene(5, 6, 17, 18, 14, 19, 25, 26, 60, 234, 235) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveCompra")) @@ -1305,7 +1318,7 @@ Partial Class ContabilidadC_RegPrePoliza Protected Sub GvMov_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvMov.RowDeleting - Dim idMov As Integer = GvMov.DataKeys(e.RowIndex).Value.ToString.ToEntero + Dim idMov As Integer = GvMov.DataKeys(e.RowIndex).Value.ToString().ToEntero() Dim Rows As DataRow() = DtMovimientos.Select("IDMov = " & idMov) If Rows.Count > 0 Then @@ -1337,7 +1350,7 @@ Partial Class ContabilidadC_RegPrePoliza Dim NombreCuenta As String = "" dr("IdCuenta") = DdlCtaContable.SelectedValue - If DdlCtaContable.SelectedValue.ToEntero > 0 Then + If DdlCtaContable.SelectedValue.ToEntero() > 0 Then Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContable.SelectedValue)) If drr IsNot Nothing Then CodigoCuenta = drr("CuentaFormato").ToString() @@ -1356,12 +1369,12 @@ Partial Class ContabilidadC_RegPrePoliza dr("Abono") = TxtAbono.Text.ToDouble dr("Descripcion") = TxtDescripcion.Text dr("CveSubProyecto") = DdlSubProyecto.SelectedValue - dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero - dr("CveCompra") = DdlCompras.SelectedValue.ToEntero - dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero - dr("CveClasificacion") = DdlClasificaciones.SelectedValue.ToEntero - dr("CveCliente") = DdlClientes.SelectedValue.ToEntero - dr("CveVenta") = DdlVentas.SelectedValue.ToEntero + dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero() + dr("CveCompra") = DdlCompras.SelectedValue.ToEntero() + dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero() + dr("CveClasificacion") = DdlClasificaciones.SelectedValue.ToEntero() + dr("CveCliente") = DdlClientes.SelectedValue.ToEntero() + dr("CveVenta") = DdlVentas.SelectedValue.ToEntero() End If GvMov.DataSource = DtMovimientos @@ -1387,8 +1400,8 @@ Partial Class ContabilidadC_RegPrePoliza dr("CveSubProyecto") = DdlSubProyecto.SelectedValue - TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero - TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero + TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString().FormatoNumero + TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString().FormatoNumero DtMovimientos.Rows.Add(dr) DtMovimientos.AcceptChanges() @@ -1404,7 +1417,7 @@ Partial Class ContabilidadC_RegPrePoliza dr("IdCuenta") = DdlCtaContable.SelectedValue - If DdlCtaContable.SelectedValue.ToEntero > 0 Then + If DdlCtaContable.SelectedValue.ToEntero() > 0 Then Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContable.SelectedValue)) If drr IsNot Nothing Then CodigoCuenta = drr("CuentaFormato").ToString() @@ -1425,16 +1438,16 @@ Partial Class ContabilidadC_RegPrePoliza dr("Abono") = TxtAbono.Text.ToDouble dr("Descripcion") = TxtDescripcion.Text dr("CveSubProyecto") = DdlSubProyecto.SelectedValue - dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero - dr("CveCompra") = DdlCompras.SelectedValue.ToEntero - dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero - dr("CveClasificacion") = DdlClasificaciones.SelectedValue.ToEntero - dr("CveCliente") = DdlClientes.SelectedValue.ToEntero - dr("CveVenta") = DdlVentas.SelectedValue.ToEntero + dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero() + dr("CveCompra") = DdlCompras.SelectedValue.ToEntero() + dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero() + dr("CveClasificacion") = DdlClasificaciones.SelectedValue.ToEntero() + dr("CveCliente") = DdlClientes.SelectedValue.ToEntero() + dr("CveVenta") = DdlVentas.SelectedValue.ToEntero() dr("TC") = TxtTC.Text.ToDouble - TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero - TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero + TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString().FormatoNumero + TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString().FormatoNumero DtMovimientos.Rows.Add(dr) DtMovimientos.AcceptChanges() @@ -1489,10 +1502,10 @@ Partial Class ContabilidadC_RegPrePoliza End Sub Private Sub BtnContado_Click(sender As Object, e As EventArgs) Handles BtnContado.Click CveConcepto = 30 - CveTipoTransaccion = DdlTipoTransaccion.SelectedValue.ToEntero - CveCuenta = DdlCuenta.SelectedValue.ToEntero + CveTipoTransaccion = DdlTipoTransaccion.SelectedValue.ToEntero() + CveCuenta = DdlCuenta.SelectedValue.ToEntero() Folio = TxtDocumentoFolio.Text - ImporteDocumento = TxtDocumentoImporte.Text.ToDecimal + ImporteDocumento = TxtDocumentoImporte.Text.ToDecimal() Observaciones = TxtDocumentoObservaciones.Text Beneficiario = TxtDocumentoBeneficiario.Text RegistraScript(String.Format("$('#{0}').modal('hide');", "DivContadoModal")) @@ -1549,8 +1562,8 @@ Partial Class ContabilidadC_RegPrePoliza Protected Sub DdlSubProyectoFiltro_SelectedIndexChanged(sender As Object, e As EventArgs) Dim Ddl As DropDownList = CType(sender, DropDownList) For Each Gvr As GridViewRow In GvPrePoliza.Rows - If Ddl.SelectedValue.ToEntero > 0 Then - If Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero = Ddl.SelectedValue.ToEntero Or Not Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero > 0 Or Gvr.FCDropDownList("DdlSubProyecto").Enabled Then + If Ddl.SelectedValue.ToEntero() > 0 Then + If Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero() = Ddl.SelectedValue.ToEntero() Or Not Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero() > 0 Or Gvr.FCDropDownList("DdlSubProyecto").Enabled Then Gvr.Visible = True Gvr.FCDropDownList("DdlSubProyecto").SelectedValueExist(Ddl.SelectedValue) Else @@ -1567,8 +1580,8 @@ Partial Class ContabilidadC_RegPrePoliza End Sub Protected Sub DdlSubProyectoFiltroMov_SelectedIndexChanged(sender As Object, e As EventArgs) For Each Gvr As GridViewRow In GvMov.Rows - If DdlSubProyectoFiltroMov.SelectedValue.ToEntero > 0 Then - If Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero = DdlSubProyectoFiltroMov.SelectedValue.ToEntero Or Not Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero > 0 Or Gvr.FCDropDownList("DdlSubProyecto").Enabled Then + If DdlSubProyectoFiltroMov.SelectedValue.ToEntero() > 0 Then + If Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero() = DdlSubProyectoFiltroMov.SelectedValue.ToEntero() Or Not Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero() > 0 Or Gvr.FCDropDownList("DdlSubProyecto").Enabled Then Gvr.Visible = True Gvr.FCDropDownList("DdlSubProyecto").SelectedValueExist(DdlSubProyectoFiltroMov.SelectedValue) Else @@ -1586,22 +1599,22 @@ Partial Class ContabilidadC_RegPrePoliza Private Sub GvMov_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvMov.RowEditing Actualizar = True - GvMov.DataKeys(e.NewEditIndex).Value.ToString.ToEntero - Dim idMov As Integer = GvMov.DataKeys(e.NewEditIndex).Value.ToString.ToEntero + GvMov.DataKeys(e.NewEditIndex).Value.ToString().ToEntero() + Dim idMov As Integer = GvMov.DataKeys(e.NewEditIndex).Value.ToString().ToEntero() Dim DrM As DataRow = DtMovimientos.Rows(e.NewEditIndex) If DrM IsNot Nothing Then - HdnCve.Value = idMov.ToString + HdnCve.Value = idMov.ToString() DdlCtaContable.SelectedValue = DrM("IdCuenta") TxtReferencia.Text = DrM("Referencia") TxtObservaciones.Text = DrM("Concepto") ' (Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) = dr("TipoMovto") DrM("EsComodin") = 0 - DdlConceptosContables.SelectedValue = DrM("CveConcepto").ToString - TxtCargo.Text = DrM("Cargo").ToString - TxtAbono.Text = DrM("Abono").ToString + DdlConceptosContables.SelectedValue = DrM("CveConcepto").ToString() + TxtCargo.Text = DrM("Cargo").ToString() + TxtAbono.Text = DrM("Abono").ToString() TxtDescripcion.Text = DrM("Descripcion") DdlSubProyecto.SelectedValue = DrM("CveSubProyecto") DdlProveedores.SelectedValue = DrM("CveProveedor") @@ -1627,11 +1640,11 @@ Partial Class ContabilidadC_RegPrePoliza 'dr("IdCuenta") = DdlCtaContable.SelectedValue - 'If DdlCtaContable.SelectedValue.ToEntero > 0 Then + 'If DdlCtaContable.SelectedValue.ToEntero() > 0 Then ' Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContable.SelectedValue)) ' If drr IsNot Nothing Then - ' CodigoCuenta = drr("CuentaFormato").ToString() - ' NombreCuenta = drr("Nombre").ToString() + ' CodigoCuenta = drr("CuentaFormato").Tostring() + ' NombreCuenta = drr("Nombre").Tostring() ' End If 'End If @@ -1646,15 +1659,15 @@ Partial Class ContabilidadC_RegPrePoliza 'dr("Abono") = TxtAbono.Text.ToDouble 'dr("Descripcion") = TxtDescripcion.Text 'dr("CveSubProyecto") = DdlSubProyecto.SelectedValue - 'dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero - 'dr("CveCompra") = DdlCompras.SelectedValue.ToEntero - 'dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero + 'dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero() + 'dr("CveCompra") = DdlCompras.SelectedValue.ToEntero() + 'dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero() 'dr("CveClasificacion") = -1 - 'dr("CveCliente") = DdlClientes.SelectedValue.ToEntero - 'dr("CveVenta") = DdlVentas.SelectedValue.ToEntero + 'dr("CveCliente") = DdlClientes.SelectedValue.ToEntero() + 'dr("CveVenta") = DdlVentas.SelectedValue.ToEntero() - 'TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero - 'TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero + 'TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).Tostring().FormatoNumero + 'TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).Tostring().FormatoNumero 'DtMovimientos.Rows.Add(dr) 'If CvePrePoliza > 0 Then @@ -1696,7 +1709,7 @@ Partial Class ContabilidadC_RegPrePoliza ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) End If - If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1), Concepto:=TxtConcepto.Text, Fecha:=TxtFechaDocumento.Text.ToDateTime) Then + If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1), Concepto:=TxtConcepto.Text, Fecha:=TxtFechaDocumento.Text.ToDateTime()) Then Alert(String.Format("Prepóliza contabilizada.

    Folio:Ver Póliza", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion) Else @@ -1728,7 +1741,7 @@ Partial Class ContabilidadC_RegPrePoliza Str.AppendFormat("No se genero complemento por el siguiente motivo: {0}", Banco.Mensaje) End If Banco.Dispose() - Alert(Str.ToString, TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();") + Alert(Str.ToString(), TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();") End Sub Private Sub MandaCorreo(NombreArchivo As String, Correo As String, Optional ConAlerta As Boolean = True) @@ -1779,7 +1792,6 @@ Partial Class ContabilidadC_RegPrePoliza Dim ObjIE As New ClsBancos() Dim pathPoliza As String = "" Dim TieneComprobante As Boolean - Tick = DateTime.Now.Ticks.ToString Try TieneComprobante = VerificarComprobante() @@ -1792,11 +1804,11 @@ Partial Class ContabilidadC_RegPrePoliza End If For Each Row As DataRow In dt.Rows - If Row("CveConceptoContable").ToString.ToEntero = 30 Then - If Row("CveIE").ToString.ToEntero > 0 Then - If ObjIE.GetBancosIE(Row("CveIE").ToString.ToEntero, UsuarioActual.CveEmpresa) Then + If Row("CveConceptoContable").ToString().ToEntero() = 30 Then + If Row("CveIE").ToString().ToEntero() > 0 Then + If ObjIE.GetBancosIE(Row("CveIE").ToString().ToEntero(), UsuarioActual.CveEmpresa) Then If ObjIE.DtResultados.Rows.Count > 0 Then - Path = String.Format("{0}IE\{1}", UsuarioActual.Empresa.Ruta, ObjIE.Comprobante.ToString) + Path = String.Format("{0}IE\{1}", UsuarioActual.Empresa.Ruta, ObjIE.Comprobante.ToString()) If File.Exists(Path) Then Dim formato As String = System.IO.Path.GetExtension(Path) If formato.ToLower.Contiene(".jpg", ".png", ".jpeg") Then @@ -1825,12 +1837,12 @@ Partial Class ContabilidadC_RegPrePoliza End If End If End If - If Row("CveConceptoContable").ToString.ToEntero.Contiene(17, 309, 312, 308) Then - If ObjCompra.GetCompras(Row("CveCompra").ToString.ToEntero, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) Then + If Row("CveConceptoContable").ToString().ToEntero().Contiene(17, 309, 312, 308) Then + If ObjCompra.GetCompras(Row("CveCompra").ToString().ToEntero(), "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) Then If ObjCompra.DtResultados IsNot Nothing AndAlso ObjCompra.DtResultados.Rows.Count > 0 Then Dim dr As DataRow = ObjCompra.DtResultados.Rows(0) - Dim RFC As String = dr("RFC").ToString - Dim CveFactura As String = dr("CveFactura").ToString + Dim RFC As String = dr("RFC").ToString() + Dim CveFactura As String = dr("CveFactura").ToString() Path = String.Format("{0}Compras\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, RFC, CveFactura) If File.Exists(Path) Then @@ -1842,38 +1854,38 @@ Partial Class ContabilidadC_RegPrePoliza Next - - For Each Row As DataRow In dt.FiltraParametros("CveConceptoContable = 30").Rows - If ObjCompra.GetCompraComplementoPago(-1, UsuarioActual.CveEmpresa, Row("CveIE").ToString.ToEntero) Then + dt = DtMovimientos.FiltraParametros("", "", filtroComplemento) + For Each Row As DataRow In dt.Rows + If ObjCompra.GetCompraComplementoPago(-1, UsuarioActual.CveEmpresa, Row("CveIE").ToString().ToEntero()) Then + Console.WriteLine(Row("CveIE").ToString()) If ObjCompra.DtResultados IsNot Nothing AndAlso ObjCompra.DtResultados.Rows.Count > 0 Then - For Each RowComple As DataRow In ObjCompra.DtResultados.FiltraParametros("", "", {"RFCde", "CveFactura"}).Rows - Dim RFC As String = RowComple.Item("RFCde").ToString - Dim CveFactura As String = RowComple.Item("CveFactura").ToString - If CveFactura <> "" Then - Path = String.Format("{0}Compras\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, RFC, CveFactura) - If File.Exists(Path) Then - Pathpdf.Add(Path) - End If + Dim dr As DataRow = ObjCompra.DtResultados.Rows(0) + Dim RFC As String = dr("RFCde").ToString() + Dim CveFactura As String = dr("CveFactura").ToString() + Console.WriteLine(RFC & CveFactura) + If CveFactura <> "" Then + Path = String.Format("{0}Compras\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, RFC, CveFactura) + Console.WriteLine(Path) + If File.Exists(Path) Then + Pathpdf.Add(Path) End If - Next - + End If End If End If Next + MergePdfFiles(Pathpdf.ToArray) If File.Exists(pathPoliza) Then - Directory.Delete(String.Format("{0}/{1}", AppDomain.CurrentDomain.BaseDirectory, Tick), True) + Directory.Delete(String.Format("{0}{1}", AppDomain.CurrentDomain.BaseDirectory, Tick), True) End If Else Alert("No se tiene cargado comprobante de pago", TipoMensaje.MsgAdvertencia) End If + Catch ex As Exception Alert("Error al descargar el paquete", TipoMensaje.MsgError) - If File.Exists(pathPoliza) Then - Directory.Delete(String.Format("{0}/{1}", AppDomain.CurrentDomain.BaseDirectory, Tick), True) - End If End Try ObjCompra.Dispose() ObjIE.Dispose() @@ -1891,24 +1903,21 @@ Partial Class ContabilidadC_RegPrePoliza If ObjConta.GetPrePolizasDetalle(CvePrePoliza) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Dim dtVC As DataTable Dim dr As DataRow - dtVC = ObjConta.DtResultados.FiltraParametros("Contabilizable = 1", "Orden") + dtVC = ObjConta.DtResultados dr = dtVC.Rows(0) Dim ruta As String = "" params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) - params.Add(New ReportParameter("TipoPoliza", dr("TipoPoliza").ToString)) - params.Add(New ReportParameter("Finicio", dr("Fecha").ToString.ToDate.ToShortDateString)) - params.Add(New ReportParameter("FFin", dr("Fecha").ToString.ToDate.ToShortDateString)) - params.Add(New ReportParameter("Fecha", dr("Fecha").ToString.ToDate.ToShortDateString)) - 'params.Add(New ReportParameter("Nombre", dr("Cuenta").ToString)) - 'params.Add(New ReportParameter("Cuenta", dr("Codigo").ToString)) - params.Add(New ReportParameter("Numero", dr("FolioPoliza").ToString)) + params.Add(New ReportParameter("TipoPoliza", dr("TipoPoliza").ToString())) + params.Add(New ReportParameter("Finicio", dr("Fecha").ToString().ToDate().ToShortDateString)) + params.Add(New ReportParameter("FFin", dr("Fecha").ToString().ToDate().ToShortDateString)) + params.Add(New ReportParameter("Fecha", dr("Fecha").ToString().ToDate().ToShortDateString)) + 'params.Add(New ReportParameter("Nombre", dr("Cuenta").Tostring())) + 'params.Add(New ReportParameter("Cuenta", dr("Codigo").Tostring())) + params.Add(New ReportParameter("Numero", dr("FolioPoliza").ToString())) params.Add(New ReportParameter("Moneda", "")) params.Add(New ReportParameter("CodigoPostal", "")) If UsuarioActual.CveEmpresa = 119 Then - params.Add(New ReportParameter("UsuarioRegistro", GlobalDTUsuarios(dr("CveUsuario").ToString.ToEntero).FiltroPrimeroValor("Nombre"))) - End If - If UsuarioActual.CveEmpresa = 140 Then - params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) + params.Add(New ReportParameter("UsuarioRegistro", GlobalDTUsuarios(dr("CveUsuario").ToString().ToEntero()).FiltroPrimeroValor("Nombre"))) End If If Archivo.Exists Then ruta = UsuarioActual.Empresa.Ruta & "Formatos/Polizas.rdlc" @@ -1916,12 +1925,12 @@ Partial Class ContabilidadC_RegPrePoliza ruta = "Empresas/Grales/Formatos/Polizas.rdlc" End If Bytes = StreamPDF(ruta, dtVC, params, "ppoliza") - If Not File.Exists(String.Format("{0}{1}\{2}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, IdPoliza.ToString)) Then + If Not File.Exists(String.Format("{0}{1}\{2}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, IdPoliza.ToString())) Then DirectoryExistsCreate(String.Format("{0}{1}", AppDomain.CurrentDomain.BaseDirectory, Tick)) - File.WriteAllBytes(String.Format("{0}\{1}\{2}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, IdPoliza.ToString), Bytes) + File.WriteAllBytes(String.Format("{0}\{1}\{2}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, IdPoliza.ToString()), Bytes) End If End If - Return String.Format("{0}\{1}\{2}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, IdPoliza.ToString) + Return String.Format("{0}\{1}\{2}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, IdPoliza.ToString()) ObjConta.Dispose() End Function @@ -1996,9 +2005,6 @@ Partial Class ContabilidadC_RegPrePoliza End If result = True - If Directory.Exists(String.Format("{0}/{1}", AppDomain.CurrentDomain.BaseDirectory, Tick)) Then - Directory.Delete(String.Format("{0}/{1}", AppDomain.CurrentDomain.BaseDirectory, Tick), True) - End If End If Catch ex As Exception End Try @@ -2014,10 +2020,10 @@ Partial Class ContabilidadC_RegPrePoliza Protected Sub DdlProveedores_SelectedIndexChanged1(sender As Object, e As EventArgs) Dim ddl As DropDownList = CType(sender, DropDownList) Dim ddl2 As DropDownList = DirectCast(ddl.BindingContainer, GridViewRow).FCDropDownList("DdlCompras") - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(18, 60) Then - CargaNotasCreditoCompras(ddl.SelectedValue.ToEntero, ddl2) + If DdlConceptosContables.SelectedValue.ToEntero().Contiene(18, 60) Then + CargaNotasCreditoCompras(ddl.SelectedValue.ToEntero(), ddl2) Else - CargaCompras2(ddl.SelectedValue.ToEntero, ddl2) + CargaCompras2(ddl.SelectedValue.ToEntero(), ddl2) End If End Sub @@ -2060,9 +2066,9 @@ Partial Class ContabilidadC_RegPrePoliza Dim NombreArchivo As String SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) Dim workbook As New ExcelFile() - Dim worksheet = workbook.Worksheets.Add(DdlPlantilla2.SelectedItem.Text.ToString) + Dim worksheet = workbook.Worksheets.Add(DdlPlantilla2.SelectedItem.Text.ToString()) - Dim CvePlantilla As Integer = DdlPlantilla2.SelectedValue.ToEntero + Dim CvePlantilla As Integer = DdlPlantilla2.SelectedValue.ToEntero() Dim Dt As DataTable = GlobalDTContaPlantillasPolizasDetalle(CvePlantilla).FiltraParametros(String.Format("CveEmpresa={0}", UsuarioActual.CveEmpresa), "Orden") Dim DtExcel As DataTable = (From row As DataRow In Dt.Rows @@ -2077,8 +2083,8 @@ Partial Class ContabilidadC_RegPrePoliza .Concepto = "", .SubProyecto = row.Item("SubProyecto"), .CveConceptoContable = row.Item("CveConcepto"), - .CveSubProyecto = IIf(row.Item("CveSubProyecto").ToString.ToEntero > 0, row.Item("CveSubProyecto"), -1), - .IdCtaContable = IIf(row.Item("IdCtaContable").ToString.ToEntero > 0, row.Item("IdCtaContable"), -1) + .CveSubProyecto = IIf(row.Item("CveSubProyecto").ToString().ToEntero() > 0, row.Item("CveSubProyecto"), -1), + .IdCtaContable = IIf(row.Item("IdCtaContable").ToString().ToEntero() > 0, row.Item("IdCtaContable"), -1) }).QueryToDataTable(True) worksheet.InsertDataTable(DtExcel, New InsertDataTableOptions() With @@ -2097,7 +2103,7 @@ Partial Class ContabilidadC_RegPrePoliza worksheet.Columns("K").Hidden = True - NombreArchivo = DdlPlantilla2.SelectedItem.Text.ToString + NombreArchivo = DdlPlantilla2.SelectedItem.Text.ToString() workbook.Save(Response, $"{NombreArchivo}.xlsx", SaveOptions.XlsxDefault) @@ -2177,28 +2183,26 @@ Partial Class ContabilidadC_RegPrePoliza Dim TotalAbonos As Integer = 0 - CvePrePoliza = ObjConta.AddPrePolizas("Contabilidad/RegPrePolizaExcel", DdlPlantilla2.SelectedValue.ToEntero, TotalCargos, TotalAbonos, 1, TxtFecha.Text.ToDate, DdlPlantilla2.SelectedItem.Text.ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=DdlTipoPolizaAdd.SelectedValue.ToEntero) + CvePrePoliza = ObjConta.AddPrePolizas("Contabilidad/RegPrePolizaExcel", DdlPlantilla2.SelectedValue.ToEntero(), TotalCargos, TotalAbonos, 1, TxtFecha.Text.ToDate(), DdlPlantilla2.SelectedItem.Text.ToString(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=DdlTipoPolizaAdd.SelectedValue.ToEntero()) For Each Row As DataRow In dt.Rows - NombreCuenta = Row("NombreCuenta").ToString - Cuenta = Row("Cuenta").ToString + NombreCuenta = Row("NombreCuenta").ToString() + Cuenta = Row("Cuenta").ToString() - Dim Importe As Decimal = If(Row("Cargo").ToString.ToDecimal <> 0, Row("Cargo").ToString.ToDecimal, Row("Abono").ToString.ToDecimal) - Dim Concepto As String = Row("Concepto").ToString - Dim Referencia As String = Row("Referencia").ToString + Dim Importe As Decimal = If(Row("Cargo").ToString().ToDecimal() <> 0, Row("Cargo").ToString().ToDecimal(), Row("Abono").ToString().ToDecimal()) + Dim Concepto As String = Row("Concepto").ToString() + Dim Referencia As String = Row("Referencia").ToString() Dim IdCuenta As Integer = -1 - Dim CveSubProyecto As Integer = Row("CveSubProyecto").ToString.ToEntero - Dim TipoMovto As Boolean = If(Row("Cargo").ToString.ToDecimal <> 0, False, True) + Dim CveSubProyecto As Integer = Row("CveSubProyecto").ToString().ToEntero() + Dim TipoMovto As Boolean = If(Row("Cargo").ToString().ToDecimal() <> 0, False, True) Dim YaExiste As Boolean = False - Dim CveConceptoContable As Integer = Row("CveConceptoContable").ToString.ToEntero - Dim IdCtaContable As Integer = Row("IdCtaContable").ToString.ToEntero - 'sino viene el cveconcepto, busca por le nombre del concepto - If CveConceptoContable = 0 Then CveConceptoContable = GlobalDTContaConceptosContables(-1).FiltroPrimeroValor("CveConceptoContable", String.Format("ConceptoContable = '{0}'", Row("ConceptoContable"))).ToEntero + Dim CveConceptoContable As Integer = Row("CveConceptoContable").ToString().ToEntero() + Dim IdCtaContable As Integer = Row("IdCtaContable").ToString().ToEntero() If ObjConta.GetCuentas(-1, Cuenta.Replace("-", ""), 1, UsuarioActual.CveEmpresa) Then If ObjConta.DtResultados.Rows.Count > 0 Then - IdCuenta = ObjConta.DtResultados().FiltroPrimeroValor("CveCuenta").ToEntero + IdCuenta = ObjConta.DtResultados().FiltroPrimeroValor("CveCuenta").ToEntero() 'TipoCuenta = ObjConta.DtResultados().FiltroPrimeroValor("Tipo") Else Reporte.AppendLine($"{Cuenta} - {NombreCuenta} - {Importe}
    ") @@ -2217,7 +2221,7 @@ Partial Class ContabilidadC_RegPrePoliza If YaExiste = False Then If IdCuenta > 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, "", CveConceptoContable, Concepto, Now.ToDate, IdCtaContable, -1, ImporteMX:=Importe, CveSubProyecto:=CveSubProyecto, CveCuenta:=IdCuenta) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, "", CveConceptoContable, Concepto, Now.ToDate(), IdCtaContable, -1, ImporteMX:=Importe, CveSubProyecto:=CveSubProyecto, CveCuenta:=IdCuenta) Then TieneError = True Exit For End If @@ -2235,7 +2239,7 @@ Partial Class ContabilidadC_RegPrePoliza Alert($"Se agregó la póliza {ObjConta.ContaFolio}") Else - Alert($"No encontraron las siguientes cuentas: {Reporte.ToString} ", TipoMensaje.MsgError) + Alert($"No encontraron las siguientes cuentas: {Reporte.ToString()} ", TipoMensaje.MsgError) ObjConta.RollBack() End If @@ -2344,9 +2348,9 @@ Partial Class ContabilidadC_RegPrePoliza For Each Row As DataRow In dt.FiltraParametros("CveConceptoContable = 30").Rows - If ObjIE.GetBancosIE(Row("CveIE").ToString.ToEntero, UsuarioActual.CveEmpresa) Then + If ObjIE.GetBancosIE(Row("CveIE").ToString().ToEntero(), UsuarioActual.CveEmpresa) Then If ObjIE.DtResultados.Rows.Count > 0 Then - Path = String.Format("{0}IE\{1}", UsuarioActual.Empresa.Ruta, ObjIE.Comprobante.ToString) + Path = String.Format("{0}IE\{1}", UsuarioActual.Empresa.Ruta, ObjIE.Comprobante.ToString()) If File.Exists(Path) Then TieneComprobante = True Exit For @@ -2366,53 +2370,5 @@ Partial Class ContabilidadC_RegPrePoliza End Function - Protected Sub LnkImprimirPoliza_Click(sender As Object, e As EventArgs) - ImprimirPolizaPDFRunTime(IdPoliza) - End Sub - Private Function ImprimirPolizaPDFRunTime(IdPoliza As Integer) As String - Dim ObjConta As New ClsContabilidad - 'Dim ObjPoliza As New ClsContPAQi(UsuarioActual.Empresa) - - Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/Polizas.rdlc", UsuarioActual.Empresa.Ruta)) - Dim params As New List(Of ReportParameter) - Dim Bytes As Byte() = Nothing - - - 'If ObjPoliza.GetPoliza(IdPoliza, -1, -1, -1, -1) AndAlso ObjPoliza.DtResultados.Rows.Count > 0 Then - If ObjConta.GetPrePolizasDetalle(CvePrePoliza) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then - Dim dtVC As DataTable - Dim dr As DataRow - dtVC = ObjConta.DtResultados.FiltraParametros("Contabilizable = 1", "Orden") - dr = dtVC.Rows(0) - Dim ruta As String = "" - params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) - params.Add(New ReportParameter("TipoPoliza", dr("TipoPoliza").ToString)) - params.Add(New ReportParameter("Finicio", dr("Fecha").ToString.ToDate.ToShortDateString)) - params.Add(New ReportParameter("FFin", dr("Fecha").ToString.ToDate.ToShortDateString)) - params.Add(New ReportParameter("Fecha", dr("Fecha").ToString.ToDate.ToShortDateString)) - 'params.Add(New ReportParameter("Nombre", dr("Cuenta").ToString)) - 'params.Add(New ReportParameter("Cuenta", dr("Codigo").ToString)) - params.Add(New ReportParameter("Numero", dr("FolioPoliza").ToString)) - params.Add(New ReportParameter("Moneda", "")) - params.Add(New ReportParameter("CodigoPostal", "")) - If UsuarioActual.CveEmpresa = 119 Then - params.Add(New ReportParameter("UsuarioRegistro", GlobalDTUsuarios(dr("CveUsuario").ToString.ToEntero).FiltroPrimeroValor("Nombre"))) - End If - If UsuarioActual.CveEmpresa = 140 Then - params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) - End If - If Archivo.Exists Then - ruta = UsuarioActual.Empresa.Ruta & "Formatos/Polizas.rdlc" - Else - ruta = "Empresas/Grales/Formatos/Polizas.rdlc" - End If - ImprimirbytesPDF(StreamPDF(ruta, dtVC, params, "ppoliza"), String.Format("{0}-{1}", TipoPoliza, dr("FolioPoliza").ToString), "PDF", True) - - End If - Return String.Format("{0}\{1}\{2}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, IdPoliza.ToString) - ObjConta.Dispose() - - End Function - End Class diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 77449b8aa..4cb6b2a66 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -1888,7 +1888,7 @@ Partial Class ContabilidadC_RegPrePolizaS ' Conexion As Odbc.OdbcConnection = Nothing Dim ErrorArchivo = False Dim ErrorExcel = False - + DdlPlantilla.SelectedValue = DdlPlantilla2.SelectedValue dt = ReadExcelFile(Ruta + FileName, True) @@ -1930,35 +1930,21 @@ Partial Class ContabilidadC_RegPrePolizaS If Not ErrorArchivo Then + DtMovimientos.Clear() Dim ObjConta As New ClsContabilidad() ObjConta.IniciaTransacSQL() Try - Dim TieneError As Boolean = False - Dim ContadorUpdate As Integer = 0 - Dim ContadorError As Integer = 0 - Dim NombreCuenta As String = "" - Dim CvePrePoliza As Integer = 0 - Dim Cuenta As String = "" - Dim Reporte As New StringBuilder - Dim TotalCargos As Integer = 0 - Dim TotalAbonos As Integer = 0 - - - CvePrePoliza = ObjConta.AddPrePolizas("Contabilidad/RegPrePolizaExcel", DdlPlantilla2.SelectedValue.ToEntero, TotalCargos, TotalAbonos, 1, TxtFecha.Text.ToDate, DdlPlantilla2.SelectedItem.Text.ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=DdlTipoPolizaAdd.SelectedValue.ToEntero) For Each Row As DataRow In dt.Rows - NombreCuenta = Row("NombreCuenta").ToString - Cuenta = Row("Cuenta").ToString - Dim Importe As Decimal = If(Row("Cargo").ToString.ToDecimal <> 0, Row("Cargo").ToString.ToDecimal, Row("Abono").ToString.ToDecimal) - Dim Concepto As String = Row("Concepto").ToString - Dim Referencia As String = Row("Referencia").ToString - Dim CveCuenta As Integer = -1 + Dim NombreCuenta As String = Row("NombreCuenta").ToString + Dim Cuenta As String = Row("Cuenta").ToString + Dim ConceptoAdministrativo As String = Row("ConceptoAdministrativo").ToString + Dim CveSubProyecto As Integer = Row("CveSubProyecto").ToString.ToEntero Dim TipoMovto As Boolean = If(Row("Cargo").ToString.ToDecimal <> 0, False, True) - Dim YaExiste As Boolean = False Dim CveConceptoContable As Integer = Row("CveConceptoContable").ToString.ToEntero Dim IdCtaContable As Integer = Row("IdCtaContable").ToString.ToEntero Dim CveClasificacion As Integer = -1 @@ -1971,56 +1957,44 @@ Partial Class ContabilidadC_RegPrePolizaS If CveSubProyecto = 0 Then CveSubProyecto = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", String.Format("SubProyecto = '{0}'", Row("SubProyecto"))).ToEntero + Dim dr As DataRow = DtMovimientos.NewRow + Dim CodigoCuenta As String = "" + dr("IdCuenta") = IdCtaContable + dr("CodigoCuenta") = Cuenta & "
    " & NombreCuenta + dr("Cuenta") = ConceptoAdministrativo + dr("Referencia") = Row("Referencia").ToString + dr("Concepto") = Row("Concepto").ToString + dr("TipoMovto") = TipoMovto + dr("EsComodin") = 0 + dr("CveConcepto") = CveConceptoContable + dr("CveConceptoContable") = CveConceptoContable + dr("ConceptoContable") = "" + dr("Cargo") = Row("Cargo").ToString.ToDecimal + dr("Abono") = Row("Abono").ToString.ToDecimal + dr("Descripcion") = "" + dr("CveSubProyecto") = CveSubProyecto + dr("CveProveedor") = -1 + dr("CveCompra") = -1 + dr("CvePersonal") = -1 + dr("CveClasificacion") = CveClasificacion + dr("CveCliente") = -1 + dr("CveVenta") = -1 - If Importe <> 0 Then - - If ObjConta.GetCuentas(-1, Cuenta.Replace("-", ""), 1, UsuarioActual.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - CveCuenta = ObjConta.DtResultados().FiltroPrimeroValor("CveCuenta").ToEntero - 'TipoCuenta = ObjConta.DtResultados().FiltroPrimeroValor("Tipo") - Else - Reporte.AppendLine($"{Cuenta} - {NombreCuenta} - {Importe}
    ") - TieneError = True - YaExiste = True - End If - Else - TieneError = True - Exit For - End If - - - If YaExiste = False Then - If CveCuenta > 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, "", CveConceptoContable, Concepto, Now.ToDate, IdCtaContable, -1, ImporteMX:=Importe, CveSubProyecto:=CveSubProyecto, CveClasificacion:=CveClasificacion, CveCuenta:=CveCuenta) Then - TieneError = True - Exit For - End If - Else - CveCuenta = -2 - End If - End If - - End If - + TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero + TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero + DtMovimientos.Rows.Add(dr) + DtMovimientos.AcceptChanges() Next - If Not TieneError Then - ObjConta.Commit() - Alert(String.Format("

    Prepóliza: {1}", CvePrePoliza, "Ver")) - Alert($"Se agregó la póliza {ObjConta.ContaFolio}") - - Else - Alert($"No encontraron las siguientes cuentas: {Reporte.ToString} ", TipoMensaje.MsgError) - ObjConta.RollBack() - End If + GvMov.DataSource = DtMovimientos + GvMov.DataBind() + UPMovs.Update() Catch ex As Exception - ObjConta.RollBack() + Alert("No se pudo cargar el excel") End Try - - ObjConta.Dispose() End If End Sub #End Region diff --git a/Contratos/Contrato.aspx b/Contratos/Contrato.aspx index 72adfa923..7fb92b014 100644 --- a/Contratos/Contrato.aspx +++ b/Contratos/Contrato.aspx @@ -2003,7 +2003,7 @@
    - + diff --git a/Contratos/Contrato.aspx.vb b/Contratos/Contrato.aspx.vb index 346bf361c..62fc596a4 100644 --- a/Contratos/Contrato.aspx.vb +++ b/Contratos/Contrato.aspx.vb @@ -1021,6 +1021,7 @@ Partial Class Contratos_Default If ObjContratos.DtResultados.Rows(0)("CvePeriodo").ToString().ToEntero() > 0 Then DdlPeriodo.SelectedValueExist(ObjContratos.DtResultados.Rows(0)("CvePeriodo").ToString().ToEntero()) DdlPeriodo_SelectedIndexChanged(DdlPeriodo, EventArgs.Empty) + DdlDiaFact.SelectedValueExist(ObjContratos.DtResultados.Rows(0)("DiaMesFacturacion").ToString()) End If UpFacCiclica.Update() @@ -1235,6 +1236,16 @@ Partial Class Contratos_Default Exit Sub End If + If ChkAplicaFacCiclica.Checked AndAlso DdlPeriodo.SelectedValue.ToEntero() <= 0 Then + Alert("Debe seleccionar un periodo para la facturación ciclica", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + If ChkAplicaFacCiclica.Checked AndAlso DdlDiaFact.SelectedValue.ToEntero() <= 0 Then + Alert("Debe seleccionar un día para la facturación ciclica", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + Dim TieneError = False Dim Modificado = False ' Dim Extension = Session("FileExtension").ToString @@ -1508,7 +1519,8 @@ Partial Class Contratos_Default For Ciclo As Integer = 1 To CiclosComercialesEnMeses Dim FechaRef As DateTime = FechaI.AddMonths(PeriodoMeses * Ciclo) Dim lastDayOfMonth = DateTime.DaysInMonth(FechaRef.Year, FechaRef.Month) - Dim DiaMes As Integer = If(FechaRef.Day < DdlDiaFact.SelectedValue.ToEntero(), lastDayOfMonth, DdlDiaFact.SelectedValue.ToEntero()) + + Dim DiaMes As Integer = If(lastDayOfMonth < DdlDiaFact.SelectedValue.ToEntero(), lastDayOfMonth, DdlDiaFact.SelectedValue.ToEntero()) Dim FechaFact = New DateTime(FechaRef.Year, FechaRef.Month, DiaMes) FechaFact = If(FechaFact > FechaF, FechaF, FechaFact) @@ -2304,7 +2316,7 @@ Partial Class Contratos_Default If ObjContratos.RemoveContratosDetalle(CveContratoDetalle, CveContrato) Then TmpDT.Rows.Remove(DbRow) CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1")) - LbTotalGeneralInsumos.Text = GvInsumos.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.FCLiteral("LtTotal").Text.ToDouble).ToString.FormatoNumero + LbTotalGeneralInsumos.Text = GvInsumos.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.FCLabel("LtTotal").Text.ToDouble).ToString.FormatoNumero Else Alert("Ocurrió un error al eliminar el detalle (Producto/Servicio). Por favor vuelva a intentar", TipoMensaje.MsgError) End If diff --git a/Contratos/FacturacionMasiva.aspx b/Contratos/FacturacionMasiva.aspx index 431aa81db..401c20d94 100644 --- a/Contratos/FacturacionMasiva.aspx +++ b/Contratos/FacturacionMasiva.aspx @@ -1,166 +1,167 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="FacturacionMasiva.aspx.vb" Inherits="Contratos_FacturacionMasiva" %> - - - - - - - Facturación Masiva - - - - -
  • - - +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="FacturacionMasiva.aspx.vb" Inherits="Contratos_FacturacionMasiva" %> + + + + + + + Facturación Masiva + + + + +
  • + + - Facturar Todas - - -
  • -
    - - - - - - -
    -
    -
    - - -
    -
    -
      + Facturar Todas + + + + + + + + + + +
      +
      +
      + + +
      +
      +
      • Cliente: - -
      • + + +
      • Contrato: - - -
      • -
      • - Sucursal: - - - -
      • -
      -
      -
      - -
      -
      -
      - - -
      -
      - - - - - - - - - - - - - - - -
      -
      -
      -
      -
      - - -
      -
      - -
      -
      -
      -
      - - - -
      - - - + + + +
    • Sucursal: + + + + +
    • +
    +
    +
    + +
    +
    +
    + + +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + +
    +
    + +
    +
    +
    +
    + + + +
    + + + diff --git a/Contratos/FacturacionMasiva.aspx.vb b/Contratos/FacturacionMasiva.aspx.vb index 8deac32ec..17d923bba 100644 --- a/Contratos/FacturacionMasiva.aspx.vb +++ b/Contratos/FacturacionMasiva.aspx.vb @@ -202,22 +202,35 @@ Partial Class Contratos_FacturacionMasiva RegistraScript("$('#ex').removeClass('expand');$('#ex').addClass('collapse');$('.portlet-body').css('display', '');") End Sub - Protected Sub ImgFacturarTodos_Click(sender As Object, e As EventArgs) Handles BtnFacturar.Click - EjecutarFacturacion() + Protected Sub ImgFacturarTodos_Click(sender As Object, e As EventArgs) Handles ImgFacturarTodos.Click + EjecutarFacturacion(FacturarTodos:=True) + Dim CveContrato As Integer = If(DdlContrato.SelectedValue.ToEntero <= 0, -1, DdlContrato.SelectedValue.ToEntero) + Dim CveCliente As Integer = If(DdlCliente.SelectedValue.ToEntero <= 0, -1, DdlCliente.SelectedValue.ToEntero) + + CargaDatos(CveContrato, CveCliente) + End Sub + + Protected Sub btnFacturarAqui_Click(sender As Object, e As EventArgs) Handles BtnFacturar.Click + EjecutarFacturacion(FacturarTodos:=False) + + Dim CveContrato As Integer = If(DdlContrato.SelectedValue.ToEntero <= 0, -1, DdlContrato.SelectedValue.ToEntero) + Dim CveCliente As Integer = If(DdlCliente.SelectedValue.ToEntero <= 0, -1, DdlCliente.SelectedValue.ToEntero) + + CargaDatos(CveContrato, CveCliente) + RegistraScript("$('#divAgregar').modal('hide')") + UpBodyEstatus.Update() End Sub - Private Sub EjecutarFacturacion() + Private Sub EjecutarFacturacion(Optional FacturarTodos As Boolean = False) Dim FacturadoCorrecto = True Dim sb As New StringBuilder() For Each row As GridViewRow In GvCiclosComerciales.Rows - If row.FCCheckBox("chkDis").Checked Then + If FacturarTodos OrElse row.FCCheckBox("chkDis").Checked Then Dim Resp = EmitirImprimir(row.DataKey("CveCicloComercial").ToString.ToEntero) - For Each Msg In Resp.Mensajes - sb.AppendFormat("{0}

    ", Msg) - Next + sb.AppendFormat("{0}

    ", Resp.Mensaje) If Not FacturadoCorrecto Then If Mensaje = "" Then @@ -234,155 +247,75 @@ Partial Class Contratos_FacturacionMasiva Else Alert("No se generaron facturas", TipoMensaje.MsgAdvertencia) End If - - Dim CveContrato As Integer = If(DdlContrato.SelectedValue.ToEntero <= 0, -1, DdlContrato.SelectedValue.ToEntero) - Dim CveCliente As Integer = If(DdlCliente.SelectedValue.ToEntero <= 0, -1, DdlCliente.SelectedValue.ToEntero) - - CargaDatos(CveContrato, CveCliente) - RegistraScript("$('#divAgregar').modal('hide')") - UpBodyEstatus.Update() End Sub - Protected Sub btnFacturarAqui_Click(sender As Object, e As EventArgs) - EjecutarFacturacion() - End Sub - Private Function EmitirImprimir(pCveCicloComercial As Integer) As Modelos.Factura.MMensajeFactura - Dim Resp As New Modelos.Factura.MMensajeFactura + + Private Function EmitirImprimir(pCveCicloComercial As Integer) As MMensajeFacturacion + Dim Retorno As New MMensajeFacturacion + ViewState("CveCicloComercial") = pCveCicloComercial CreaObjetosVenta() If ObjFactura Is Nothing Or ObjFactura.Cliente Is Nothing Then Alert("Ocurrió un error al procesar los datos de la Venta.", TipoMensaje.MsgError) ObjFactura = Nothing - Return Resp + Return Retorno End If - If ObjFactura.CveCliente > 0 Then If ObjFactura.DtDetalle.Rows.Count > 0 Then + Dim TieneError As Boolean = False + Dim RespFactura As Modelos.Factura.MMensajeFactura = Nothing + + Try + RespFactura = ObjFactura.EmitirFactura(Timbrar:=False) + + If RespFactura IsNot Nothing AndAlso RespFactura.CveVenta <= 0 OrElse RespFactura.TieneError Then + TieneError = True + End If + Catch ex As Exception + TieneError = True + OnError("Ocurrió un error al generar la factura", ex) + End Try + + If Not TieneError AndAlso RespFactura.CveVenta > 0 Then + Retorno.CveVenta = RespFactura.CveVenta + Retorno.SerieFolio = RespFactura.SerieFolio + Retorno.SeTimbro = ObjFactura.TimbrarFactura() + End If + + Dim SbMensajes As New StringBuilder + + If Not TieneError Then + SbMensajes.AppendFormat("La factura {1} se guardo correctamente.", Retorno.CveVenta, Retorno.SerieFolio) + + If Not Retorno.SeTimbro Then + SbMensajes.AppendFormat("
    La factura no se pudo timbrar.") + End If + Else + SbMensajes.Append("Ocurrió un error al generar la factura.") + If RespFactura IsNot Nothing Then + For Each msg As String In RespFactura.Mensajes + SbMensajes.Append(msg) + Next + End If + End If + + Retorno.Mensaje = SbMensajes.ToString() - Resp = ObjFactura.EmitirFactura() - - 'Dim ObjVentas As New ClsVentas() - 'Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL()) - 'Dim ObjInventario As New ClsInventarios(ObjVentas.IniciaTransacSQL()) - 'Dim ObjContr As New ClsContratos(ObjVentas.IniciaTransacSQL()) - 'Dim ObjOS As New ClsOS(ObjVentas.IniciaTransacSQL()) - 'Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL()) - 'Dim ObjClientes As New ClsClientes(ObjVentas.IniciaTransacSQL()) - 'Dim ObjContPaq As ClsContPAQi = Nothing - ''Dim ObjFolios As New ClsGralFolios(ObjVentas.IniciaTransacSQL()) - 'ErrorList = New List(Of String) - 'MensajeAlert = New StringBuilder - - - ''CONTABILIDAD AUTOMATICA Y AC - 'If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then - ' ObjContPaq = New ClsContPAQi(UsuarioActual.Empresa) - 'End If - - - ''GUARDA VENTA - 'GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS) - - 'If pCveCicloComercial > 0 AndAlso ErrorList.Count = 0 Then - ' If Not ObjContr.CicloComercialUpdate(pCveCicloComercial, True, UsuarioActual.CveEmpresa) Then - ' ErrorList.Add("No se pudo actualizar ") - ' End If - 'End If - - 'If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 AndAlso (SeGuardoPrePoliza Or ObjFactura.TipoDocto.Contiene("Ped", "Cot")) Then - ' ObjVentas.Commit() - ' If ObjContPaq IsNot Nothing Then ObjContPaq.Commit() - ' ViewState("CveVenta") = ObjFactura.CveVenta - - - ' Dim SeTimbro As Boolean = False - ' 'TIMBRADO Y CASO ESPECIAL NOTA DE CREDITO - - ' If ObjFactura.TipoDocto.Contiene("Ing", "Egs", "Ant") Then - ' If UsuarioActual.Empresa.TipoFacturacion = "CFDi" AndAlso UsuarioActual.Empresa.FacturaProduccion Then - - ' Dim sw As New Diagnostics.Stopwatch - ' sw.Start() - - ' 'FACTURA INGRESO/EGRESO - ' Dim ObjTimbrado As New Timbrado - - - ' SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) - - ' sw.Stop() - ' GuardaLogTimbrado(sw.ElapsedMilliseconds.ToString, UsuarioActual.Empresa.CvePAC) - ' End If - - - ' 'MENSAJE PRINCIPAL - ' MensajeAlert.AppendFormat(String.Format("
    La {0}: {1} se generó correctamente.

    ", ObjFactura.TipoDocumento, ObjFactura.SerieFolio)) - - - ' If SeTimbro Then - ' 'XML - ' Dim ArchivoXML = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio) - ' If File.Exists(ArchivoXML) Then - ' MensajeAlert.AppendFormat("", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", ObjFactura.CveVenta, "XML", ObjFactura.SerieFolio, ObjFactura.TipoDocto))) - ' End If - - ' 'IMPRESION - ' GeneraPDFFactura(False) - ' Else - ' MensajeAlert.AppendFormat("La factura no se pudo timbrar. Por favor intentelo de nuevo a traves del boton Emitir o póngase en contacto con soporte técnico.") - ' End If - - ' 'MUESTA ALERT OK - ' Dim Liga = If(UsuarioActual.CveRol = 1165, "document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";", $"document.location.href=""/Ventas/Clientes.aspx?CveCliente={ObjFactura.CveCliente}&Opt=3"";") - ' retorno = True - ' ObjFactura = Nothing - ' Else - ' ObjVentas.RollBack() - ' If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack() - - ' For Each ErrorItem In ErrorList - ' Alert(ErrorItem, TipoMensaje.MsgAdvertencia) - ' Next - - ' 'MUESTA ALERT ERROR - ' Alert("Ocurrió un error al procesar los datos. Por favor rectifique y vuelta a intentar.", TipoMensaje.MsgError) - ' End If - - ' ObjVentas.Dispose() - ' ObjConta.Dispose() - ' ObjInventario.Dispose() - ' ObjContr.Dispose() - ' ErrorList = Nothing - ' MensajeAlert = Nothing - ' If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose() - 'Else - ' ObjVentas.RollBack() - ' If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack() - - ' For Each ErrorItem In ErrorList - ' Alert(ErrorItem, TipoMensaje.MsgAdvertencia) - ' Next - - ' 'MUESTA ALERT ERROR - ' Alert("Ocurrió un error al procesar los datos. Por favor rectifique y vuelta a intentar.", TipoMensaje.MsgError) - ' ObjVentas.Dispose() - ' ObjConta.Dispose() - ' ObjInventario.Dispose() - ' ObjContr.Dispose() - ' 'ObjFolios.Dispose() - ' ErrorList = Nothing - ' MensajeAlert = Nothing - ' If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose() - 'End If Else - Mensaje = "No se pudo completar facturación por que no se encontraron partidas " + Retorno.Mensaje = "No se pudo completar facturación por que no se encontraron partidas " End If + End If + + If ObjFactura IsNot Nothing Then + ObjFactura.Dispose() + End If + TmpDT.Clear() - Return Resp + Return Retorno End Function @@ -500,13 +433,13 @@ Partial Class Contratos_FacturacionMasiva ObjFactura.Folio = -1 ObjFactura.Serie = "-1" ObjFactura.CveMesa = -1 - ObjFactura.Fecha = DR("FechaVenc").ToString.ToDate + ObjFactura.Fecha = DR("FechaVenc").ToString.ToDate 'If(DR("FechaVenc").ToString.ToDate > Now, Now, DR("FechaVenc").ToString.ToDate) ObjFactura.CvePrePoliza = -1 ObjFactura.CveMetodoPago = 1 ObjFactura.MetodoPago = "Efectivo" ObjFactura.FechaPago = DateTime.Today ObjFactura.MotivoDescuento = "" - ObjFactura.Observaciones = TxtObservaciones.Text + " " + DR("Observaciones").ToString + ObjFactura.Observaciones = If(String.IsNullOrEmpty(TxtObservaciones.Text), "", TxtObservaciones.Text + " ") + DR("Observaciones").ToString ObjFactura.FechaEjecucion = DateTime.Today 'ObjFactura.ClaveMetodoPagoSAT = GlobalDTMetodosPago.FiltroPrimeroValor("ClaveSAT", $"CveMetodoPago = {1}") ObjFactura.UsuarioCreo = UsuarioActual.Usuario @@ -643,7 +576,10 @@ Partial Class Contratos_FacturacionMasiva ObjFactura.SetSubProyecto(Me) ObjFactura.Timbre = PreParaTimbre(ObjFactura) - + ObjFactura.FemsaFactura = New Modelos.FemsaFactura() With { + .AplicaFEMSA = False, + .FEMSA_Version = 1 + } End Sub Private Function PreParaTimbre(Obj As Modelos.Factura) As CFDITimbre @@ -769,372 +705,11 @@ Partial Class Contratos_FacturacionMasiva Return Timbre End Function - Private Sub GuardarVenta(ObjVentas As ClsVentas, ObjConta As ClsContabilidad, ObjInventario As ClsInventarios, ObjContr As ClsContratos, factura As Modelos.Factura, TmpDTDetalle As DataTable, CveNCaVincular As Integer, objContPaqi As ClsContPAQi, Optional ObjBancos As ClsBancos = Nothing, Optional ObjOS As ClsOS = Nothing) - - Dim Msgok As New StringBuilder - Dim CveAlmacenTraspasoOrigen As Integer = -1 - Dim CveAlmacenTraspasoDestino As Integer = -1 - Dim EsDevolucionVenta = -1 - Dim CveSubProyecto = TmpDTDetalle.Rows(0)("CveSubProyecto").ToString.ToEntero - - - factura.CvePrePoliza = ObjConta.AddPrePolizas("Contratos/FacturacionMasiva", factura.CvePlantillaPoliza, factura.Total, factura.Total, factura.CveMoneda, factura.Fecha, factura.Cliente.Nombre, factura.CveUsuario, factura.CveEmpresa) - If Not ObjVentas.AddVenta(factura.TipoDocto, factura.Folio, factura.CveCliente, factura.CveClienteSucursal, factura.SubTotalTC, factura.DescuentoTC, - factura.AmortizacionTC, factura.IVATC, factura.RetIVATC, factura.RetISRTC, - factura.TotalTC, factura.CveMoneda, factura.TipoCambio, factura.CveMetodoPago, factura.CondicionesPago, factura.FormaPago, factura.FechaPago, factura.Fecha, factura.MotivoDescuento, - factura.Observaciones, factura.FechaEjecucion, factura.CveVendedor, factura.Alfa1, factura.Alfa2, - factura.Alfa3, factura.Num1, factura.Num2, factura.Num3, - factura.Fech1, factura.Fech2, factura.Fech3, factura.CveCorte, factura.CveMesa, factura.NumeroPersonas, factura.CvePrePoliza, factura.CveUsuario, factura.CveEmpresa, - AtencionA:=factura.AtencionA, TelefonoGenerico:="", CveContrato:=factura.CveContrato, CveVentaPadre:=factura.CveVentaPadre, Det_FechaOrdenCompra:=factura.Det_FechaOrdenCompra, Det_OrdenCompra:=factura.Det_OrdenCompra, otros:=factura.Otros, - Entrega:="", Vigencia:=MinFecha, - CveAlmacenTraspasoDestino:=CveAlmacenTraspasoDestino, CveAlmacenTraspasoOrigen:=CveAlmacenTraspasoOrigen, CveDireccionEnvio:=-1, CveOC:=-1, IEPS:=factura.IEPSTC, Serie:=factura.Serie, CveCondicionEntrega:=-1, - PedidoContrato:="", CveSubProyecto:=CveSubProyecto, CveSubProyectoCobranza:=CveSubProyecto, CveSubProyectoEjecucion:=CveSubProyecto, CveFormaPago33:=factura.CveFormaPago33, - CveMetodoPago33:=factura.CveMetodoPago33, CveUsoCFDI:=factura.CveUsoCFDI) Then - ErrorList.Add("Ocurrió un error al Generar la Venta.
    Revise su factura y cualquier detalle comuníquese a Soporte Técnico") - End If - - - If ErrorList.Count = 0 AndAlso ObjVentas.CveVenta > 0 Then - - factura.CveVenta = ObjVentas.CveVenta - factura.Serie = ObjVentas.Serie - factura.Folio = ObjVentas.Folio - ViewState("VentaFolio") = ObjVentas.SerieFolio - - 'Se agregan los PS - For Each Row As DataRow In TmpDTDetalle.Rows - Dim Observacion As String = Row("Observacion").ToString - If TxtObservaciones.Text.Trim <> "" Then - Observacion = $"{Observacion} {TxtObservaciones.Text}" - End If - - If Not ObjVentas.AddVentaDetalle(ObjVentas.CveVenta, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("CveUM").ToString.ToEntero, - Row("PU").ToString.ToDouble(If(ObjFactura.ConvertirPesos, factura.TipoCambio, 1)), Row("IVA").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Math.Round((Row("Total").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)) * (1 + Row("IVA").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)))), 6), - Observacion, 0, 0, Row("CveSubProyecto").ToString.ToEntero, -1, - TiempoEntrega:="", CveVentaDetallePadre:=-1, CveContratoDetalle:=Row("CveContratoDetalle").ToString.ToEntero, CvePromocionDetalle:=-1, IEPS:=Row("ImporteIEPS").ToString.ToDouble, - ImporteRetIVA:=Row("ImporteRetIVA").ToString.ToDouble, ImporteRetISR:=Row("ImporteRetISR").ToString.ToDouble, - PorcentajeIEPS:=Row("PorcentajeIEPS").ToString.ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString.ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString.ToDouble) Then - ErrorList.Add("Ocurrió un error al agregar un Producto o Servicio a la Factura.
    Revise su factura y cualquier detalle comuníquese a Soporte Técnico") - Exit For - Else - Dim TmpDr As DataRow = TmpDT.Select($"Consec = {Row("Consec").ToString}")(0) - TmpDr("CveVentaDetalle") = ObjVentas.CveVentaDetalle - End If - Next - - GuardarContratoAvanceEstimaciones(ObjVentas, factura, ErrorList, 1) - - If ErrorList.Count = 0 Then - 'prepoliza - GuardarVentaPrePolizas(ObjConta, factura, TmpDTDetalle, CveNCaVincular, objContPaqi, ObjBancos, ObjVentas) - End If - - End If - End Sub - Private Sub GuardarVentaPrePolizas(ObjConta As ClsContabilidad, factura As Modelos.Factura, TmpDTDetalleMovimientos As DataTable, CveNCaVincular As Integer, objContPaqi As ClsContPAQi, Optional ObjBancos As ClsBancos = Nothing, ByRef Optional ObjVentas As ClsVentas = Nothing) - - Dim CveIE As Integer = -1 - Dim DT As DataTable = Nothing - - - Dim CveConceptoAfectacion As Integer = 1 'Cliente - Dim CveConceptoAntCli As Integer = 3 'Anticipo Cliente - Dim CveConceptoVenta As Integer = 4 'Venta - Dim CveConceptoCanAnt As Integer = 11 'Cancelacion Anticipos - Dim CveConceptoDSV As Integer = 12 ' DSV - Dim CveConceptoIVA As Integer = 13 'IVA Trasladado - Dim CveConceptoRetIVA As Integer = 8 'Ret IVA - Dim CveConceptoRetISR As Integer = 9 'Ret ISR - 'P R E P O L I Z A S - If factura.CvePrePoliza > 0 Then - - If ProcesoPrepolizas(ObjConta, factura, CveIE, TmpDTDetalleMovimientos, objContPaqi, 1, ObjBancos, ObjVentas) Then - ErrorList.Add("Ocurrió un error al agregar los Movimientos de la prepoliza.
    Revise su factura y cualquier detalle comuníquese a Soporte Técnico") - End If - - Else - ErrorList.Add("Ocurrió un error al agregar los Movimientos de la prepoliza.
    Revise su factura y cualquier detalle comuníquese a Soporte Técnico") - End If - End Sub - - Private Function ProcesoPrepolizas(ObjConta As ClsContabilidad, ObjFactura As Modelos.Factura, CveIE As Integer, TmpDTDetalle As DataTable, objContPaqi As ClsContPAQi, Optional ValorMultiplicador As Integer = 1, ByRef Optional ObjBancos As ClsBancos = Nothing, ByRef Optional ObjVentas As ClsVentas = Nothing) As Boolean - - Dim DT As DataTable - Dim CvePlantilaPoliza As Integer - Dim PorcentajeAmortizacion As Decimal = 0 - Dim sumaAmorticaciones As Decimal = 0 - Dim ivaTrasladado As Decimal = 0 - Dim retIvaTrasladado As Decimal = 0 - Dim retIsrTrasladado As Decimal = 0 - Dim ErrorPrepoliza As Boolean = False - Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:

    " - Dim idCuentaContabilizacion As Integer = 1 - Dim tipoCambio As Decimal - Dim CuentasContablesInvalidas As New StringBuilder - - If ObjFactura.TipoDocto = "Ing" Or ObjFactura.TipoDocto = "Ant" Or ObjFactura.TipoDocto = "Com" Then - CvePlantilaPoliza = 4 - ElseIf ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then - CvePlantilaPoliza = 7 - ElseIf ObjFactura.TipoDocto = "Rem" Then - CvePlantilaPoliza = 4 - End If - - If ObjFactura.CveMoneda = 2 Then - tipoCambio = GlobalTipoCambio(ObjFactura.Fecha).ToString.ToDecimal - Else - tipoCambio = 1 - End If - - Dim ConceptoContable As Integer - Dim TipoMovimiento As Boolean - Dim importeMovimiento As Decimal - Dim FechaMovimiento As Date = Date.Today - Dim IdCtaContable As Integer - Dim CveCuenta As Integer - Dim IdCtaContableCliente As Integer - Dim Concepto As String = ViewState("VentaFolio").ToString - Dim Referencia As String = ViewState("VentaFolio").ToString - Dim Fecha = ObjFactura.Fecha - - Dim importeMX As Decimal - Dim Multiplicador As Integer - 'Dim CveIEPago As Integer - ' Dim FolioIE As Long - - If ObjConta.GetPlantillaConceptos(ObjFactura.CveEmpresa, CvePlantilaPoliza) Then - For Each Row As DataRow In ObjConta.DtResultados.Rows - - ConceptoContable = Row("CveConcepto").ToString.ToEntero - TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False) - importeMovimiento = 0 - IdCtaContable = 0 - CveCuenta = 0 - Multiplicador = (Row("Multiplicador").ToString.ToEntero) - Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", "") - - Dim PorcentajeImpuesto As Decimal = 0 - - Select Case ConceptoContable - Case 1 'Cliente - If ObjFactura.TipoDocto <> "Egs" Then - importeMovimiento = (ObjFactura.Total) * ValorMultiplicador - importeMX = importeMovimiento * tipoCambio * Multiplicador - FechaMovimiento = ObjFactura.FechaPago - If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" - - If tipoCambio = 1 Then - IdCtaContable = ObjFactura.Cliente.IdCtaContClientes - Else - IdCtaContable = ObjFactura.Cliente.IdCtaContComplementaria - If importeMovimiento <> 0 AndAlso IdCtaContable > 0 Then - importeMX = importeMovimiento - If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, 0, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMovimiento * tipoCambio - importeMovimiento, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento)) Then - ErrorPrepoliza = True - End If - End If - - IdCtaContable = ObjFactura.Cliente.IdCtaContMonedaExtranjera - End If - IdCtaContableCliente = IdCtaContable - End If - - Case 4 'Venta Clasificacion - - If ObjFactura.TipoDocto <> "Ant" Then - DT = TmpDTDetalle.FiltraParametros($"CvePS <> {0}", "", {"CveClasificacion", "CveSubProyecto"}) - If DT.Rows.Count > 0 Then - 'Se agrega movimiento separado por la cuenta de ventas (ER) - For Each Row2 As DataRow In DT.Rows - importeMovimiento = (TmpDTDetalle.SUM("Total", String.Format("CveClasificacion = {0} AND CveSubProyecto = {1}", Row2("CveClasificacion"), Row2("CveSubProyecto"))).ToString.ToDecimal) * ValorMultiplicador - importeMX = importeMovimiento * tipoCambio * Multiplicador - FechaMovimiento = ObjFactura.FechaPago - Concepto = $"{ViewState("VentaFolio").ToString} {If(Row2("CveClasificacion").ToString.ToEntero > 0, GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}"), "")} - {If(Row2("CveSubProyecto").ToString.ToEntero > 0, GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("SubProyecto", $"CveSubProyecto = {Row2("CveSubProyecto").ToString}"), "Sin SubProyecto Asignado")}" - If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" - IdCtaContable = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaIngresos", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero - If importeMovimiento <> 0 Then - - If IdCtaContable <= 0 Then - CuentasContablesInvalidas.Append("
    " & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString + GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}")) - idCuentaContabilizacion = 0 - End If - - If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, CveClasificacion:=Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento)) Then - ErrorPrepoliza = True - Else - ViewState("SeGuardoPrePoliza") = True - End If - End If - Next - End If - End If - importeMovimiento = 0 - - Case 8 'Ret IVA por Trasladar - If Not ObjFactura.TipoDocto.Contiene("Rem") Then - importeMovimiento = ObjFactura.RetIVA * ValorMultiplicador - importeMX = Math.Round(importeMovimiento, 2) * tipoCambio * Multiplicador - FechaMovimiento = ObjFactura.FechaPago - If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" - - 'Contabilidad ContPAQ - If IdCtaContRetIVA > 0 Then - IdCtaContable = IdCtaContRetIVA - Else - If ObjConta.GetRetCuenta(ConceptoContable, ObjFactura.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero - End If - End If - End If - - 'Contabilidad SIG - If CveCuentaRetIVA > 0 Then - CveCuenta = CveCuentaRetIVA - Else - If ObjConta.GetRetCuenta(ConceptoContable, ObjFactura.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacionSIG").ToString.ToEntero - End If - End If - End If - End If - - Case 9 'Ret ISR por Trasladar - If Not ObjFactura.TipoDocto.Contiene("Rem") Then - importeMovimiento = ObjFactura.RetISR * ValorMultiplicador - importeMX = Math.Round(importeMovimiento, 2) * tipoCambio * Multiplicador - FechaMovimiento = ObjFactura.FechaPago - If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" - - 'Contabilidad ContPAQ - If IdCtaContRetISR > 0 Then - IdCtaContable = IdCtaContRetISR - Else - If ObjConta.GetRetCuenta(ConceptoContable, ObjFactura.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero - End If - End If - End If - - 'Contabilidad SIG - If CveCuentaRetISR > 0 Then - CveCuenta = CveCuentaRetISR - Else - If ObjConta.GetRetCuenta(ConceptoContable, ObjFactura.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero - End If - End If - End If - End If - - - - Case 13 'Iva por Trasladar - importeMovimiento = ObjFactura.IVA * ValorMultiplicador - importeMX = Math.Round(importeMovimiento, 2) * tipoCambio * Multiplicador - FechaMovimiento = ObjFactura.FechaPago - IdCtaContable = UsuarioActual.Empresa.IdCuentaIVAxTrasladar - If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" - PorcentajeImpuesto = TmpDTDetalle.MAX("PorcentajeIVA").ToDecimal - - Case 38 'IEPS por Trasladar - If Not ObjFactura.TipoDocto.Contiene("Rem") Then - importeMovimiento = ObjFactura.IEPS * ValorMultiplicador - importeMX = Math.Round(importeMovimiento * tipoCambio * Multiplicador, 2) - FechaMovimiento = ObjFactura.Fecha - If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" - If importeMovimiento > 0 AndAlso ObjConta.GetRetCuenta(ConceptoContable, ObjFactura.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxTrasladar").ToString.ToEntero - CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxTrasladarSIG").ToString.ToEntero - End If - End If - PorcentajeImpuesto = TmpDTDetalle.MAX("PorcentajeIEPS").ToDecimal - End If - - End Select - - If importeMovimiento <> 0 Then - - If IdCtaContable <= 0 Then - CuentasContablesInvalidas.Append("
    " & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) - idCuentaContabilizacion = 0 - End If - - If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), PorcentajeImpuesto:=PorcentajeImpuesto) Then - ErrorPrepoliza = True - Else - ViewState("SeGuardoPrePoliza") = True - End If - - End If - - Next - - End If - - Return ErrorPrepoliza - End Function - - Private Sub GeneraPDFFactura(EnviaCorreo As Boolean) - - - 'If Not ImprimeAlert Then - Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/Factura.rdlc", UsuarioActual.Empresa.Ruta)) - Dim Archivo2 As New System.IO.FileInfo(String.Format("{0}Formatos/Remision.rdlc", UsuarioActual.Empresa.Ruta)) - - 'CASO NORMAL NEW - If Archivo.Exists Or Archivo2.Exists Then - MensajeAlert.AppendFormat("
    ", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", ObjFactura.CveVenta))) - Else - MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ") - End If - - - Dim pdf As Byte() = Nothing - - 'GUARDA PDF - Dim LocalSerieFolio As String = String.Empty - Dim LocalTipoDocto As String = String.Empty - - - 'TIMBRADO NUEVO - Try - pdf = PdfFactura(ObjFactura) - ' File.WriteAllBytes(String.Format("{0}PDF/{1}/{2}.pdf", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio), pdf) - Catch ex As Exception - Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia) - End Try - - LocalSerieFolio = ObjFactura.SerieFolio - LocalTipoDocto = ObjFactura.TipoDocto - 'End If - - End Sub - - Private Sub GuardarContratoAvanceEstimaciones(ObjVentas As ClsVentas, factura As Modelos.Factura, ErrorList As List(Of String), Multiplicador As Integer, Optional CrearAvance As Boolean = False) - - If factura.CveContrato > 0 Then - Dim ObjContratos As New ClsContratos(ObjVentas.IniciaTransacSQL()) - Dim CveEstimacion As Integer = -1 - - If ObjContratos.AddEstimaciones(factura.CveContrato, factura.Fecha, -1, factura.CveVenta, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then - CveEstimacion = ObjContratos.DtResultados(0)("CveEstimacion").ToString.ToEntero - - For Each row As DataRow In TmpDT.Rows - If Not ObjContratos.AddContratosAvance(row("CveContratoDetalle").ToString.ToEntero, row("Cantidad").ToString.ToEntero * Multiplicador, factura.Fecha, UsuarioActual.CveUsuario, CveEstimacion:=CveEstimacion) Then - ErrorList.Add("Ocurrió un error al agregar los avances") - End If - Next - - Else - ErrorList.Add("Ocurrió un error al agregar las estimaciones") - End If - End If - - End Sub + Public Class MMensajeFacturacion + Public Property CveVenta As Integer = -1 + Public Property SerieFolio As String = "" + Public Property Mensaje As String = "" + Public Property SeTimbro As Boolean = False + End Class End Class diff --git a/Empresas/141/Formatos/Factura.rdlc b/Empresas/141/Formatos/Factura.rdlc index 9d467856f..c50c98442 100644 --- a/Empresas/141/Formatos/Factura.rdlc +++ b/Empresas/141/Formatos/Factura.rdlc @@ -1348,7 +1348,7 @@ - ="<b>Próxima Rotación y Balanceo: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) & " <b>Próxima Alineacion: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) + ="<br/><b>Próxima Rotación y Balanceo: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) & "<br/<b>Próxima Alineación: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) HTML - =Parameters!OrdenCompra.Value + =IIf(Parameters!OrdenCompra.Value = "-1", "", Parameters!OrdenCompra.Value) - =Parameters!OrdenCompra.Value + =IIf(Parameters!OrdenCompra.Value = "-1", "", Parameters!OrdenCompra.Value) - ="<b>Próxima Rotación y Balanceo: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) & " <b>Próxima Alineacion: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) + ="<br/><b>Próxima Rotación y Balanceo: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) & "<br/<b>Próxima Alineacion: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) HTML + + + + + + + =Globals!ExecutionTime + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Usuario Imprimio: + + + + + + + + =Parameters!UsuarioImprimio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + true true @@ -2960,55 +3051,11 @@ Textbox35 - 0.01763cm - 18.52109cm + 0.00882cm + 18.54098cm 0.50624cm 2.5cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Impresión: - - - - - - - - =Today - - - - @@ -3646,7 +3693,7 @@ ReportParameter1 - + image/png diff --git a/Empresas/159/Formatos/Factura.rdlc b/Empresas/159/Formatos/Factura.rdlc index 388e49af9..b5ae65114 100644 --- a/Empresas/159/Formatos/Factura.rdlc +++ b/Empresas/159/Formatos/Factura.rdlc @@ -3344,7 +3344,7 @@ - ="<b>Próxima Rotación y Balanceo: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) & " <b>Próxima Alineacion: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) + ="<br/><b>Próxima Rotación y Balanceo: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) & "<br/<b>Próxima Alineación: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) HTML - ="<b>Próxima Rotación y Balanceo: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) & " <b>Próxima Alineacion: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) + ="<br/><b>Próxima Rotación y Balanceo: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) & "<br/<b>Próxima Alineación: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) HTML - ="<b>Próxima Rotación y Balanceo: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) & " <b>Próxima Alineacion: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) + ="<br/><b>Próxima Rotación y Balanceo: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) & "<br/<b>Próxima Alineación: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) HTML - ="<b>Próxima Rotación y Balanceo: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) & " <b>Próxima Alineacion: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) + ="<br/><b>Próxima Rotación y Balanceo: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) & "<br/<b>Próxima Alineación: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) HTML - ="<b>Próxima Rotación y Balanceo: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) & " <b>Próxima Alineacion: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) + ="<br/><b>Próxima Rotación y Balanceo: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) & "<br/<b>Próxima Alineación: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) HTML @@ -791,7 +795,7 @@ - AgrupadorSAT + CodigoNombreSAT @@ -803,6 +807,7 @@ 2pt + true diff --git a/Empresas/Grales/Formatos/RepClientes.rdlc b/Empresas/Grales/Formatos/RepClientes.rdlc index de28086df..cad5f22fc 100644 --- a/Empresas/Grales/Formatos/RepClientes.rdlc +++ b/Empresas/Grales/Formatos/RepClientes.rdlc @@ -1,1025 +1,5 @@ - - - - - 0.08792cm - 0cm - 20.06868cm - - - - - - - - - 1.38688cm - - - 5.49871cm - - - 2.33056cm - - - 2.5cm - - - 2.5cm - - - 1.42176cm - - - 1.83034cm - - - 2.5cm - - - - - 0.46771cm - - - - - true - true - - - - - Codigo - - - - - - - Textbox3 - - - - Black - - - Black - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Nombre - - - - - - - Textbox5 - - - - Black - - - Black - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - RFC - - - - - - - Textbox15 - - - - Black - - - Black - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Sucursal - - - - - - - Textbox23 - - - - Black - - - Black - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Telefono - - - - - - - Textbox21 - - - - Black - - - Black - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Estado - - - - - - - Textbox19 - - - - Black - - - Black - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Fecha - - - - - - - Textbox27 - - - - Black - - - Black - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Usuario - - - - - - - Textbox31 - - - - Black - - - Black - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - true - - - - - =Fields!Codigo.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Nombre.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!RFC.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Sucursal.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Telefono.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Estatus.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Fecha.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Usuario.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - - - After - - - - - - - DataSet1 - 0.36336cm - 0.06868cm - 1.06771cm - 19.96825cm - 1 - - - - - - 0.60091in - - - - - - true - true - - - - - =Parameters!NombreEmpresa.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - REPORTE DE CLIENTES - - - - - - - - - - - - - - - - Textbox2 - 1.03604cm - 3.80683cm - 0.52945cm - 9.98771cm - 2 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - 0.79374cm - true - true - - - 0.11437cm - 0.10583cm - 0cm - 19.96285cm - - - - - - true - true - - - - - Usuario: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!UsuarioImprimio.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Impresión: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!FechaImpresion.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - ="Página " & Globals.PageNumber & " de " & Globals.TotalPages - - - - - - - Textbox3 - 0.22726cm - 18.00281cm - 0.36335cm - 2.06587cm - 5 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 27.94cm - 21.59cm - 0.5cm - 0.5cm - 0.5cm - 0.5cm - 0.13cm - + + + + + + + + 1.38688cm + + + 5.49871cm + + + 2.33056cm + + + 2.5cm + + + 2.5cm + + + 1.42176cm + + + 1.83034cm + + + 2.5cm + + + + + 0.46771cm + + + + + true + true + + + + + Codigo + + + + + + + Textbox3 + + + + Black + + + Black + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Nombre + + + + + + + Textbox5 + + + + Black + + + Black + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + RFC + + + + + + + Textbox15 + + + + Black + + + Black + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Sucursal + + + + + + + Textbox23 + + + + Black + + + Black + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Telefono + + + + + + + Textbox21 + + + + Black + + + Black + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Estado + + + + + + + Textbox19 + + + + Black + + + Black + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Fecha + + + + + + + Textbox27 + + + + Black + + + Black + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Usuario + + + + + + + Textbox31 + + + + Black + + + Black + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + =Fields!Codigo.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Nombre.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!RFC.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Sucursal.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Telefono.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Estatus.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Fecha.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Usuario.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet1 + 0.36336cm + 0.06868cm + 1.06771cm + 19.96825cm + 1 + + + + + + 0.60091in + + + + + + true + true + + + + + =Parameters!NombreEmpresa.Value + + + + + + + Textbox1 + 0.11854cm + 0.10583cm + 0.6cm + 19.9311cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + REPORTE DE CLIENTES + + + + + + + + + + + + + + + + Textbox2 + 1.03604cm + 0.10583cm + 0.52945cm + 19.9311cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 0.79374cm + true + true + + + 0.11437cm + 0.10583cm + 0cm + 19.96285cm + + + + + + true + true + + + + + Usuario: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!UsuarioImprimio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresión: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FechaImpresion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox3 + 0.22726cm + 18.00281cm + 0.36335cm + 2.06587cm + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 27.94cm + 21.59cm + 0.5cm + 0.5cm + 0.5cm + 0.5cm + 0.13cm + - - - - - 2pt - 2pt - 2pt - 2pt - - - - 0.84237cm - 0.12912cm - 0cm - 19.7306cm - 1 - - - - - - - - - 14.55503cm - - - 2.5cm - - - 2.5cm - - - - - 0.49417cm - - - - - true - true - - - - - =Parameters!GPO.Value - - - - - - LightGrey - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Cantidad - - - - - - LightGrey - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Total - - - - - - LightGrey - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.41479cm - - - - - true - true - - - - - =IIF(Fields!Orden.Value.ToString = "0",Fields!Moneda.Value,Fields!GPO.Value) - - - - - - =IIF(Fields!Orden.Value.ToString = "0","Silver","White") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Cantidad.Value - - - - - - - Cantidad1 - - - =IIF(Fields!Orden.Value.ToString = "0","Silver","White") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Total.Value - - - - - - - Total - - - =IIF(Fields!Orden.Value.ToString = "0","Silver","White") - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - After - - - - - - - DataSet1 - 0.9482cm - 0.18203cm - 0.90896cm - 19.55503cm - 2 - - - - - - 0.94992in - - - - - - - Textbox1 - 0.18521cm - 3.21468cm - 0.6cm - 14.02238cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - - =Parameters!Titulo.Value - - - - - - - - - - - - - - - - Textbox2 - 1.10271cm - 3.21468cm - 0.52945cm - 14.02238cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - External - =Parameters!LogoPath.Value - FitProportional - 0.06614cm - 2.22362cm - 2.33715cm - 2 - - - - - - - - - - - 0.76376cm - true - true - - - true - true - - - - - ="Página " & Globals.PageNumber & " de " & Globals.TotalPages - - - - - - - Textbox3 - 0.08291cm - 17.26991cm - 0.68085cm - 2.09233cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Usuario: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!UsuarioImprimio.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Impresión: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!FechaImpresion.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 29.7cm - 21cm - 0.25cm - 0.25cm - 1cm - 1cm - 0.13cm - + + + + + 2pt + 2pt + 2pt + 2pt + + + + 0.84237cm + 0.12912cm + 0cm + 19.7306cm + 1 + + + + + + + + + 14.55503cm + + + 2.5cm + + + 2.5cm + + + + + 0.49417cm + + + + + true + true + + + + + =Parameters!GPO.Value + + + + + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Cantidad + + + + + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Total + + + + + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.41479cm + + + + + true + true + + + + + =IIF(Fields!Orden.Value.ToString = "0",Fields!Moneda.Value,Fields!GPO.Value) + + + + + + =IIF(Fields!Orden.Value.ToString = "0","Silver","White") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + + Cantidad1 + + + =IIF(Fields!Orden.Value.ToString = "0","Silver","White") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Total.Value + + + + + + + Total + + + =IIF(Fields!Orden.Value.ToString = "0","Silver","White") + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet1 + 0.9482cm + 0.18203cm + 0.90896cm + 19.55503cm + 2 + + + + + + 0.94992in + + + + + + + Textbox1 + 0.18521cm + 0.06614cm + 0.6cm + 19.67092cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + + =Parameters!Titulo.Value + + + + + + + + + + + + + + + + Textbox2 + 1.10271cm + 0.06614cm + 0.52945cm + 19.67092cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + External + =Parameters!LogoPath.Value + FitProportional + 0.06614cm + 2.22362cm + 2.33715cm + 2 + + + + + + + + + + + 0.76376cm + true + true + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox3 + 0.08291cm + 17.26991cm + 0.68085cm + 2.09233cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Usuario: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!UsuarioImprimio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresión: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + + Textbox11 + 0.08291cm + 10.51572cm + 0.68085cm + 4.32745cm + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 29.7cm + 21cm + 0.25cm + 0.25cm + 1cm + 1cm + 0.13cm + - Textbox11 0.08291cm - 13.65544cm + 13.66955cm 0.68085cm 4.32745cm 4 @@ -1005,7 +1007,6 @@ ReportParameter1 - Cm 40c94aad-a12a-44fb-ab0d-ea36a9656792 \ No newline at end of file diff --git a/GPS/CatEstatusTrayectos.aspx.cs b/GPS/CatEstatusTrayectos.aspx.cs index 868cb0ccc..6778292de 100644 --- a/GPS/CatEstatusTrayectos.aspx.cs +++ b/GPS/CatEstatusTrayectos.aspx.cs @@ -28,7 +28,7 @@ public partial class GPS_CatEstatusTrayectos : ClsPaginas { if (ObjGPS.GetEstatusTrayectos(-1, UsuarioActual.CveCliente)) { - DtEstatus = ObjGPS.DtResultados; + DtEstatus = ObjGPS.DtResultados.FiltraParametros("CveCliente > 0"); GvEstatus.DataSource = DtEstatus; GvEstatus.DataBind(); CargaEstatus(); diff --git a/GPS/Rastreo.aspx.vb b/GPS/Rastreo.aspx.vb index c6c79fd7c..2cf43ffaa 100644 --- a/GPS/Rastreo.aspx.vb +++ b/GPS/Rastreo.aspx.vb @@ -1599,16 +1599,60 @@ Partial Class GPS_Rastreo Else Dim filtros As String = $"Fechas: {FechaI.ToString("dd/MM/yyyy")} a {FechaF.ToString("dd/MM/yyyy")}" - If DtDatos.Rows.Count > 0 AndAlso String.IsNullOrEmpty(DtDatos.Rows(0)("Vehiculo").ToString()) Then - DtDatos.Rows(0)("Vehiculo") = "Total Kilometros Recorridos" + Dim DtImprimir As DataTable = DtDatos.Copy + + 'DtImprimir.Columns.Add("DistSTR", GetType(String)) + 'DtImprimir.Columns.Add("TiempoOperativoSTR", GetType(String)) + 'DtImprimir.Columns.Add("TiempoOperativoHRSTR", GetType(String)) + + If DtImprimir.Rows.Count > 0 AndAlso String.IsNullOrEmpty(DtImprimir.Rows(0)("Vehiculo").ToString()) Then + DtImprimir.Rows(0)("Vehiculo") = "Total Kilometros Recorridos" + + 'DtImprimir.Rows(0)("TiempoOperativoSTR") = Decimal.Round(DtImprimir.SUM("TiempoOperativo", "Vehiculo IS NOT NULL").ToDecimal / 60, 1).ToString("###,###,##0.##") + 'DtImprimir.Rows(0)("TiempoOperativoHRSTR") = Decimal.Round(DtImprimir.SUM("TiempoOperativo", "Vehiculo IS NOT NULL").ToDecimal, 1).ToString("#,##0.##") + 'DtImprimir.Rows(0)("DistSTR") = Decimal.Round(DtImprimir.SUM("Dist", "Vehiculo IS NOT NULL").ToDecimal, 2).ToString("###,###,##0.00") + + 'For Each Row As DataRow In DtImprimir.Rows + ' Row("TiempoOperativoSTR") = Decimal.Round(Row("TiempoOperativo").ToString().ToDecimal(), 1).ToString("N2") + ' Row("TiempoOperativoHRSTR") = Decimal.Round(Row("TiempoOperativoHR").ToString().ToDecimal(), 1).ToString("N2") + ' Row("DistSTR") = Decimal.Round(Row("Dist").ToString().ToDecimal(), 1).ToString("N2") + 'Next + + 'e.Row.Cells(1).Text = $"{Decimal.Round(DtDatos.SUM("TiempoOperativo", "Vehiculo IS NOT NULL").ToDecimal / 60, 1).ToString("###,###,##0.##")} Hrs ({DtDatos.SUM("TiempoOperativo", "Vehiculo IS NOT NULL").ToDecimal.ToString("#,##0.##")} minutos)" + DtImprimir.Rows(0)("Dist") = DtDatos.SUM("Dist", "Vehiculo IS NOT NULL").ToDecimal + DtImprimir.Rows(0)("TiempoOperativo") = DtDatos.SUM("TiempoOperativo", "Vehiculo IS NOT NULL").ToDecimal + DtImprimir.Rows(0)("TiempoOperativoHR") = DtDatos.SUM("TiempoOperativoHR", "Vehiculo IS NOT NULL").ToDecimal + + 'DtImprimir.Rows(0)("TiempoOperativo") = Decimal.Round(DtImprimir.SUM("TiempoOperativo", "Vehiculo IS NOT NULL").ToDecimal, 1) + 'DtImprimir.Rows(0)("TiempoOperativoHR") = Decimal.Round(DtImprimir.SUM("TiempoOperativoHR", "Vehiculo IS NOT NULL").ToDecimal, 1) + 'DtImprimir.Rows(0)("Dist") = Decimal.Round(DtImprimir.SUM("Dist", "Vehiculo IS NOT NULL").ToDecimal, 2) + + For Each Row As DataRow In DtImprimir.Rows + Row("TiempoOperativo") = Decimal.Round(Row("TiempoOperativo").ToString().ToDecimal(), 1).ToString("N2") + Row("TiempoOperativoHR") = Decimal.Round(Row("TiempoOperativoHR").ToString().ToDecimal(), 1).ToString("N2") + Row("Dist") = Decimal.Round(Row("Dist").ToString().ToDecimal(), 1).ToString("N2") + Next + End If - DtDatos.Columns.RemoveAt(0) - DtDatos.Columns("Vehiculo").ColumnName = "Vehículo" - DtDatos.Columns("TiempoOperativo").ColumnName = "Tiempo Operativo" - DtDatos.Columns("Dist").ColumnName = "Kilometros Recorridos" + DtImprimir.Columns.RemoveAt(0) + DtImprimir.Columns("Vehiculo").ColumnName = "Vehículo" - ImprimirExcelG(DtDatos, "ReporteKMRecorridos.xlsx", "Reporte de Kilometros Recorridos", filtros, NombreHoja:="RepKM") + 'DtImprimir.Columns.Remove(DtImprimir.Columns("TiempoOperativoHR")) + 'DtImprimir.Columns.Remove(DtImprimir.Columns("TiempoOperativo")) + 'DtImprimir.Columns.Remove(DtImprimir.Columns("Dist")) + + 'DtImprimir.Columns("TiempoOperativoHRSTR").ColumnName = "Tiempo Operativo (HR)" + 'DtImprimir.Columns("TiempoOperativoSTR").ColumnName = "Tiempo Operativo (Min)" + 'DtImprimir.Columns("DistSTR").ColumnName = "Kilometros Recorridos" + + DtImprimir.Columns("TiempoOperativoHR").ColumnName = "Tiempo Operativo (HR)" + DtImprimir.Columns("TiempoOperativo").ColumnName = "Tiempo Operativo (Min)" + DtImprimir.Columns("Dist").ColumnName = "Kilometros Recorridos" + + ImprimirExcelG(DtImprimir, "ReporteKMRecorridos.xlsx", "Reporte de Kilometros Recorridos", filtros, NombreHoja:="RepKM") + + DtImprimir.Dispose() End If Else diff --git a/GPS/TrayectoDetalle.aspx b/GPS/TrayectoDetalle.aspx index cef9f58d7..a10fc8071 100644 --- a/GPS/TrayectoDetalle.aspx +++ b/GPS/TrayectoDetalle.aspx @@ -36,9 +36,12 @@ -
  • +
  • Terminar Trayecto -
  • + +
  • + Actualizar al estatus siguiente +
  • Agregar Gasto
  • @@ -223,6 +226,16 @@
    +
    + + +
    +
    + +
    +
    + +
    @@ -469,7 +482,7 @@
    - @@ -547,28 +560,70 @@
    +
    @@ -134,18 +134,29 @@
    -
    -
    -
    -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    -
    - - + + +
    +
    +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    +
    - @@ -170,11 +181,10 @@ - - -
    -
    - +
    +
    +
    +
    + + + + @@ -122,7 +131,7 @@ <%----%>
    -
    Marca
    +
    Marca
    @@ -135,11 +144,11 @@
    -
    Tipo Almacen:
    +
    Tipo Almacén:
    -
    Modalidad:
    +
    Modalidad:
    @@ -197,8 +206,8 @@ - - + + @@ -251,7 +260,7 @@ - + diff --git a/Inventarios/RepNotasSinAlmacen.aspx b/Inventarios/RepNotasSinAlmacen.aspx index b70241195..bb3456d36 100644 --- a/Inventarios/RepNotasSinAlmacen.aspx +++ b/Inventarios/RepNotasSinAlmacen.aspx @@ -124,6 +124,7 @@ +
    Tipo Documento:
    diff --git a/Nomina/ConceptoNomina.aspx b/Nomina/ConceptoNomina.aspx index fa44998ab..f691d8511 100644 --- a/Nomina/ConceptoNomina.aspx +++ b/Nomina/ConceptoNomina.aspx @@ -10,12 +10,14 @@ input[disabled="disabled"] ~ .CodeMirror.cm-s-material { cursor: not-allowed; } - input[disabled="disabled"] ~ .CodeMirror.cm-s-material input { - cursor: not-allowed; - } - input[disabled="disabled"] ~ .CodeMirror.cm-s-material pre { - cursor: not-allowed; - } + + input[disabled="disabled"] ~ .CodeMirror.cm-s-material input { + cursor: not-allowed; + } + + input[disabled="disabled"] ~ .CodeMirror.cm-s-material pre { + cursor: not-allowed; + } .CodeMirror-hints { z-index: 700; @@ -218,23 +220,23 @@
    -
    -
    -
    - - Fórmulas -
    -
    -
    - Actualizar + + +
    +
    +
    + + Fórmulas +
    +
    +
    + Actualizar +
    +
    -
    -
    -
    +
    - - @@ -254,9 +256,8 @@ - - - <%--
    + + <%--
    @@ -265,10 +266,10 @@
    --%> -
    -
    - - +
    +
    + +
    @@ -343,6 +344,13 @@
    + +
    + +
    + +
    +
    diff --git a/Nomina/ConceptoNomina.aspx.cs b/Nomina/ConceptoNomina.aspx.cs index ff61ea299..2c9f70bee 100644 --- a/Nomina/ConceptoNomina.aspx.cs +++ b/Nomina/ConceptoNomina.aspx.cs @@ -323,6 +323,22 @@ public partial class Nomina_CatConcepto : ClsPaginas { TieneError = !ObjNomina.UpdateConcepto(codigo, concepto, tipo, formula, sistema, estado, CveConceptoPadre, CveConcepto, retencion, CveClasificacion, IdCtaContable, CveTipoGasto, tipoCalculo, CveConceptoContable, AplicaFiniquito, AutomaticoGlobal, Especie, Imprimir, CveSATConcepto,UsuarioActual.CveEmpresa); + if(!TieneError) + { + if (ChkMovtoPermanente.Checked) + { + ObjNomina.UpdateConceptoFormula(CveConcepto, "FNC.[MovimientosPermanentes]", 1); + } + else + { + if(TxtFormulaTotal.Text == "FNC.[MovimientosPermanentes]") + { + // ObjNomina.UpdateConceptoFormula(CveConcepto, "FNC.[MovimientosPermanentes] ", 1); + } + } + } + + if (TieneError) { ObjNomina.RollBack(); @@ -337,6 +353,22 @@ public partial class Nomina_CatConcepto : ClsPaginas { CveConcepto = ObjNomina.AddConcepto(codigo, concepto, tipo, formula, sistema, estado, CveConceptoPadre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, retencion, CveClasificacion, IdCtaContable, CveTipoGasto, tipoCalculo, CveConceptoContable, AplicaFiniquito, AutomaticoGlobal, Especie, Imprimir, CveSATConcepto); + + + if (CveConcepto>0) + { + if (ChkMovtoPermanente.Checked) + { + ObjNomina.UpdateConceptoFormula(CveConcepto, "FNC.[MovimientosPermanentes]", 1); + } + else + { + if (TxtFormulaTotal.Text == "FNC.[MovimientosPermanentes]") + { + // ObjNomina.UpdateConceptoFormula(CveConcepto, "FNC.[MovimientosPermanentes] ", 1); + } + } + } if (CveConcepto == -1) { ObjNomina.RollBack(); @@ -403,6 +435,9 @@ public partial class Nomina_CatConcepto : ClsPaginas DdlTipo.SelectedValueExist(drow["Tipo"]); TxtFormulaImporte.Text = drow["Formula"].ToString(); TxtFormulaTotal.Text = drow["FormulaTotal"].ToString(); + + ChkMovtoPermanente.Checked=(TxtFormulaTotal.Text == "FNC.[MovimientosPermanentes]"); + ChkMovtoPermanente_CheckedChanged(null, null); TxtFormulaGravada.Text = drow["FormulaGravada"].ToString(); if (drow["EsRetencion"].Equals("1")) ChkRetencion.Checked = true; if (drow["TipoCalculo"].Equals("True")) ChkTipoCalculo.Checked = true; @@ -529,4 +564,18 @@ public partial class Nomina_CatConcepto : ClsPaginas } } } + + protected void ChkMovtoPermanente_CheckedChanged(object sender, EventArgs e) + { + Divformula.Visible = !ChkMovtoPermanente.Checked; + //if (Divformula.Visible) + //{ + //TxtFormulaTotal.Text = ""; + //} + //else + //{ + // TxtFormulaTotal.Text = "FNC.[MovimientosPermanentes]"; + //} + + } } \ No newline at end of file diff --git a/Nomina/Finiquito.aspx b/Nomina/Finiquito.aspx index 2614371bf..8aff005bd 100644 --- a/Nomina/Finiquito.aspx +++ b/Nomina/Finiquito.aspx @@ -4,6 +4,16 @@ @@ -88,7 +88,7 @@ - + @@ -117,24 +117,9 @@ - + - - - - - - - - - - - - - - - - + diff --git a/RH/CalculoSBC.aspx.cs b/RH/CalculoSBC.aspx.cs index c715eed04..cddcad81f 100644 --- a/RH/CalculoSBC.aspx.cs +++ b/RH/CalculoSBC.aspx.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Data; using System.Linq; using System.Web; using System.Web.UI; @@ -27,12 +28,12 @@ public partial class RH_CalculoSBC : ClsPaginas { using (ClsNominas objnom = new ClsNominas()) { - if (objnom.GetCalculoSBC(UsuarioActual.CveEmpresa,DdlTipo.SelectedValue.ToEntero(), TxtFechaPago.Text)) + if (objnom.GetCalculoSBC(UsuarioActual.CveEmpresa, DdlTipo.SelectedValue.ToEntero(), TxtFechaPago.Text)) { GVCalculosSBC.DataSource = objnom.DTSetResultados.Tables[0]; GVCFija.DataSource = objnom.DTSetResultados.Tables[0]; GVPV.DataSource = objnom.DTSetResultados.Tables[0]; - if(objnom.DTSetResultados.Tables.Count > 0) + if (objnom.DTSetResultados.Tables.Count >1) { GVDetalleParteVariable.DataSource = objnom.DTSetResultados.Tables[1]; GVDetalleParteVariable.DataBind(); @@ -75,8 +76,8 @@ public partial class RH_CalculoSBC : ClsPaginas //} foreach (GridViewRow item in GVCalculosSBC.Rows) { - double SalarioDiarioSSNuevo =Math.Round( item.DataKey("SalarioDiarioSSNuevo").ToDouble(),2); - double SalarioDiarioSS = Math.Round(item.DataKey("SalarioDiarioSS").ToDouble(),2); + double SalarioDiarioSSNuevo = Math.Round(item.DataKey("SalarioDiarioSSNuevo").ToDouble(), 2); + double SalarioDiarioSS = Math.Round(item.DataKey("SalarioDiarioSS").ToDouble(), 2); if (SalarioDiarioSSNuevo != SalarioDiarioSS) { MovtosmodSalario = string.Format("{0}{1}{2}", MovtosmodSalario, concater, item.DataKey("Movtotxt")); @@ -113,9 +114,9 @@ public partial class RH_CalculoSBC : ClsPaginas int CvePersonal = item.DataKey("CvePersonal").ToEntero();//,,, double SalarioDiario = item.DataKey("SalarioDiario").ToDouble(); double SDINuevo = item.DataKey("SDINuevo").ToDouble(); - double SalarioDiarioSSNuevo = Math.Round(item.DataKey("SalarioDiarioSSNuevo").ToDouble(),2); + double SalarioDiarioSSNuevo = Math.Round(item.DataKey("SalarioDiarioSSNuevo").ToDouble(), 2); double SalarioVariableNuevo = item.DataKey("SalarioVariableNuevo").ToDouble(); - double SalarioDiarioSS = Math.Round(item.DataKey("SalarioDiarioSS").ToDouble(),2); + double SalarioDiarioSS = Math.Round(item.DataKey("SalarioDiarioSS").ToDouble(), 2); if (continuar && SalarioDiarioSSNuevo != SalarioDiarioSS && (continuar = objrh.UpdateSalarios(CvePersonal, fecha, UsuarioActual.CveEmpresa, SalarioDiario, SDINuevo, SalarioDiarioSSNuevo, SalarioDiario))) { @@ -141,22 +142,118 @@ public partial class RH_CalculoSBC : ClsPaginas protected void LnkDescargar_Click(object sender, EventArgs e) { - if (Tab.ActiveTab == TabSBC) + DataTable dt = GVToDT(GVCalculosSBC,"Salario"); + DataTable dtPF = GVToDT(GVCFija, "Parte fija"); + DataTable dtPV = GVToDT(GVPV, "Parte variable"); + DataTable dtPVD = GVToDT(GVDetalleParteVariable, "Detalle parte variable"); + + ClosedXML.Excel.XLWorkbook wb = new ClosedXML.Excel.XLWorkbook(); + var libro = wb.AddWorksheet(dt); + var libroPF = wb.AddWorksheet(dtPF); + var libroPV = wb.AddWorksheet(dtPV); + var libroPVD = wb.AddWorksheet(dtPVD); + libro.ColumnsUsed().AdjustToContents(); + libroPF.ColumnsUsed().AdjustToContents(); + libroPV.ColumnsUsed().AdjustToContents(); + libroPVD.ColumnsUsed().AdjustToContents(); + + + libro.ColumnsUsed().AdjustToContents(); + libro.Row(1).InsertRowsAbove(5); + libro.Range(1, 2, 1, 6).Merge().Value = UsuarioActual.Empresa.Empresa; + libro.Range(2, 2, 2, 6).Merge().Value = $"Reporte de calculo de sbc {TxtFechaPago.Text}."; + libro.Range(1, 2, 2, 6).Style.Font.SetBold(true); + libro.Range(1, 2, 2, 6).Style.Font.SetFontSize(16); + libro.Range(2, 2, 2, 6).Style.Font.SetFontSize(14); + libro.Range(1, 2, 2, 6).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Center; + //libro.Range(3, 2, 3, 6).Merge().Value = $"del {fechai:dd/MM/yyyy} al {fechaf:dd/MM/yyyy}"; + libro.Range(2, 7, 2, 9).Merge().Value = $"Fecha:{DateTime.Now:dd/MM/yyyy}"; + libro.Range(3, 7, 3, 9).Merge().Value = $"Hora:{DateTime.Now:HH:mm}"; + libro.Range(5, 6, 5, 9).Merge().Value = "Actual"; + libro.Range(5, 10, 5, 12).Merge().Value = "Nuevo"; + + libro.Range(5, 1, 6, 14).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Center; + + libro.Range(5, 1, 6, 13).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(79, 129, 189)); + libro.Range(5, 1, 5, 13).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.None; + + libro.Range(5, 6, 6, 9).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(128, 100, 162)); + libro.Range(5, 6, 6, 9).Style.Font.FontColor = ClosedXML.Excel.XLColor.White; + libro.Range(5, 10, 6, 12).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(136, 214, 205)); + libro.Range(5, 10, 6, 12).Style.Font.FontColor = ClosedXML.Excel.XLColor.White; + + + libro.Range(7, 6, 7 + dt.Rows.Count, 12).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Right; + libro.Range(7, 6, 7+ dt.Rows.Count, 12).Style.NumberFormat.Format = "$##,###,###,0.00"; + + + + System.IO.Stream fs = new System.IO.MemoryStream(); + wb.SaveAs(fs); + fs.Position = 0; + System.IO.MemoryStream memoryStream = new System.IO.MemoryStream(); + using (System.IO.Stream input = fs) + { - GVCalculosSBC.ExportToExcel("Salario"); - } - if (Tab.ActiveTab == TabParteFija) - { - GVCFija.ExportToExcel("Salario"); - } - if (Tab.ActiveTab == TabParteVariable) - { - GVPV.ExportToExcel("Salario"); - } - if (Tab.ActiveTab == TabDetalleParteVariable) - { - GVDetalleParteVariable.ExportToExcel("Salario"); + input.CopyTo(memoryStream); } + memoryStream.Position = 0; + + Response.Clear(); + Response.Buffer = true; + + Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; + Response.AddHeader("content-disposition", string.Format("attachment;filename={0}.xlsx", "Salario")); + Response.BinaryWrite(memoryStream.ToArray()); + Response.End(); + } + public string limpiarcelda( string celdatext) + { + celdatext = celdatext.Replace("
    ", "\r\n").Replace(" ", " "); + while (celdatext.Contains(" ")){ + celdatext = celdatext.Replace(" ", " "); + } + celdatext = celdatext.Replace("\n ", " "); + celdatext = celdatext.Replace("\r ", " "); + + return celdatext; + } + public DataTable GVToDT(GridView GridView, string NombreArchivoXLSX) + { + DataTable dt = new DataTable(NombreArchivoXLSX); + if (GridView != null && GridView.Rows.Count > 0) + { + int i = 0; + List ArrColumnasVisibles = new List(); // solo recorro las columnas visibles + + foreach (TableCell cell in GridView.HeaderRow.Cells) + { + string titulo = HttpUtility.HtmlDecode(Extensiones.ModExtensiones.TextoCelda(cell)).Trim(); + titulo = limpiarcelda( titulo); + if (GridView.Columns[i].Visible && titulo.Length > 0) + { + if (dt.Columns.Contains(titulo)) + titulo = titulo + i; + dt.Columns.Add(titulo); + ArrColumnasVisibles.Add(i); + } + i += 1; + } + i = 0; + + foreach (GridViewRow row in GridView.Rows) + { + dt.Rows.Add(); + i = 0; + foreach (int j in ArrColumnasVisibles) + { + dt.Rows[dt.Rows.Count - 1][i] = limpiarcelda(Extensiones.ModExtensiones.TextoCelda(row.Cells[j]).Replace("
    ", "\r\n")); + i = i + 1; + } + } + } + return dt; + } } \ No newline at end of file diff --git a/RH/CatPersonal.aspx b/RH/CatPersonal.aspx index 7fd4e727e..f6ba72b60 100644 --- a/RH/CatPersonal.aspx +++ b/RH/CatPersonal.aspx @@ -62,6 +62,9 @@
  • Descargar Excel
  • +
  • + Formato saldos iniciales +
  • Personalizar
  • @@ -77,6 +80,7 @@ +
  • diff --git a/RH/CatPersonal.aspx.vb b/RH/CatPersonal.aspx.vb index c915c826e..655ca2973 100644 --- a/RH/CatPersonal.aspx.vb +++ b/RH/CatPersonal.aspx.vb @@ -680,4 +680,366 @@ Partial Class RH_CatPersonal End If End Sub + Protected Sub LnkCargaMasiva_Click(sender As Object, e As EventArgs) + Dim wb As ClosedXML.Excel.XLWorkbook = New ClosedXML.Excel.XLWorkbook() + Dim libro = wb.AddWorksheet("Personal") + Dim crow As Integer = 1 + Dim ccol As Integer = 1 + + Dim colLugarNacimiento As Integer = 1 + Dim rowLugarNacimiento As Integer = 1 + +#Region "Regimen de contratación" + Dim Catalogos = wb.AddWorksheet("Catalogos") + crow = 1 + ccol = 1 + Dim colRegimenContratacion As Integer = 1 + Dim rowRegimenContratacion As Integer = 1 + Catalogos.Cell(crow, ccol).Value = "Regimen de contratación" + For Each row As DataRow In GlobalDTNomSatRegimenContratacion.Rows + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveSATRegimenContratacion"), row("RegimenContratacion")) + Next + colRegimenContratacion = ccol + rowRegimenContratacion = crow +#End Region +#Region "Estado civil" + Dim colEstadoCivil As Integer = 1 + Dim rowEstadoCivil As Integer = 1 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Estado civil" + For Each row As DataRow In GlobalDTEstadoCivil.Rows + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveEstadoCivil"), row("EstadoCivil")) + Next + colEstadoCivil = ccol + rowEstadoCivil = crow +#End Region +#Region "Escolaridad" + Dim colEscolaridad As Integer = 1 + Dim rowEscolaridad As Integer = 1 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Escolaridad" + For Each row As DataRow In GlobalDTEscolaridad.Rows + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveEscolaridad"), row("Escolaridad")) + Next + colEscolaridad = ccol + rowEscolaridad = crow + +#End Region +#Region "Tipo Periodo" + Dim colTipoPeriodo As Integer = 1 + Dim rowTipoPeriodo As Integer = 1 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Tipo Periodo" + For Each row As DataRow In GlobalDTTipoPeriodo.Rows + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveTipoPeriodo"), row("TipoPeriodo")) + Next + colTipoPeriodo = ccol + rowTipoPeriodo = crow + +#End Region +#Region "Estatus" + Dim colEstatusPersonal As Integer = 1 + Dim rowEstatusPersonal As Integer = 1 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Estatus" + For Each row As DataRow In GlobalDTEstatusPersonal.Rows + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveEstatusPersonal"), row("EstatusPersonal")) + Next + colEstatusPersonal = ccol + rowEstatusPersonal = crow + +#End Region +#Region "Tipo Contratro" + Dim colTipoContrato As Integer = 1 + Dim rowTipoContrato As Integer = 1 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Tipo Contratro" + For Each row As DataRow In GlobalDTTiposContrato.Rows + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = String.Format("{0}", row("TipoContrato")) + Next + colTipoContrato = ccol + rowTipoContrato = crow + +#End Region +#Region "Departamento" + Dim colDepartamento As Integer = 1 + Dim rowDepartamento As Integer = 1 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Departamento" + For Each row As DataRow In GlobalDTDepartamentos.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa).Rows + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveDepartamento"), row("Departamento")) + Next + colDepartamento = ccol + rowDepartamento = crow + +#End Region +#Region "Turno" + Dim colTurno As Integer = 1 + Dim rowTurno As Integer = 1 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Turno" + For Each row As DataRow In GlobalDTTurno.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa).Rows + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveTurno"), row("Turno")) + Next + colTurno = ccol + rowTurno = crow + +#End Region +#Region "Puesto" + Dim colPuesto As Integer = 1 + Dim rowPuesto As Integer = 1 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Puesto" + For Each row As DataRow In GlobalDTRHPuestos(UsuarioActual.CveEmpresa).Rows + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CvePuesto"), row("Puesto")) + Next + colPuesto = ccol + rowPuesto = crow + +#End Region +#Region "Estado" + Dim colEstado As Integer = 1 + Dim rowEstado As Integer = 1 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Estado" + For Each row As DataRow In GlobalDTGralEstados(1).Rows + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveEstado"), row("Estado")) + Next + colEstado = ccol + rowEstado = crow + +#End Region +#Region "Tipo salario" + + Dim colTipoSalario As Integer = 1 + Dim rowTipoSalario As Integer = 1 + + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Tipo salario" + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = "1: Salario fijo" + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = "2: Salario variable" + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = "3: Salario mixto" + colTipoSalario = ccol + rowTipoSalario = crow + +#End Region +#Region "Genero" + Dim colSexo As Integer = 1 + Dim rowSexo As Integer = 1 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Genero" + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = "1: Masculino" + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = "2: Femenino" + colSexo = ccol + rowSexo = crow + +#End Region +#Region "Sindicalizado" + Dim colsindicalizado As Integer = 1 + Dim rowsindicalizado As Integer = 1 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Sindicalizado" + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = "1: Sí" + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = "0: No" + colsindicalizado = ccol + rowsindicalizado = crow + +#End Region +#Region "Area geografica" + Dim colAreaGeografica As Integer = 1 + Dim rowAreaGeografica As Integer = 1 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Area geografica" + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = "A" + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = "B" + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = "C" + colAreaGeografica = ccol + rowAreaGeografica = crow + +#End Region +#Region "Metodo pago" + Dim colmetodopago = 0 + Dim rowmetodopago = 0 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Metodo pago" + For Each row As DataRow In GlobalDTMetodosPago.Rows + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveMetodoPago"), row("MetodoPago")) + Next + colmetodopago = ccol + rowmetodopago = crow + +#End Region + +#Region "subproyecto" + Dim colsubproyecto = 0 + Dim rowsubproyecto = 0 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "subproyecto" + Dim dtsubproyecto = If(Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, 1)) + For Each row As DataRow In dtsubproyecto.Rows + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveSubProyecto"), row("SubProyecto")) + Next + colsubproyecto = ccol + rowsubproyecto = crow + +#End Region + Catalogos.Range(1, 1, 1, ccol).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(79, 129, 189)) + Catalogos.Range(1, 1, 1, ccol).Style.Font.FontColor = ClosedXML.Excel.XLColor.White + + crow = 1 + ccol = 1 + + libro.Cell(crow, ccol).Value = "Código" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Apellido Paterno" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Apellido Materno" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Nombre" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Correo Electronico" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Fecha Nacimiento" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Sexo" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colSexo, rowSexo, colSexo), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Lugar Nacimiento" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Dirección" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Ciudad" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Estado Civil" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colEstadoCivil, rowEstadoCivil, colEstadoCivil), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Teléfono" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Celular" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "RFC" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "CURP" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Numero SS" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "CLABE" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Fecha Ingreso" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Fecha Baja" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Alta IMSS" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Código Postal" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Estatus Personal" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colEstatusPersonal, rowEstatusPersonal, colEstatusPersonal), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Estado" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colEstado, rowEstado, colEstado), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Nombre Padre" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Nombre Madre" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Puesto" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colPuesto, rowPuesto, colPuesto), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Turno" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colTurno, rowTurno, colTurno), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Tipo Contrato" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colTipoContrato, rowTipoContrato, colTipoContrato), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Departamento" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colDepartamento, rowDepartamento, colDepartamento), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Tipo Periodo" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colTipoPeriodo, rowTipoPeriodo, colTipoPeriodo), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Escolaridad" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colEscolaridad, rowEscolaridad, colEscolaridad), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Salario Diario" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Tipo Salario" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colTipoSalario, rowTipoSalario, colTipoSalario), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Salario variable" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Sindicalizado" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colsindicalizado, rowsindicalizado, colsindicalizado), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "SubProyecto " : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colsubproyecto, rowsubproyecto, colsubproyecto), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "RegimenContratacion" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colRegimenContratacion, rowRegimenContratacion, colRegimenContratacion), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Area Geografica" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colAreaGeografica, rowAreaGeografica, colAreaGeografica), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Prima vacacional" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Dias aguinaldo" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Metodo Pago" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colmetodopago, rowmetodopago, colmetodopago), True) : ccol = ccol + 1 + + + + + libro.Range(crow, 1, crow, ccol - 1).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(79, 129, 189)) + libro.Range(crow, 1, crow, ccol - 1).Style.Font.FontColor = ClosedXML.Excel.XLColor.White + + Catalogos.ColumnsUsed().AdjustToContents() + libro.ColumnsUsed().AdjustToContents() + 'AreaGeografica ABC + 'GlobalDTMetodosPago MetodoPago" DataValueField="CveMetodoPago + + + Dim fs As System.IO.Stream = New System.IO.MemoryStream() + wb.SaveAs(fs) + fs.Position = 0 + Dim memoryStream As System.IO.MemoryStream = New System.IO.MemoryStream() + + Using input As System.IO.Stream = fs + input.CopyTo(memoryStream) + End Using + + memoryStream.Position = 0 + Response.Clear() + Response.Buffer = True + Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + Response.AddHeader("content-disposition", String.Format("attachment;filename=SaldosInicialesRH.xlsx", "")) + Response.BinaryWrite(memoryStream.ToArray()) + Response.[End]() + 'Using nom As ClsNominas = New ClsNominas() + + ' If nom.ReportedePercepcionesDeduccionesGet(UsuarioActual.CveEmpresa, fechai, fechaf, 4) Then + ' Dim dt As DataTable = nom.DTSetResultados.Tables(0) + ' Dim libro = wb.AddWorksheet(nom.DTSetResultados.Tables(0), "Percepciones y deducciones") + ' libro.Tables.FirstOrDefault().Theme = ClosedXML.Excel.XLTableTheme.None + ' Dim crow As Integer = 1 + + ' For Each item As DataRow In dt.Rows + ' crow += 1 + + ' Select Case item("Grupoid").ToString() + ' Case "10" + ' libro.Range(crow, 1, crow, 9).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(184, 204, 228)) + ' Case "8", "11" + ' libro.Range(crow, 1, crow, 9).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(79, 129, 189)) + ' libro.Range(crow, 1, crow, 11).Style.Font.FontColor = ClosedXML.Excel.XLColor.White + ' Case "6" + ' libro.Range(crow, 1, crow, 9).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(216, 228, 188)) + ' Case "5", "7" + ' libro.Range(crow, 1, crow, 9).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(155, 187, 89)) + ' libro.Range(crow, 1, crow, 9).Style.Font.FontColor = ClosedXML.Excel.XLColor.White + ' Case "2" + ' Case "1", "3" + ' libro.Range(crow, 1, crow, 9).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(75, 172, 198)) + ' libro.Range(crow, 1, crow, 9).Style.Font.FontColor = ClosedXML.Excel.XLColor.White + ' End Select + ' Next + + ' libro.Range(2, 4, crow, 9).Style.NumberFormat.Format = "$##,###,###,0.00" + ' libro.Range(2, 4, crow, 9).DataType = ClosedXML.Excel.XLDataType.Number + ' libro.Column(1).Delete() + ' libro.ColumnsUsed().AdjustToContents() + ' libro.Row(1).InsertRowsAbove(4) + ' libro.Range(1, 2, 1, 6).Merge().Value = UsuarioActual.Empresa.Empresa + ' libro.Range(2, 2, 2, 6).Merge().Value = $"Reporte de percepciones y deducciones del {fechai} al {fechaf}" + ' libro.Range(1, 2, 2, 6).Style.Font.SetBold(True) + ' libro.Range(1, 2, 2, 6).Style.Font.SetFontSize(16) + ' libro.Range(2, 2, 2, 6).Style.Font.SetFontSize(14) + ' libro.Range(1, 2, 2, 6).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Center + ' libro.Range(2, 7, 2, 9).Merge().Value = $"Fecha:{DateTime.Now}" + ' libro.Range(3, 7, 3, 9).Merge().Value = $"Hora:{DateTime.Now}" + ' End If + 'End Using + End Sub End Class +S \ No newline at end of file diff --git a/RH/DiasFestivos.aspx b/RH/DiasFestivos.aspx new file mode 100644 index 000000000..1be34aea1 --- /dev/null +++ b/RH/DiasFestivos.aspx @@ -0,0 +1,79 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="DiasFestivos.aspx.cs" Inherits="RH_DiasFestivos" %> + + + + + + +Catalogo de días festivos + + + + +
  • días festivos
  • + + + + + + + + + + + + + + + <%-- + + + + --%> + + + + + + + + + + + + + + diff --git a/RH/DiasFestivos.aspx.cs b/RH/DiasFestivos.aspx.cs new file mode 100644 index 000000000..4304fdcd7 --- /dev/null +++ b/RH/DiasFestivos.aspx.cs @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; + +public partial class RH_DiasFestivos : ClsPaginas +{ + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + CargaDiasFestivos(); + } + + } + + + protected void CargaDiasFestivos() + { + ClsRH ObjDias = new ClsRH(); + ObjDias.DiasFestivosGet(UsuarioActual.CveEmpresa ); + GVDiasFestivos.DataSource = ObjDias.DtResultados; + ObjDias.Dispose(); + GVDiasFestivos.DataBind(); + upDatosDias.Update(); + } + protected void LimpiaDiasFestivos() + { + TxtDiasfecha.Text = ""; + UPModalDias.Update(); + } + protected void LnkAgregarDias_Click(object sender, EventArgs e) + { + this.RegistraScript("$('#DModalDiasFestivos').modal();"); + LimpiaDiasFestivos(); + BtnDiasADD.Visible = true; + UPModalDias.Update(); + } + protected void BtnDiasADD_Click(object sender, EventArgs e) + { + + DateTime fecha = TxtDiasfecha.Text.ToDate(); + ClsRH ObjDias = new ClsRH(); + bool Continuar = ObjDias.DiasFestivosAdd(fecha, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario); + ObjDias.Dispose(); + if (Continuar) + { + this.RegistraScript("$('#DModalDiasFestivos').modal('hide');"); + LimpiaDiasFestivos(); + CargaDiasFestivos(); + UPModalDias.Update(); + this.Alert("El dìa festivos se ha agregado"); + } + } + protected void LnkEliminarDias_Click(object sender, EventArgs e) + { + GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + DateTime fecha = gvRow.DataKey("CveDiainabil").ToDateTime(); + ClsRH ObjDias = new ClsRH(); + bool Continuar = ObjDias.DiasFestivosRemove(fecha, UsuarioActual.CveEmpresa); + ObjDias.Dispose(); + if (Continuar) + { + CargaDiasFestivos(); + this.Alert("El dìa festivos se ha Eliminado"); + } + } + + + +} \ No newline at end of file diff --git a/TareasProgramadas/Tareas119.ashx b/TareasProgramadas/Tareas119.ashx index c573d0a37..573054243 100644 --- a/TareasProgramadas/Tareas119.ashx +++ b/TareasProgramadas/Tareas119.ashx @@ -26,7 +26,7 @@ public class TareasJam : IHttpHandler switch (Metodo) { case "TestConexion": - retorno = PruebaConexionFTP("ftp://us2.hostedftp.com/", "agrojam", "A12345678"); + retorno = PruebaConexionFTP("ftp://thalamus.exavault.com", "agrojam", "A12345678"); break; case "EjecutaThalamus": @@ -112,7 +112,7 @@ public class TareasJam : IHttpHandler //string FTPPass = "agj-3500"; - string FTPServer = "ftp://us2.hostedftp.com"; + string FTPServer = "ftp://thalamus.exavault.com"; string TFPUsr = "agrojam"; string FTPPass = "A12345678"; @@ -375,7 +375,10 @@ public class TareasJam : IHttpHandler ErrorProceso = true; Respuesta = false; } - + + + // ErrorProceso = true; + if (!ErrorProceso) { diff --git a/Ventas/CatClientes.aspx b/Ventas/CatClientes.aspx index 66b98dba9..762d4efb9 100644 --- a/Ventas/CatClientes.aspx +++ b/Ventas/CatClientes.aspx @@ -90,7 +90,7 @@ Todos Frecuente - No Frecuente + Venta Mostrador diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index 4003b40e1..8852a875b 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -10350,9 +10350,11 @@ Partial Class Clientes Min = row.Item("Total").ToString.ToDouble End If + If row.Item("Total").ToString.ToDouble > 0 Then + Total += row.Item("Total").ToString.ToDouble + Cantidad += 1 - Total += row.Item("Total").ToString.ToDouble - Cantidad += 1 + End If End If Next diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index a24cf4999..5354d2399 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -651,7 +651,24 @@ Partial Class Ventas_ClientesAbonar Protected Sub BtnIEGuardar_Click(sender As Object, e As EventArgs) Handles BtnIEGuardar.Click - + 'SI ES EMPRESA DE ACUMULADORES DEBE OBLIGAR A SUBIR UN ARCHIVO + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + Dim files = Anexo.getfiles() + If files IsNot Nothing Then + If files.Archivos IsNot Nothing Then + If files.Archivos.Count = 0 Then + Alert("Debe anexar un archivo", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + Else + Alert("Debe anexar un archivo", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + Else + Alert("Debe anexar un archivo", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + End If Dim ValFechaDocumento As Boolean = False Dim FoliosFechasValFechaDocumento As New StringBuilder @@ -1948,11 +1965,19 @@ Partial Class Ventas_ClientesAbonar ObjFacturaDevolucion.CveTipoRelacion = 7 ObjFacturaDevolucion.TipoRelacion = "07" + ObjFacturaDevolucion.DtVentasRelacionadas = New DataTable + ObjFacturaDevolucion.DtVentasRelacionadas.Columns.Add("CveVenta", GetType(Integer)) Dim Fol As New List(Of String) For Each Fac In ListaVentasGenerarNC Fol.Add(Fac.FolioFiscal) + + Dim RowVenta As DataRow = ObjFacturaDevolucion.DtVentasRelacionadas.NewRow + RowVenta("CveVenta") = Fac.CveVenta + + ObjFacturaDevolucion.DtVentasRelacionadas.Rows.Add(RowVenta) Next + ObjFacturaDevolucion.UUIDRelacionados = Fol Select Case ObjFacturaDevolucion.TipoDocto diff --git a/Ventas/RepVentaDetalle.aspx.vb b/Ventas/RepVentaDetalle.aspx.vb index b41a954fe..e20897600 100644 --- a/Ventas/RepVentaDetalle.aspx.vb +++ b/Ventas/RepVentaDetalle.aspx.vb @@ -899,7 +899,11 @@ Partial Class RepVentaDetalle pathPDF = Server.MapPath(String.Format("~/Empresas/{0}/PDF/{1}/{2}.pdf", UsuarioActual.CveEmpresa, TipoDocto, gvr.DataKey("SerieFolio").ToString)) If IO.File.Exists(pathPDF) Then - DescargaZIP.AddFile(pathPDF, "") + 'NO AGREGAR ARCHIVOS REPETIDOS + Dim File As New IO.FileInfo(pathPDF) + If Not DescargaZIP.Any(Function(x) x.FileName.Contains(File.Name)) Then + DescargaZIP.AddFile(pathPDF, gvr.DataKey("TipoDocumento").ToString) + End If End If End If Next @@ -910,7 +914,7 @@ Partial Class RepVentaDetalle Response.End() End Sub Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, CveUsuarioCreo As Integer) As Byte() - Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?P={1}", "http://localhost/", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))) + Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?P={1}", "http://localhost:85/", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))) Dim File As Byte() = Nothing Try Using httpClient = New HttpClient() @@ -961,7 +965,11 @@ Partial Class RepVentaDetalle pathXML = Server.MapPath(String.Format("~/Empresas/{0}/XML/{1}/{2}.xml", UsuarioActual.CveEmpresa, TipoDocto, gvr.DataKey("SerieFolio").ToString)) If IO.File.Exists(pathXML) Then - DescargaZIP.AddFile(pathXML, "") + 'NO AGREGAR ARCHIVOS REPETIDOS + Dim File As New IO.FileInfo(pathXML) + If Not DescargaZIP.Any(Function(x) x.FileName.Contains(File.Name)) Then + DescargaZIP.AddFile(pathXML, gvr.DataKey("TipoDocumento").ToString) + End If End If End If Next diff --git a/Ventas/RepVentasUtilidadPadre.aspx b/Ventas/RepVentasUtilidadPadre.aspx index b6ace4a1b..35a9fc4e5 100644 --- a/Ventas/RepVentasUtilidadPadre.aspx +++ b/Ventas/RepVentasUtilidadPadre.aspx @@ -46,7 +46,7 @@ - Reporte de Utilidad o Pérdida sobre Ventas + Reporte de utilidad o pérdida sobre venta @@ -210,11 +210,11 @@ - + - + diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index c5faada5d..91e5df9dd 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -3401,7 +3401,7 @@ -
    +
    @@ -3725,8 +3725,8 @@ - - + + @@ -4761,10 +4761,10 @@
    - - - + + +
    @@ -6909,7 +6909,7 @@ - +
    diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index cc6238390..4b9eb526c 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -1298,6 +1298,16 @@ Partial Class Ventas ViewState("CveFormaPago33Cliente") = value End Set End Property + + Private Property RFCReceptorVenta As String + Get + Return If(IsNothing(ViewState("RFCReceptorVenta")), "", ViewState("RFCReceptorVenta").ToString()) + End Get + + Set(value As String) + ViewState("RFCReceptorVenta") = value + End Set + End Property #End Region #Region "Propiedades PuntoVenta" @@ -1573,7 +1583,7 @@ Partial Class Ventas Private Property EnviarCorreoCliente As Boolean Get - Return CBool(ViewState("EnviarCorreoCliente").ToString()) + Return CBool(IfNull(ViewState("EnviarCorreoCliente"), False)) End Get Set(value As Boolean) ViewState("EnviarCorreoCliente") = value @@ -2867,6 +2877,14 @@ Partial Class Ventas End If End If + 'VALIDA ESTATUS CLIENTE - SOLO SE PUEDE USAR EL CLIENTE PARA COTIZAR EN CASO DE ESTAR INACTIVO + If Not CveVenta > 0 AndAlso Not BtnEmitirImprimir.Visible AndAlso Request("Op") IsNot Nothing AndAlso Request("Op").ToString() <> "" Then + If DdlTipoComprobante.SelectedValue.Contiene("Cot") Then + BtnEmitirImprimir.Visible = True + TrVistaPrevia.Visible = True + End If + End If + End If ''EN REALIDAD SE OCUPAN ESTAS COSAS DENTRO DEL POSTABCK ??? @@ -3975,6 +3993,8 @@ Partial Class Ventas ObjUsados.Dispose() End If + RFCReceptorVenta = DbRowVenta("RFCReceptor").ToString() + ViewState("CveSubProyectoVenta") = DbRowVenta("CveSubProyecto").ToString().ToEntero() Me.CveEstatusFacturaPadre = DbRowVenta("CveEstatusFacturaPadre").ToString().ToEntero() @@ -10922,6 +10942,29 @@ Partial Class Ventas End If factura.CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardarVenta", factura.CvePlantillaPoliza, factura.Total, factura.Total, factura.CveMoneda, factura.Fecha, If(CveEmpresaCRM > 0, LblEmpresaCRM.Text, factura.Cliente.Nombre), factura.CveUsuario, factura.CveEmpresa) + + Dim RFCReceptor As String = "" + + If factura.Timbre IsNot Nothing AndAlso factura.Timbre.Receptor IsNot Nothing Then + If Not String.IsNullOrEmpty(factura.Timbre.Receptor.RFC) Then + RFCReceptor = factura.Timbre.Receptor.RFC.Trim + End If + End If + + 'SI NO SE VA TIMBRAR TOMA EL DEL CLIENTE + If String.IsNullOrEmpty(RFCReceptor) Then + If Not String.IsNullOrEmpty(LblRFC.Text) Then + RFCReceptor = LblRFC.Text.Trim + End If + + If factura.FacturarSucursal Then + If factura.ClienteSucursal IsNot Nothing Then + RFCReceptor = factura.ClienteSucursal.RFC + End If + End If + + End If + If Not ObjVentas.AddVenta(factura.TipoDocto, factura.Folio, factura.CveCliente, factura.CveClienteSucursal, factura.SubTotalTC, factura.DescuentoTC, factura.AmortizacionTC, factura.IVATC, factura.RetIVATC, factura.RetISRTC, factura.TotalTC, factura.CveMoneda, factura.TipoCambio, factura.CveMetodoPago, factura.CondicionesPago, factura.FormaPago, factura.FechaPago, factura.Fecha, factura.MotivoDescuento, @@ -10937,7 +10980,7 @@ Partial Class Ventas CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, CveAcercamientoCRM:=CveAcercamientoCRM, DiasCredito:=factura.DiasCredito, EsDiasCreditoFijo:=factura.EsDiasCreditoFijo, AnticipoEspecial:=If(TrAntEspecial.Visible, ChkAntEspecial.Checked, False), Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=factura.CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text, - FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero, FacturarSucursal:=factura.FacturarSucursal, VentaDesglosaIEPS:=factura.VentaDesglosaIEPS) Then + FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero, FacturarSucursal:=factura.FacturarSucursal, VentaDesglosaIEPS:=factura.VentaDesglosaIEPS, RFCReceptor:=RFCReceptor) Then ErrorList.Add("Ocurrió un error al Generar la Venta.
    Revise su factura y cualquier detalle comuníquese a Soporte Técnico") Else If factura.TipoDocto.Contiene("Dev", "Egs") Or DtVentasNC IsNot Nothing Or CveEstatusRefacturacion = 1 Then @@ -12732,7 +12775,7 @@ Partial Class Ventas ' DrPago("Importe") = DrPago("Importe").ToString().ToDecimal - TxtCambio.Text.ToDecimal 'End If - CveIEPago = ObjBancos.AddBancos_IE(DrPago("CveCuenta").ToString().ToEntero(), DrPago("CveTipoMovimiento").ToString().ToEntero(), Fecha, FolioIE.ToString(), String.Format("PAGO: {0}", TxtFolio.Text), DrPago("Importe").ToString().ToDouble, DdlMoneda.SelectedValue.ToEntero(), tipoCambio, DrPago("Observaciones").ToString(), "", False, False, -1, ObjFactura.CvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=CveCorte, MesesSinIntereses:=DrPago("MesesSinIntereses").ToString().ToEntero()) + CveIEPago = ObjBancos.AddBancos_IE(DrPago("CveCuenta").ToString().ToEntero(), DrPago("CveTipoMovimiento").ToString().ToEntero(), Fecha, FolioIE.ToString(), String.Format("PAGO: {0}", TxtFolio.Text), DrPago("Importe").ToString().ToDouble, DdlMoneda.SelectedValue.ToEntero(), tipoCambio, DrPago("Observaciones").ToString(), "", False, False, -1, ObjFactura.CvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=CveCorte, MesesSinIntereses:=DrPago("MesesSinIntereses").ToString().ToEntero(), Modulo:="Ventas/Guardar") If CveIEPago > 0 Then @@ -14089,6 +14132,8 @@ Partial Class Ventas Dim CveCuentaIVAXTrasladar As Integer = 0 Dim CveCuentaIVATrasladado As Integer = 0 + Dim CveSubProyectoVenta As Integer = DdlSubProyectoDatos.SelectedValue.ToEntero() + Dim Importe91 As Decimal = 0 If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDT.MAX("PorcentajeIVA").ToDouble).Rows.Count > 0 Then @@ -14196,7 +14241,7 @@ Partial Class Ventas ' CveCuentaContabilizacion = 0 'End If - If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, TipoMovimiento, 0, Concepto, 207, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Math.Round(importeMovimiento * tipoCambioVenta - importeMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=importeMovimiento, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioVentaValuacion) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, TipoMovimiento, 0, Concepto, 207, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Math.Round(importeMovimiento * tipoCambioVenta - importeMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=importeMovimiento, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioVentaValuacion, CveSubProyecto:=CveSubProyectoVenta) Then ErrorConta = True End If @@ -14235,7 +14280,7 @@ Partial Class Ventas ' CveCuentaContabilizacion = 0 'End If - If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=gvr.DataKey("CveVenta").ToEntero(), CveVentaAmortizacion:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento * tipoCambioPago, ImporteME:=If(tipoCambioPago = 1, 0, importeMovimiento), CveCuenta:=CveCuenta) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=gvr.DataKey("CveVenta").ToEntero(), CveVentaAmortizacion:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento * tipoCambioPago, ImporteME:=If(tipoCambioPago = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, CveSubProyecto:=CveSubProyectoVenta) Then ErrorConta = True End If End If @@ -14300,7 +14345,7 @@ Partial Class Ventas CveCuenta = 0 importeMX = importeMovimiento ImporteComplementaria = ((importeMovimiento * TC) - importeMovimiento).RoundSQL - If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, False, importeMovimiento, Concepto, 203, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=gvr.DataKey("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveVentaAmortizacion:=CveVenta, ImporteMX:=ImporteComplementaria, ImporteME:=If(gvr.DataKey("TipoCambio").ToString().ToDecimal = 1, 0, importeMovimiento), TipoCambio:=TC) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, False, importeMovimiento, Concepto, 203, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=gvr.DataKey("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveVentaAmortizacion:=CveVenta, ImporteMX:=ImporteComplementaria, ImporteME:=If(gvr.DataKey("TipoCambio").ToString().ToDecimal = 1, 0, importeMovimiento), TipoCambio:=TC, CveSubProyecto:=CveSubProyectoVenta) Then ErrorConta = True Exit For End If @@ -14313,7 +14358,7 @@ Partial Class Ventas CveCuenta = 0 End If - If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=gvr.DataKey("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveVentaAmortizacion:=CveVenta, ImporteMX:=importeMX, CveCuenta:=CveCuenta, TipoCambio:=TC) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=gvr.DataKey("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveVentaAmortizacion:=CveVenta, ImporteMX:=importeMX, CveCuenta:=CveCuenta, TipoCambio:=TC, CveSubProyecto:=CveSubProyectoVenta) Then ErrorConta = True Exit For End If @@ -14322,7 +14367,7 @@ Partial Class Ventas If Not ErrorConta And DdlTipoComprobante.SelectedValue = "Ant" Then importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal - ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("Original").ToDecimal) * gvr.DataKey("IVA").ToDecimal) If ObjConta.AddPrePolizasDetalle(CvePrepoliza, False, importeMovimiento, Concepto, 11, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveVentaAmortizacion:=gvr.DataKey("CveVenta").ToString().ToEntero(), ImporteMX:=importeMovimiento * TC, CveCuenta:=CveCuenta) Then - If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, True, importeMovimiento, Concepto, 4, Concepto, FechaMovimiento, gvr.DataKey("IdCtaContableNC").ToEntero(), -1, CveClasificacion:=gvr.DataKey("CveClasificacionNC").ToEntero(), CveVenta:=gvr.DataKey("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveVentaAmortizacion:=CveVenta, ImporteMX:=importeMovimiento * TC, CveCuenta:=gvr.DataKey("IdCtaContableNCSIG").ToEntero()) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, True, importeMovimiento, Concepto, 4, Concepto, FechaMovimiento, gvr.DataKey("IdCtaContableNC").ToEntero(), -1, CveClasificacion:=gvr.DataKey("CveClasificacionNC").ToEntero(), CveVenta:=gvr.DataKey("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveVentaAmortizacion:=CveVenta, ImporteMX:=importeMovimiento * TC, CveCuenta:=gvr.DataKey("IdCtaContableNCSIG").ToEntero(), CveSubProyecto:=CveSubProyectoVenta) Then ErrorConta = True Exit For End If @@ -14345,23 +14390,23 @@ Partial Class Ventas If importeMovimiento <> 0 Then ' Agregamos el 2 If tipoCambioPago = 1 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, FechaMovimiento, IdCtaContClientes, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, FechaMovimiento, IdCtaContClientes, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento, CveSubProyecto:=CveSubProyectoVenta) Then ErrorConta = True End If Else 'Cuando son dolares If importeMovimiento <> 0 Then If IdCtaContComplementaria > 0 Or 0 > 0 Then 'Agregamos la Complementaria - If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, Not TipoMovimiento, 0, Concepto, 207, Concepto, FechaMovimiento, IdCtaContComplementaria, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=Math.Round(importeMovimiento * tipoCambioVenta - importeMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, Not TipoMovimiento, 0, Concepto, 207, Concepto, FechaMovimiento, IdCtaContComplementaria, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=Math.Round(importeMovimiento * tipoCambioVenta - importeMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta, CveSubProyecto:=CveSubProyectoVenta) Then ErrorConta = True End If 'Agregamos la Extranjera - If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, FechaMovimiento, IdCtaContMonedaExtranjera, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento, ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, FechaMovimiento, IdCtaContMonedaExtranjera, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento, ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta, CveSubProyecto:=CveSubProyectoVenta) Then ErrorConta = True End If Else 'Agregamos la Extranjera - If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, FechaMovimiento, IdCtaContMonedaExtranjera, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=Math.Round(importeMovimiento * tipoCambioVenta, 2, MidpointRounding.AwayFromZero), ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, FechaMovimiento, IdCtaContMonedaExtranjera, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=Math.Round(importeMovimiento * tipoCambioVenta, 2, MidpointRounding.AwayFromZero), ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta, CveSubProyecto:=CveSubProyectoVenta) Then ErrorConta = True End If End If @@ -14378,7 +14423,7 @@ Partial Class Ventas IdCtaContable = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar) CveCuenta = If(CveCuentaIVAXTrasladar > 0, CveCuentaIVAXTrasladar, UsuarioActual.Empresa.CveCuentaIVAxTrasladar) - If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, TipoMovimiento, importeMovimiento, Concepto, 13, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMX, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuestoAmortizacion) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, TipoMovimiento, importeMovimiento, Concepto, 13, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMX, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuestoAmortizacion, CveSubProyecto:=CveSubProyectoVenta) Then ErrorConta = True End If @@ -14386,7 +14431,7 @@ Partial Class Ventas IdCtaContable = If(IdCtaIVATrasladado > 0, IdCtaIVATrasladado, UsuarioActual.Empresa.IdCuentaIVATrasladado) CveCuenta = If(CveCuentaIVATrasladado > 0, CveCuentaIVATrasladado, UsuarioActual.Empresa.CveCuentaIVATrasladado) - If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, Not TipoMovimiento, importeMovimiento, Concepto, 61, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMX, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuestoAmortizacion) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, Not TipoMovimiento, importeMovimiento, Concepto, 61, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMX, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuestoAmortizacion, CveSubProyecto:=CveSubProyectoVenta) Then ErrorConta = True End If End If @@ -14401,7 +14446,7 @@ Partial Class Ventas IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSxTrasladar CveCuenta = UsuarioActual.Empresa.CveCuentaIEPSxTrasladar - If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, TipoMovimiento, importeMovimiento, Concepto, 38, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMX, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuestoAmortizacion) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, TipoMovimiento, importeMovimiento, Concepto, 38, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMX, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuestoAmortizacion, CveSubProyecto:=CveSubProyectoVenta) Then ErrorConta = True End If @@ -14409,7 +14454,7 @@ Partial Class Ventas IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSTrasladado CveCuenta = UsuarioActual.Empresa.CveCuentaIEPSTrasladado - If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, Not TipoMovimiento, importeMovimiento, Concepto, 61, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMX, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuestoAmortizacion) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, Not TipoMovimiento, importeMovimiento, Concepto, 61, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMX, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuestoAmortizacion, CveSubProyecto:=CveSubProyectoVenta) Then ErrorConta = True End If End If @@ -14443,7 +14488,7 @@ Partial Class Ventas End If End If - If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMX, CveCuenta:=-1, TipoCambio:=tipoCambioPago) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMX, CveCuenta:=-1, TipoCambio:=tipoCambioPago, CveSubProyecto:=CveSubProyectoVenta) Then ErrorConta = True End If @@ -14587,7 +14632,9 @@ Partial Class Ventas ' CveCuentaContabilizacion = 0 'End If - If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=importeMX, CveCuenta:=CveCuenta, TipoCambio:=TipoCambioGeneral, PorcentajeImpuesto:=PorcentajeImpuesto) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, + CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=importeMX, CveCuenta:=CveCuenta, TipoCambio:=TipoCambioGeneral, + PorcentajeImpuesto:=PorcentajeImpuesto, CveSubProyecto:=CveSubProyectoVenta) Then ErrorConta = True Exit For End If @@ -14746,7 +14793,12 @@ Partial Class Ventas 'cuando es AMORTIZACIÓN CON FACTURA EN CERO If DdlTipoAmortizacionAnticipo.SelectedValue = "3" Then - If Amortizacion < TxtSubTotal.Text.ToDecimal Then + Dim SubTotalRef As Decimal = TxtSubTotal.Text.ToDecimal + If LblDescuentos.Text.ToDecimal() > 0D Then + SubTotalRef = TxtSubTotal.Text.ToDecimal - LblDescuentos.Text.ToDecimal() + End If + + If Amortizacion < SubTotalRef Then '[IPP] LIMPIA LO SELECCIONADO EN CASO DE QUE NO SEA AMORTIZACIÓN DEL 100% 15Junio2018 Amortizacion = 0 @@ -14767,7 +14819,7 @@ Partial Class Ventas End If - CalculaTotalesVenta() + CalculaTotalesVenta(ValidarDescuentos:=True) End If End If @@ -16582,7 +16634,7 @@ Partial Class Ventas If dr Is Nothing Then 'verifica marca, si tiene asignada la promocion - dr = DtPromociones.FiltroPrimero(String.Format("CveClasificacion = {0} AND (CveMarca = {1} OR CveMarca IS NULL) AND (CveSubProyecto = {2} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {3} OR CveRinTamaño IS NULL) AND (TipoPromocion <> 3 OR (TipoPromocion = 3 AND CantidadMinima <= {4} )) ", CveClasifPS, CveMarcaPS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS, TxtCantidad.Text), Orderby:="CantidadMinima desc") + dr = DtPromociones.FiltroPrimero(String.Format("CvePS IS NULL AND CveClasificacion = {0} AND (CveMarca = {1} OR CveMarca IS NULL) AND (CveSubProyecto = {2} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {3} OR CveRinTamaño IS NULL) AND (TipoPromocion <> 3 OR (TipoPromocion = 3 AND CantidadMinima <= {4} )) ", CveClasifPS, CveMarcaPS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS, TxtCantidad.Text), Orderby:="CantidadMinima desc") End If End If @@ -17969,9 +18021,11 @@ Partial Class Ventas ConfiguraTipoDocto() End If End Sub - Private Sub CalculaTotalesVenta(Optional RecalculaImpuestosLocales As Boolean = True, Optional NCDescuento As Boolean = False) + Private Sub CalculaTotalesVenta(Optional RecalculaImpuestosLocales As Boolean = True, Optional NCDescuento As Boolean = False, Optional ValidarDescuentos As Boolean = False) Dim TotalSubTotal As Decimal = TmpDT.SUMD("TotalImporte") + Dim TotalSubTotalRef As Decimal = TotalSubTotal + Dim TotalDescuentos As Decimal = TmpDT.SUMD("Descuento") Dim TotalAmortizacion As Decimal = LblAmortizacion.Text.ToDecimal Dim TotalIVA As Decimal = TmpDT.SUMD("ImporteIVA") @@ -17983,7 +18037,11 @@ Partial Class Ventas Dim TotalProntoPago As Decimal = 0 - If TotalAmortizacion > 0 AndAlso TotalSubTotal = TotalAmortizacion Then ' si se amortizó completa la factura, debe de limpiar los impuestos + If ValidarDescuentos Then + TotalSubTotalRef = TotalSubTotal - TotalDescuentos + End If + + If TotalAmortizacion > 0 AndAlso TotalSubTotalRef = TotalAmortizacion Then ' si se amortizó completa la factura, debe de limpiar los impuestos If DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("3") Then For Each dr As DataRow In TmpDT.Rows dr("ImporteIVA") = 0 : dr("ImporteIEPS") = 0 : dr("ImporteRetIVA") = 0 : dr("ImporteRetISR") = 0 : dr("PorcentajeIVA") = 0 : dr("IVA") = 0 @@ -19766,7 +19824,6 @@ Partial Class Ventas End If Else sb.Append("No encontrado
    ") - script = "BtnRefacturacionConfirmarAceptacion();" End If Else sb.Append("¿Desea realizar la refacturación?
    ") @@ -20408,6 +20465,9 @@ Partial Class Ventas Case 2 'CONTADO If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") Or (UsuarioActual.Empresa.Funcionalidad(558).ToEntero() = 1 And DdlTipoComprobante.SelectedValue = "Cot") Then DivContado.Visible = True + If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then + DivTransferencia.Visible = False + End If TxtImporteContado.Text = TxtTotal.Text End If TxtFechaPago.Text = Now.ToShortDateString @@ -22040,13 +22100,21 @@ Partial Class Ventas sb.Append("La factura se encuentra en el siguiente estatus del SAT:
    ") Dim TotalT As Decimal = TxtTotal.Text.ToDecimal - Dim RFCReceptor As String = LblRFC.Text.Trim - 'SI SE FACTURO LA SUCURSAL DEL CLIENTE TOMA EL RFC DE ESTA - If FacturarSucursal AndAlso Me.ClienteSucursal IsNot Nothing Then - RFCReceptor = Me.ClienteSucursal.RFC + Dim RFCReceptor As String = "" + + If String.IsNullOrEmpty(Me.RFCReceptorVenta) Then + RFCReceptor = LblRFC.Text.Trim + + 'SI SE FACTURO LA SUCURSAL DEL CLIENTE TOMA EL RFC DE ESTA + If FacturarSucursal AndAlso Me.ClienteSucursal IsNot Nothing Then + RFCReceptor = Me.ClienteSucursal.RFC + End If + Else + RFCReceptor = Me.RFCReceptorVenta End If + Dim SWatch As New Stopwatch SWatch.Start() Dim Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, RFCReceptor, TotalT.ToString(), True) @@ -28249,6 +28317,15 @@ Partial Class Ventas End Sub Protected Sub RblTipo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RblTipo.SelectedIndexChanged HuboCambioRemi = Not HuboCambioRemi + 'TOTAL X CONCEPTO + If RblTipo.SelectedValue = "3" Then + ChkRemProductos.Visible = True + Else + ChkRemProductos.Visible = False + ChkRemProductos.Checked = False + End If + + ChkRemProductos_CheckedChanged(ChkRemProductos, EventArgs.Empty) End Sub Protected Sub BtnGuardarRemisiones_Click(sender As Object, e As EventArgs) Handles BtnGuardarRemisiones.Click If GvRem.Rows.Count > 0 Or GvRemPS.Rows.Count > 0 Then diff --git a/vwd.webinfo b/vwd.webinfo index cf2c6525a..25dd68416 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -240,6 +240,10 @@ + + + +