diff --git a/Bancos/IE.aspx b/Bancos/IE.aspx index 8220a8417..e1d841d00 100644 --- a/Bancos/IE.aspx +++ b/Bancos/IE.aspx @@ -50,9 +50,9 @@ Refacturar Complemento
  • - Cancelar Complemento + Cancelar Complemento - <%--data-original-title="¿Está seguro que desea cancelar el documento?" data-btn-ok-label="si" Style="color: #686868;"> + <%-- data-original-title="¿Está seguro que desea cancelar el documento?" data-btn-ok-label="si" Style="color: #686868;">
  • diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index fffc527d3..986e9c64a 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -408,12 +408,27 @@ Partial Class Bancos_IE Set(value As Integer) ViewState("IdCtaAnticipoExtranjera") = value End Set - End Property - - - + End Property + + Private Property CveEstatusIE As Integer + Get + If ViewState("CveEstatusIE") Is Nothing Then + Return -1 + Else + Return ViewState("CveEstatusIE").ToString.ToEntero + End If + End Get + Set(value As Integer) + ViewState("CveEstatusIE") = value + End Set + + End Property + + + + #Region "CANCELACIÓN COMPLEMENTO MODAL V2" - + Property CveComplementoPagoCancelar As Integer Get If ViewState("CveComplementoPagoCancelar") Is Nothing Then @@ -855,6 +870,8 @@ Partial Class Bancos_IE LblRegistroFecha.Text = ObjIE.FechaIng.ToShortDateString LblRegistroUsuario.Text = ObjIE.Usuario + CveEstatusIE = ObjIE.CveEstatusIE + Select Case ObjIE.CveEstatusIE Case 1 If Not ObjIE.FueConciliado Then @@ -954,6 +971,7 @@ Partial Class Bancos_IE LnkComplementoPago.Visible = True + If ObjIE.CveEstatusIE = 1 AndAlso ObjIE.CveIECancelado > 0 Then 'cuando es cheque devuelto TabCancelacion.Visible = True @@ -1060,14 +1078,12 @@ Partial Class Bancos_IE If Not ChkConciliado.Checked Then - - If Not VerificaComplementos(True) Then + If (Not VerificaComplementos(True)) And UsuarioActual.TienePermisoProceso(99) And ObjIE.CveEstatusIE <> 2 Then BtnEditar.Visible = True End If UpGuardar.Update() - End If @@ -4757,31 +4773,31 @@ Partial Class Bancos_IE End If ObjOI.Dispose() Return "" - End Function + End Function #End Region - + #Region " COMPLEMENTOS PAGO " - Private Sub CargaComplementosPago() - + Private Sub CargaComplementosPago() + + + + Dim ObjBancos As New ClsBancos If UsuarioActual.CveRol = 1 Then GvComplementoPagos.Columns(7).Visible = True - End If - + End If + + DVGenerarComplementoModal.Visible = False If ObjBancos.GetVincularPago(CveProveedor, CveCompra, 2, MinFecha, MaxFecha, UsuarioActual.CveEmpresa, CveIE) Then GvComplementoPagos.DataSource = ObjBancos.DtResultados - If ObjBancos.DtResultados.FiltraParametros(" Estatus IN (1,3) ").Rows.Count = 0 And Tipo.ToUpper = "CARGO" And CveCliente > 0 And UsuarioActual.CveRol = 1 Then - DVGenerarComplementoModal.Visible = True - Else - - DVGenerarComplementoModal.Visible = False + If ObjBancos.DtResultados.FiltraParametros(" Estatus IN (1,3) ").Rows.Count = 0 And Tipo.ToUpper = "CARGO" And CveCliente > 0 And UsuarioActual.CveRol = 1 And CveEstatusIE <> 2 Then + DVGenerarComplementoModal.Visible = True End If - Else - DVGenerarComplementoModal.Visible = False + Else GvComplementoPagos.DataSource = Nothing End If @@ -4801,8 +4817,8 @@ Partial Class Bancos_IE Protected Sub GvComplementoPagos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvComplementoPagos.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - e.Row.Cells(3).Text = String.Format("", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE")))) - e.Row.Cells(4).Text = String.Format("", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE")))) + e.Row.Cells(3).Text = String.Format("", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE")))) + e.Row.Cells(4).Text = String.Format("", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE")))) If e.Row.DataKey("Estatus").Contiene("1", "3") Then e.Row.FCLinkButton("LnkCancelarComplemetno").Visible = True @@ -4830,8 +4846,8 @@ Partial Class Bancos_IE If ObjBanco.GeneraTimbrePago(CveIE, -1, UsuarioActual, -1, FolioFiscalPadre, EsRegeneracion:=True) Then ObjBanco.Commit() Str.AppendFormat("Folio: {0}  ", ObjBanco.ComplementoSerieFolio) - Str.AppendFormat("XML    ", Encripta(String.Format("OP=Pag&EXT=xml&CveIE={0}&SerieFolio={1}", gvr.DataKey("CveIE").ToEntero, ObjBanco.ComplementoSerieFolio.Replace("&", "%26%")))) - Str.AppendFormat("PDF   ", Encripta(String.Format("OP=Pag&EXT=pdf&CveIE={0}&SerieFolio={1}", gvr.DataKey("CveIE").ToEntero, ObjBanco.ComplementoSerieFolio.Replace("&", "%26%")))) + Str.AppendFormat("XML    ", Encripta(String.Format("OP=Pag&EXT=xml&CveIE={0}&SerieFolio={1}", gvr.DataKey("CveIE").ToEntero, ObjBanco.ComplementoSerieFolio.Replace("&", "%26%")))) + Str.AppendFormat("PDF   ", Encripta(String.Format("OP=Pag&EXT=pdf&CveIE={0}&SerieFolio={1}", gvr.DataKey("CveIE").ToEntero, ObjBanco.ComplementoSerieFolio.Replace("&", "%26%")))) 'Str.Append($"{gvr.DataKey("Folio")}   {gvr.DataKey("NombreCliente")}
    ") PDFReciboDePagos(-1, gvr.DataKey("CveIE").ToEntero, ObjBanco.CveComplementoPago, False) Alert(Str.ToString, TipoMensaje.MsgInformacion) diff --git a/Empresas/Grales/SaldosIniciales/FormatoClientes.xlsx b/Empresas/Grales/SaldosIniciales/FormatoClientes.xlsx index 251dc040f..dbc90a51d 100644 Binary files a/Empresas/Grales/SaldosIniciales/FormatoClientes.xlsx and b/Empresas/Grales/SaldosIniciales/FormatoClientes.xlsx differ diff --git a/Empresas/Grales/SaldosIniciales/FormatoPS.xlsx b/Empresas/Grales/SaldosIniciales/FormatoPS.xlsx index d25e3f550..9daf55123 100644 Binary files a/Empresas/Grales/SaldosIniciales/FormatoPS.xlsx and b/Empresas/Grales/SaldosIniciales/FormatoPS.xlsx differ diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index cb02b6f95..9ff2eeba6 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -121,6 +121,12 @@ Partial Class General_SaldosIniciales Alert("El nombre de la treceava columna debe ser 'Plazo Cobranza'. Favor de corregirlo", TipoMensaje.MsgError) Exit Sub End If + If RblFormato.SelectedValue = "1" Then + If Not dt.Columns(14).ColumnName = "Es distribuidor" Then + Alert("El nombre de la catorceava columna debe ser 'Es distribuidor'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + End If ElseIf RblFormato.SelectedValue = "3" Or RblFormato.SelectedValue = "4" Then If Not dt.Columns(0).ColumnName = "Sucursal" Then @@ -489,16 +495,17 @@ Partial Class General_SaldosIniciales Dim Codigo As String = Row("Codigo").ToString Dim Descripcion As String = Row("Descripcion").ToString Dim TipoPS As String = Row("Tipo").ToString.Trim.ToUpper - Dim CodigoBarras As String = Row("Codigo Barras").ToString + Dim CodigoBarras As String = Row("Código Barras").ToString Dim UnidadMedida As String = Row("Unidad Medida").ToString.Trim Dim Clasificacion As String = Row("Clasificacion").ToString.Trim Dim Marca As String = Row("Marca").ToString.Trim - Dim RinTamaño As String = Row("Tamaño de Rin").ToString.Trim - Dim Medida As String = Row("Medida").ToString.Trim - Dim SATClavePS As String = Row("Codigo SAT").ToString.Trim - Dim SATClaveUnidadMedida As String = Row("Clave Unidad").ToString.Trim - Dim Linea As String = Row("Linea").ToString.Trim - Dim Modelo As String = Row("Modelo").ToString.Trim + Dim RinTamaño As String = If(Row.Table.Columns.Contains("Tamaño de Rin"), Row("Tamaño de Rin").ToString.Trim, "") + Dim Medida As String = If(Row.Table.Columns.Contains("Medida"), Row("Medida").ToString.Trim, "") + Dim SATClavePS As String = Row("Código SAT").ToString.Trim + Dim SATClaveUnidadMedida As String = If(Row.Table.Columns.Contains("Clave Unidad"), Row("Clave Unidad").ToString.Trim, "") + Dim Linea As String = If(Row.Table.Columns.Contains("Linea"), Row("Linea").ToString.Trim, "") + Dim Modelo As String = If(Row.Table.Columns.Contains("Modelo"), Row("Modelo").ToString.Trim, "") + Dim Tamaño As String = Row("Tamaño").ToString.Trim Dim CvePS As Integer = DTPS.FiltroPrimeroValor("CvePS", $"Codigo = '{Codigo}'").ToString.ToEntero @@ -506,6 +513,7 @@ Partial Class General_SaldosIniciales Dim CveClasificacion As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion}'").ToString.ToEntero Dim CveUnidadMedida As Integer = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"UnidadMedida = '{UnidadMedida}'").ToString.ToEntero Dim CveSATPS As Integer = GlobalDTPSATPS.FiltroPrimeroValor("CveSATPS", $"SATClavePS = '{SATClavePS}'").ToString.ToEntero + Dim CveTamaño As Integer = GlobalDTAcumTamaños.FiltroPrimeroValor("CveTamaño", $"Tamaño = '{Tamaño}'").ToString.ToEntero If Not CveClasificacion > 0 AndAlso Clasificacion <> "" Then If ObjClas.AddClasificaciones(Clasificacion, "", -1, "-1", -1, "-1", -1, "-1", @@ -587,16 +595,20 @@ Partial Class General_SaldosIniciales If Not ObjPS.UpdatePS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, 0, 1, 1, False, 0, True, True, True, UsuarioActual.CveUsuario, CvePS, -1, -1, CveSATPS, CveTipoPS:=CveTipoPS, CveMarca:=CveMarca, CveMedida:=CveMedida, CveRinTamaño:=CveRinTamaño, CveModelo:=CveModelo) Then + 'If Not ObjPS.UpdatePS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, 0, 1, 1, False, 0, True, True, True, UsuarioActual.CveUsuario, CvePS, -1, -1, CveSATPS, + ' CveTipoPS:=CveTipoPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida) Then ErrorPS = True - Codigo.GuardaLog - Exit For - Else - Contador += 1 + Codigo.GuardaLog + Exit For + Else + Contador += 1 End If Else If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", "", Descripcion, 0, 0, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1, - CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveMedida:=CveMedida, CveRinTamaño:=CveRinTamaño, + CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida, CveRinTamaño:=CveRinTamaño, CveModelo:=CveModelo) <= 0 Then + 'If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", "", Descripcion, 0, 0, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1, + ' CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida) <= 0 Then ErrorPS = True Codigo.GuardaLog Exit For @@ -712,6 +724,7 @@ Partial Class General_SaldosIniciales Dim Contacto As String = Row("Contacto").ToString Dim CelularContacto As String = Row("Celular Contacto").ToString Dim CveCliente As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString.ToEntero + Dim EsDistribuidor As Boolean = If(Row("Es distribuidor").ToString = "si", True, False) If CveCliente > 0 Then ExisteCliente = True @@ -724,7 +737,7 @@ Partial Class General_SaldosIniciales 'End If Else If Not ObjClientes.AddCliente(RazonSocial, RazonSocial, Calle, "", "", Colonia, "", "", Estado, Pais, RFC, CodigoPostal, "", "", Contacto, "", "", "", "", -1, False, 0, 0, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", -1, -1, -1, - "-1", "-1", -1, "-1", -1, "0", -1, "0", 0, "", 0, "", 0, "", 0, "", "", "", Codigo, 0, "", 1, False, "", "", "", False, "", "", "", "", "", False, "", "", "", False, 0, -1) Then + "-1", "-1", -1, "-1", -1, "0", -1, "0", 0, "", 0, "", 0, "", 0, "", "", "", Codigo, 0, "", 1, False, "", "", "", False, "", "", "", "", "", False, "", "", "", False, 0, -1, EsDistribuidor:=EsDistribuidor) Then ErrorClientes = True RFC.GuardaLog Exit For @@ -763,11 +776,11 @@ Partial Class General_SaldosIniciales Dim Encontrados As Integer = 0 DtProveedores = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) Dim RFC As String = "" -Dim drr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero("") + Dim drr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero("") Dim CvePS As Integer = drr("CvePS").ToString.ToEntero Dim CveUnidadMedida As Integer = drr("CveUnidadMedida").ToString.ToEntero Dim CveClasificacion As Integer = drr("CveClasificacion").ToString.ToEntero - Dim dtsubp As DataTable = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) + Dim dtsubp As DataTable = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) For Each Row As DataRow In dt.FiltraParametros("RFC <> ''").Rows @@ -783,7 +796,7 @@ Dim drr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero("") Dim Saldo As Decimal = Row("Saldo").ToString.ToDecimal Dim TipoDocto As String = Row("Tipo Documento").ToString Dim CveProveedor As Integer = DtProveedores.FiltroPrimeroValor("CveProveedor", $"RFC = '{RFC}'").ToString.ToEntero - GuardaLog(Sucursal + " - " + Row("Sucursal").ToString) + GuardaLog(Sucursal + " - " + Row("Sucursal").ToString) Dim RetIVA As Double = Row("Ret IVA").ToString.ToDouble Dim RetISR As Double = Row("Ret ISR").ToString.ToDouble Dim IEPS As Decimal = Row("IEPS").ToString.ToDecimal