Saldos iniciales, cambios en OC numero de remision, validacion cultivo 158,
This commit is contained in:
@@ -2534,6 +2534,31 @@ Public Class ClsOC
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Public Function UpdateNumeroRemision(CveOrdenCompra As Integer, NumRemision As String, cveEmpresa As Integer) As Boolean
|
||||||
|
|
||||||
|
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
DataAdapter("PA_OC_OCNumeroRemisionUpdate")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveOrdenCompra", SqlDbType.Int).Value = CveOrdenCompra
|
||||||
|
.Add("@NumRemision", SqlDbType.VarChar).Value = NumRemision
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al actualizar el número de remisión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
#Region " IDisposable Support "
|
#Region " IDisposable Support "
|
||||||
' IDisposable
|
' IDisposable
|
||||||
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
|
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
|
||||||
@@ -2555,5 +2580,7 @@ Public Class ClsOC
|
|||||||
Dispose(True)
|
Dispose(True)
|
||||||
GC.SuppressFinalize(Me)
|
GC.SuppressFinalize(Me)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -5535,6 +5535,9 @@ Public Class ClsPaginas
|
|||||||
PaginaDict.Add("/Ventas/RepComisionesServecDetalle.aspx".ToUpper(), 782)
|
PaginaDict.Add("/Ventas/RepComisionesServecDetalle.aspx".ToUpper(), 782)
|
||||||
PaginaDict.Add("/Ventas/RepCancelacionesVentas.aspx".ToUpper(), 1325)
|
PaginaDict.Add("/Ventas/RepCancelacionesVentas.aspx".ToUpper(), 1325)
|
||||||
|
|
||||||
|
PaginaDict.Add("/Ventas/RepLineasAdicionales.aspx".ToUpper(), 1331)
|
||||||
|
PaginaDict.Add("/Ventas/RepLineasAdicionales.aspx?OP=OP".ToUpper(), 1332)
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
@@ -5663,11 +5666,6 @@ Public Class ClsPaginas
|
|||||||
PaginaDict.Add("/Acumuladores/RepPolizasVirtuales.aspx".ToUpper(), 1322)
|
PaginaDict.Add("/Acumuladores/RepPolizasVirtuales.aspx".ToUpper(), 1322)
|
||||||
|
|
||||||
|
|
||||||
PaginaDict.Add("/Ventas/RepLineasAdicionales.aspx".ToUpper(), -1)
|
|
||||||
PaginaDict.Add("/Ventas/RepLineasAdicionales.aspx?OP=LI".ToUpper(), -1)
|
|
||||||
PaginaDict.Add("/Ventas/RepLineasAdicionales.aspx?OP=OP".ToUpper(), -1)
|
|
||||||
|
|
||||||
|
|
||||||
'Antes de aquí.
|
'Antes de aquí.
|
||||||
Application("GlobalSIGAppPaginas") = PaginaDict
|
Application("GlobalSIGAppPaginas") = PaginaDict
|
||||||
|
|
||||||
|
|||||||
@@ -4417,6 +4417,12 @@
|
|||||||
<asp:DropDownList ID="DdlCultivosCuadro" CssClass=" form-control input-sm select2me" runat="server" DataTextField="TemporadaCuadro" Style="width: 100%; max-width: 600px;"
|
<asp:DropDownList ID="DdlCultivosCuadro" CssClass=" form-control input-sm select2me" runat="server" DataTextField="TemporadaCuadro" Style="width: 100%; max-width: 600px;"
|
||||||
DataValueField="CveCultivoCuadroDetalle" ValidationGroup="GrpDetalleGuardar">
|
DataValueField="CveCultivoCuadroDetalle" ValidationGroup="GrpDetalleGuardar">
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
|
|
||||||
|
<asp:RequiredFieldValidator ID="RfvDdlCultivosCuadro" runat="server" ControlToValidate="DdlCultivosCuadro" CssClass="help-block errorimput" InitialValue="-1"
|
||||||
|
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cultivo''</b> es necesario, por favor ingréselo."
|
||||||
|
ValidationGroup="GprAgregaPS" Visible="false" Display="None">
|
||||||
|
</asp:RequiredFieldValidator>
|
||||||
|
|
||||||
<label runat="server" id="Label9" for="<%= DdlCultivosCuadro.ClientID.ToString()%>">Cultivo:</label>
|
<label runat="server" id="Label9" for="<%= DdlCultivosCuadro.ClientID.ToString()%>">Cultivo:</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -16743,6 +16743,9 @@ Partial Class Compras_Compras
|
|||||||
DdlPSChange()
|
DdlPSChange()
|
||||||
End Sub
|
End Sub
|
||||||
Protected Sub DdlSubProyecto_SelectedIndexChanged(sender As Object, e As EventArgs)
|
Protected Sub DdlSubProyecto_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If Modalidad <> "U" Or Not CveFactura > 0 Then
|
If Modalidad <> "U" Or Not CveFactura > 0 Then
|
||||||
DdlPSChange()
|
DdlPSChange()
|
||||||
End If
|
End If
|
||||||
@@ -16759,6 +16762,13 @@ Partial Class Compras_Compras
|
|||||||
DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.CveEmpresa = 158 AndAlso DdlSubProyecto.SelectedValue.ToEntero > 0 AndAlso DdlSubProyecto.SelectedValue.ToEntero.Contiene(11881, 11882, 11886) Then
|
||||||
|
RfvDdlCultivosCuadro.Visible = True
|
||||||
|
Else
|
||||||
|
RfvDdlCultivosCuadro.Visible = False
|
||||||
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub DdlPSChange()
|
Private Sub DdlPSChange()
|
||||||
If CveProveedor > 0 Then
|
If CveProveedor > 0 Then
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -43,7 +43,8 @@
|
|||||||
<asp:ListItem Value="4" Text="Factura - Cliente"></asp:ListItem>
|
<asp:ListItem Value="4" Text="Factura - Cliente"></asp:ListItem>
|
||||||
<asp:ListItem Value="5" Text="Productos y Sevicios" ></asp:ListItem>
|
<asp:ListItem Value="5" Text="Productos y Sevicios" ></asp:ListItem>
|
||||||
<asp:ListItem Value="6" Text="RH - Personal"></asp:ListItem>
|
<asp:ListItem Value="6" Text="RH - Personal"></asp:ListItem>
|
||||||
<asp:ListItem Value="7" Text="AF - Activos Fijos" Enabled="false"></asp:ListItem>
|
<%--<asp:ListItem Value="7" Text="AF - Activos Fijos" Enabled="false"></asp:ListItem>--%>
|
||||||
|
<asp:ListItem Value="7" Text="AF - Activos Fijos" ></asp:ListItem>
|
||||||
<asp:ListItem Value="8" Text="Contabilidad - Cuentas Contables" Enabled="True"></asp:ListItem>
|
<asp:ListItem Value="8" Text="Contabilidad - Cuentas Contables" Enabled="True"></asp:ListItem>
|
||||||
<asp:ListItem Value="9" Text="ContaSIG - Cuentas Contables" Enabled="True"></asp:ListItem>
|
<asp:ListItem Value="9" Text="ContaSIG - Cuentas Contables" Enabled="True"></asp:ListItem>
|
||||||
<asp:ListItem Value="10" Text="Cont - Saldos Iniciales Cuentas" Enabled="True"></asp:ListItem>
|
<asp:ListItem Value="10" Text="Cont - Saldos Iniciales Cuentas" Enabled="True"></asp:ListItem>
|
||||||
@@ -52,13 +53,33 @@
|
|||||||
</asp:RadioButtonList>
|
</asp:RadioButtonList>
|
||||||
<div runat="server" id="divAlmacen">
|
<div runat="server" id="divAlmacen">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
Fecha:<asp:TextBox ID="TxtFecha" runat="server"></asp:TextBox>
|
<div class="col-md-2">
|
||||||
|
Fecha:
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
<asp:TextBox ID="TxtFecha" runat="server"></asp:TextBox>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
Concepto:
|
|
||||||
<asp:DropDownList ID="DdlConceptoAlmacen" runat="server">
|
<div class="row">
|
||||||
|
<div class="col-md-2">
|
||||||
|
Concepto:
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
<asp:DropDownList ID="DdlConceptoAlmacen" runat="server" CssClass="select2me">
|
||||||
<asp:ListItem Selected="True" Value="1">Carga Inicial</asp:ListItem>
|
<asp:ListItem Selected="True" Value="1">Carga Inicial</asp:ListItem>
|
||||||
<asp:ListItem Value="3">Salida Almacen</asp:ListItem>
|
<asp:ListItem Value="3">Salida Almacen</asp:ListItem>
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ Imports System.Data
|
|||||||
Imports System.Math
|
Imports System.Math
|
||||||
Imports Extensiones
|
Imports Extensiones
|
||||||
Imports GemBox.Spreadsheet
|
Imports GemBox.Spreadsheet
|
||||||
|
Imports log4net.Filter
|
||||||
|
|
||||||
Partial Class General_SaldosIniciales
|
Partial Class General_SaldosIniciales
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
@@ -150,6 +151,23 @@ Partial Class General_SaldosIniciales
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If Not dt.Columns(17).ColumnName.ToUpper = "TIPOPROVEEDOR" Then
|
||||||
|
Alert("El nombre de la columna 18 debe ser 'TipoProveedor'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If Not dt.Columns(18).ColumnName.ToUpper = "CUENTACONTABLE" Then
|
||||||
|
Alert("El nombre de la columna 19 debe ser 'CuentaContable'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -506,11 +524,24 @@ Partial Class General_SaldosIniciales
|
|||||||
dt.TableName = "Datos"
|
dt.TableName = "Datos"
|
||||||
Dim NumRows As Integer = dt.Rows.Count
|
Dim NumRows As Integer = dt.Rows.Count
|
||||||
|
|
||||||
|
Dim DTCuentasContables As New DataTable
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.TipoContabilizacion = 1 Then
|
||||||
|
|
||||||
|
Dim ObjConta As New ClsContabilidad
|
||||||
|
If ObjConta.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then
|
||||||
|
DTCuentasContables = ObjConta.DtResultados
|
||||||
|
End If
|
||||||
|
ObjConta.Dispose()
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
If Not ErrorArchivo Then
|
If Not ErrorArchivo Then
|
||||||
|
|
||||||
'P R O D U C T O S / S E R V I C I O S
|
'P R O D U C T O S / S E R V I C I O S
|
||||||
If RblFormato.SelectedValue = "5" Then
|
If RblFormato.SelectedValue = "5" Then
|
||||||
|
#Region "P R O D U C T O S / S E R V I C I O S"
|
||||||
Dim ObjPS As New ClsProductosServicios
|
Dim ObjPS As New ClsProductosServicios
|
||||||
Dim ObjGral As New ClsGenerales(ObjPS.IniciaTransacSQL())
|
Dim ObjGral As New ClsGenerales(ObjPS.IniciaTransacSQL())
|
||||||
Dim ObjClas As New ClsClasificaciones(ObjPS.IniciaTransacSQL())
|
Dim ObjClas As New ClsClasificaciones(ObjPS.IniciaTransacSQL())
|
||||||
@@ -557,11 +588,12 @@ Partial Class General_SaldosIniciales
|
|||||||
Dim UnidadMedida As String = Row("Unidad Medida").ToString.Trim
|
Dim UnidadMedida As String = Row("Unidad Medida").ToString.Trim
|
||||||
Dim Clasificacion As String = Row("Clasificacion").ToString.Trim
|
Dim Clasificacion As String = Row("Clasificacion").ToString.Trim
|
||||||
Dim Marca As String = Row("Marca").ToString.Trim
|
Dim Marca As String = Row("Marca").ToString.Trim
|
||||||
'Dim AplicaSerie As String = Row("AplicaSerie").ToString.Trim
|
Dim AplicaSerie As Boolean = If(Row("AplicaSerie").ToString.Trim.ToUpper.Contiene("1", "SI"), True, False)
|
||||||
Dim Precio As Double = Row("Precio").ToString.ToDouble
|
Dim Precio As Double = Row("Precio").ToString.ToDouble
|
||||||
Dim IEPS As Decimal = Row("IEPS").ToString.ToDecimal
|
Dim IEPS As Decimal = Row("IEPS").ToString.ToDecimal
|
||||||
Dim Tamaño As String = Row("Tamaño").ToString.Trim
|
Dim Tamaño As String = Row("Tamaño").ToString.Trim
|
||||||
Dim SATClavePS As String = Row("Código SAT").ToString.Trim
|
Dim SATClavePS As String = Row("Código SAT").ToString.Trim
|
||||||
|
|
||||||
Dim Clasificacion2 As String = If(dt.Columns.Contains("Servicio"), Row("Servicio").ToString.Trim, "")
|
Dim Clasificacion2 As String = If(dt.Columns.Contains("Servicio"), Row("Servicio").ToString.Trim, "")
|
||||||
Dim Litraje As Double = If(dt.Columns.Contains("Conversion Unidad"), Row("Conversion Unidad").ToString.ToDouble, 0)
|
Dim Litraje As Double = If(dt.Columns.Contains("Conversion Unidad"), Row("Conversion Unidad").ToString.ToDouble, 0)
|
||||||
Dim RinTamaño As String = If(Row.Table.Columns.Contains("Tamaño de Rin"), Row("Tamaño de Rin").ToString.Trim, "")
|
Dim RinTamaño As String = If(Row.Table.Columns.Contains("Tamaño de Rin"), Row("Tamaño de Rin").ToString.Trim, "")
|
||||||
@@ -569,6 +601,7 @@ Partial Class General_SaldosIniciales
|
|||||||
Dim SATClaveUnidadMedida As String = If(Row.Table.Columns.Contains("Clave Unidad"), Row("Clave Unidad").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 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 Modelo As String = If(Row.Table.Columns.Contains("Modelo"), Row("Modelo").ToString.Trim, "")
|
||||||
|
Dim RetIVA As Decimal = If(Row.Table.Columns.Contains("RetIVA"), Row("RetIVA").ToString.Trim.ToDecimal, 0D)
|
||||||
|
|
||||||
Dim CvePS As Integer = DTPS.FiltroPrimeroValor("CvePS", $"Codigo = '{Codigo}'").ToString.ToEntero
|
Dim CvePS As Integer = DTPS.FiltroPrimeroValor("CvePS", $"Codigo = '{Codigo}'").ToString.ToEntero
|
||||||
|
|
||||||
@@ -699,9 +732,9 @@ Partial Class General_SaldosIniciales
|
|||||||
'If Not CveClasificacion2 > 0 AndAlso Clasificacion2 <> "" Then Alert("No se encontró la Serie: " + Clasificacion2, TipoMensaje.MsgAdvertencia) : ErrorPS = True : Exit For
|
'If Not CveClasificacion2 > 0 AndAlso Clasificacion2 <> "" Then Alert("No se encontró la Serie: " + Clasificacion2, TipoMensaje.MsgAdvertencia) : ErrorPS = True : Exit For
|
||||||
|
|
||||||
If CvePS > 0 Then
|
If CvePS > 0 Then
|
||||||
If Not ObjPS.UpdatePS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, Precio, -1, 1, False, 0, True, True, True, UsuarioActual.CveUsuario, CvePS, -1, -1, CveSATPS,
|
If Not ObjPS.UpdatePS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, Precio, -1, RetIVA, False, -1, True, True, True, UsuarioActual.CveUsuario, CvePS, -1, -1, CveSATPS,
|
||||||
CveTipoPS:=CveTipoPS, CveMarca:=CveMarca, CveMedida:=CveMedida, CveRinTamaño:=CveRinTamaño,
|
CveTipoPS:=CveTipoPS, CveMarca:=CveMarca, CveMedida:=CveMedida, CveRinTamaño:=CveRinTamaño,
|
||||||
CveModelo:=CveModelo, Litraje:=Litraje, IEPSPorcentaje:=IEPS, CveClasificacion2:=CveClasificacion2, CveTamaño:=CveTamaño) Then
|
CveModelo:=CveModelo, Litraje:=Litraje, IEPSPorcentaje:=IEPS, CveClasificacion2:=CveClasificacion2, CveTamaño:=CveTamaño, AplicaSerie:=AplicaSerie) 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,
|
'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
|
' CveTipoPS:=CveTipoPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida) Then
|
||||||
ErrorPS = True
|
ErrorPS = True
|
||||||
@@ -715,9 +748,9 @@ Partial Class General_SaldosIniciales
|
|||||||
|
|
||||||
'If Codigo.Length > 0 Then
|
'If Codigo.Length > 0 Then
|
||||||
|
|
||||||
If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, Precio, -1, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1,
|
If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, Precio, -1, RetIVA, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1,
|
||||||
CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida, CveRinTamaño:=CveRinTamaño,
|
CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida, CveRinTamaño:=CveRinTamaño,
|
||||||
CveModelo:=CveModelo, Litraje:=Litraje, IEPSPorcentaje:=IEPS, CveClasificacion2:=CveClasificacion2, CveClasificacionDetalle:=CveClasificacionDetalle) <= 0 Then
|
CveModelo:=CveModelo, Litraje:=Litraje, IEPSPorcentaje:=IEPS, CveClasificacion2:=CveClasificacion2, CveClasificacionDetalle:=CveClasificacionDetalle, AplicaSerie:=AplicaSerie) <= 0 Then
|
||||||
'If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", "", Descripcion, 0, 0, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1,
|
'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
|
' CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida) <= 0 Then
|
||||||
ErrorPS = True
|
ErrorPS = True
|
||||||
@@ -755,14 +788,67 @@ Partial Class General_SaldosIniciales
|
|||||||
ObjClas.Dispose()
|
ObjClas.Dispose()
|
||||||
ObjVenta.Dispose()
|
ObjVenta.Dispose()
|
||||||
ObjUM.Dispose()
|
ObjUM.Dispose()
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
'P R O V E E D O R E S
|
'P R O V E E D O R E S
|
||||||
ElseIf RblFormato.SelectedValue = "1" Then
|
ElseIf RblFormato.SelectedValue = "1" Then
|
||||||
|
#Region "P R O V E E D O R E S"
|
||||||
Dim ObjProv As New ClsCompProveedores
|
Dim ObjProv As New ClsCompProveedores
|
||||||
Dim ErrorProv As Boolean = False
|
Dim ErrorProv As Boolean = False
|
||||||
Dim Contador As Integer = 0
|
Dim Contador As Integer = 0
|
||||||
Dim ExisteProveedor As Boolean = False
|
Dim ExisteProveedor As Boolean = False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If Not dt.Columns.Contains("CveCuentaContable") Then
|
||||||
|
dt.Columns.Add("CveCuentaContable", GetType(Integer))
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
Dim sbErrores As New StringBuilder
|
||||||
|
|
||||||
|
For Each Row As DataRow In dt.Rows
|
||||||
|
|
||||||
|
Dim RazonSocial As String = Row("RazonSocial").ToString
|
||||||
|
Dim CuentaContable As String = Row("CuentaContable").ToString.Trim.Replace("-", "").Replace(" ", "")
|
||||||
|
|
||||||
|
If CuentaContable.Length > 0 Then
|
||||||
|
Dim CveCuentaContable As Integer = DTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContable}'").ToEntero
|
||||||
|
|
||||||
|
If CveCuentaContable > 0 Then
|
||||||
|
Row("CveCuentaContable") = CveCuentaContable
|
||||||
|
Else
|
||||||
|
sbErrores.AppendLine($"Proveedor {RazonSocial} cuenta {CuentaContable} no encontrada.<br>")
|
||||||
|
ErrorProv = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
For Each Row As DataRow In dt.Rows
|
||||||
|
Dim RazonSocial As String = Row("RazonSocial").ToString
|
||||||
|
If Not (Row("TipoProveedor").ToString.Trim.ToUpper).Contiene("PROVEEDOR", "ACREEDOR") Then
|
||||||
|
sbErrores.AppendLine($"Proveedor {RazonSocial} TipoProveedor {Row("TipoProveedor")} invalido.<br>")
|
||||||
|
ErrorProv = True
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
If Not ErrorProv Then
|
||||||
|
dt.AcceptChanges()
|
||||||
|
Else
|
||||||
|
Alert($"Errores detectados <br>{sbErrores.ToString()}", TipoMensaje.MsgAdvertencia)
|
||||||
|
ObjProv.Dispose()
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ObjProv.IniciaTransacSQL()
|
ObjProv.IniciaTransacSQL()
|
||||||
For Each Row As DataRow In dt.Rows
|
For Each Row As DataRow In dt.Rows
|
||||||
|
|
||||||
@@ -793,8 +879,16 @@ Partial Class General_SaldosIniciales
|
|||||||
|
|
||||||
Dim CveProveedor As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedor", $"RFC = '{RFC}'").ToString.ToEntero
|
Dim CveProveedor As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedor", $"RFC = '{RFC}'").ToString.ToEntero
|
||||||
Dim CveProveedor2 As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedor", $"RazonSocial = '{RazonSocial}'").ToString.ToEntero
|
Dim CveProveedor2 As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedor", $"RazonSocial = '{RazonSocial}'").ToString.ToEntero
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Dim CveProveedor3 As Integer = 0
|
Dim CveProveedor3 As Integer = 0
|
||||||
|
|
||||||
|
Dim CveCuentaContable As Integer = Row("CveCuentaContable").ToString.ToEntero
|
||||||
|
Dim TipoProveedor As Integer = If(Row("TipoProveedor").ToString.ToUpper = "PROVEEDOR", 1, 2)
|
||||||
|
Dim CveConceptoCuentaAsiganaciones As Integer = If(TipoProveedor = 1, 5, 305)
|
||||||
|
|
||||||
|
|
||||||
If Codigo.Trim.Length > 0 Then
|
If Codigo.Trim.Length > 0 Then
|
||||||
CveProveedor3 = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedor", $"Codigo = '{Codigo}'").ToString.ToEntero
|
CveProveedor3 = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedor", $"Codigo = '{Codigo}'").ToString.ToEntero
|
||||||
End If
|
End If
|
||||||
@@ -822,7 +916,7 @@ Partial Class General_SaldosIniciales
|
|||||||
|
|
||||||
If Not ObjProv.AddProveedor(Codigo, RazonSocial, RazonSocial, RazonSocial, RFC, Dirrecion, Telefono,
|
If Not ObjProv.AddProveedor(Codigo, RazonSocial, RazonSocial, RazonSocial, RFC, Dirrecion, Telefono,
|
||||||
"", ContactoMail, CelularContacto, LimiteCredito, PlazoCobranza, "", 0, 0, 0, -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "",
|
"", ContactoMail, CelularContacto, LimiteCredito, PlazoCobranza, "", 0, 0, 0, -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "",
|
||||||
-1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, -1, "", "", False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CP:=CodigoPostal) Then
|
-1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, -1, "", "", False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CP:=CodigoPostal, CveRegimenFiscal:=0, CveTipoProveedor:=TipoProveedor) Then
|
||||||
ErrorProv = True
|
ErrorProv = True
|
||||||
Exit For
|
Exit For
|
||||||
|
|
||||||
@@ -848,22 +942,24 @@ Partial Class General_SaldosIniciales
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If CveCuentaContable > 0 Then
|
||||||
|
|
||||||
|
Dim ObjConta As New ClsContabilidad(ObjProv.IniciaTransacSQL)
|
||||||
|
|
||||||
|
If Not ObjConta.AddCuentasAsignaciones(CveConceptoCuentaAsiganaciones, UsuarioActual.CveEmpresa, CveCuentaContable, -1,
|
||||||
|
ObjProv.CveProveedor, -1, -1, -1, -1, 0, CveBancoCuenta:=-1, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=-1,
|
||||||
|
CveTipoGasto:=-1, RegeneraCuenta:=False) Then
|
||||||
|
ErrorProv = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If Not ErrorProv Then
|
If Not ErrorProv Then
|
||||||
ObjProv.Commit()
|
ObjProv.Commit()
|
||||||
If ObjProv.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then Application("GlobalDTCompProveedores") = ObjProv.DtResultados
|
If ObjProv.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then Application("GlobalDTCompProveedores") = ObjProv.DtResultados
|
||||||
@@ -879,14 +975,57 @@ Partial Class General_SaldosIniciales
|
|||||||
End If
|
End If
|
||||||
ObjProv.Dispose()
|
ObjProv.Dispose()
|
||||||
|
|
||||||
' C L I E N T E S
|
#End Region ' C L I E N T E S
|
||||||
ElseIf RblFormato.SelectedValue = "2" Then
|
ElseIf RblFormato.SelectedValue = "2" Then
|
||||||
|
|
||||||
|
|
||||||
|
#Region "C L I E N T E S"
|
||||||
|
|
||||||
|
|
||||||
Dim ObjClientes As New ClsClientes
|
Dim ObjClientes As New ClsClientes
|
||||||
Dim ErrorClientes As Boolean = False
|
Dim ErrorClientes As Boolean = False
|
||||||
Dim ExisteCliente As Boolean = False
|
Dim ExisteCliente As Boolean = False
|
||||||
Dim Contador As Integer = 0
|
Dim Contador As Integer = 0
|
||||||
Dim NumRow As Integer = 0
|
Dim NumRow As Integer = 0
|
||||||
|
|
||||||
|
|
||||||
|
If Not dt.Columns.Contains("CveCuentaContable") Then
|
||||||
|
dt.Columns.Add("CveCuentaContable", GetType(Integer))
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
Dim sbErrores As New StringBuilder
|
||||||
|
|
||||||
|
For Each Row As DataRow In dt.Rows
|
||||||
|
|
||||||
|
Dim RazonSocial As String = Row("RazonSocial").ToString
|
||||||
|
Dim CuentaContable As String = Row("CuentaContable").ToString.Trim.Replace("-", "").Replace(" ", "")
|
||||||
|
|
||||||
|
If CuentaContable.Length > 0 Then
|
||||||
|
Dim CveCuentaContable As Integer = DTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContable}'").ToEntero
|
||||||
|
|
||||||
|
If CveCuentaContable > 0 Then
|
||||||
|
Row("CveCuentaContable") = CveCuentaContable
|
||||||
|
Else
|
||||||
|
sbErrores.AppendLine($"Cliente {RazonSocial} cuenta {CuentaContable} no encontrada.<br>")
|
||||||
|
ErrorClientes = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If Not ErrorClientes Then
|
||||||
|
dt.AcceptChanges()
|
||||||
|
Else
|
||||||
|
Alert($"Errores detectados <br>{sbErrores.ToString()}", TipoMensaje.MsgAdvertencia)
|
||||||
|
ObjClientes.Dispose()
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ObjClientes.IniciaTransacSQL()
|
ObjClientes.IniciaTransacSQL()
|
||||||
For Each Row As DataRow In dt.FiltraParametros("RFC <> ''").Rows
|
For Each Row As DataRow In dt.FiltraParametros("RFC <> ''").Rows
|
||||||
NumRow = NumRow + 1
|
NumRow = NumRow + 1
|
||||||
@@ -925,6 +1064,7 @@ Partial Class General_SaldosIniciales
|
|||||||
Dim CobranzaContacto As String = If(dt.Columns.Contains("Encargado Pagoa"), Row("Encargado Pago").ToString, "")
|
Dim CobranzaContacto As String = If(dt.Columns.Contains("Encargado Pagoa"), Row("Encargado Pago").ToString, "")
|
||||||
Dim CobranzaTelefono As String = Row("Celular Contacto").ToString.Replace("-", "").Replace(" ", "").Replace("(", "").Replace(")", "")
|
Dim CobranzaTelefono As String = Row("Celular Contacto").ToString.Replace("-", "").Replace(" ", "").Replace("(", "").Replace(")", "")
|
||||||
Dim CveUsoCFDI As Integer = If(Row("UsoCFDI").ToString = "", -1, GlobalDTSATUsosCFDI().FiltroPrimeroValor("CveUsoCFDI", String.Format("UsoCFDI = '{0}'", Row("UsoCFDI").ToString)).ToEntero)
|
Dim CveUsoCFDI As Integer = If(Row("UsoCFDI").ToString = "", -1, GlobalDTSATUsosCFDI().FiltroPrimeroValor("CveUsoCFDI", String.Format("UsoCFDI = '{0}'", Row("UsoCFDI").ToString)).ToEntero)
|
||||||
|
Dim CveCuentaContable As Integer = Row("CveCuentaContable").ToString.ToEntero
|
||||||
' CobranzaContacto = Regex.Replace(CobranzaContacto, "[^0-9]", "")
|
' CobranzaContacto = Regex.Replace(CobranzaContacto, "[^0-9]", "")
|
||||||
|
|
||||||
'Telefono
|
'Telefono
|
||||||
@@ -1035,13 +1175,25 @@ Partial Class General_SaldosIniciales
|
|||||||
|
|
||||||
If Not ObjClientes.AddCliente(RazonSocial, RazonSocial, Calle, NumExt.ToString, "", Colonia, Poblacion, Poblacion, Estado, Pais, RFC, CodigoPostal, Telefono, Contacto, "", "", "", "", "", -1, False, 0, 0, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", CveVendedor, PlazoCobranza, -1,
|
If Not ObjClientes.AddCliente(RazonSocial, RazonSocial, Calle, NumExt.ToString, "", Colonia, Poblacion, Poblacion, Estado, Pais, RFC, CodigoPostal, Telefono, Contacto, "", "", "", "", "", -1, False, 0, 0, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", CveVendedor, PlazoCobranza, -1,
|
||||||
"-1", "-1", -1, "-1", -1, "0", -1, "0", 0, "", 0, "", 0, "", 0, "", "", Codigo, LimiteCredito, False, "", "", "", False, "", "", "", "", "", False, "", "", "", False, 0, -1, EsDistribuidor:=EsDistribuidor, CveClienteClasificacion:=CveClasificación, CargoUsado:=CargoUsado,
|
"-1", "-1", -1, "-1", -1, "0", -1, "0", 0, "", 0, "", 0, "", 0, "", "", Codigo, LimiteCredito, False, "", "", "", False, "", "", "", "", "", False, "", "", "", False, 0, -1, EsDistribuidor:=EsDistribuidor, CveClienteClasificacion:=CveClasificación, CargoUsado:=CargoUsado,
|
||||||
BonificacionUsado:=BonificacionUsado, CobranzaContacto:=CobranzaContacto, CobranzaCorreo:=CobranzaCorreo, DiasEspecifico:=DiasPagoEspecifico, DiasRevision:=DìaVisita, CobranzaTelefono:=CobranzaTelefono, CveFormaPago33:=CveFormaPago33, CveUsoCFDI:=CveUsoCFDI, CveSATEstado:=CveSATEstado) Then
|
BonificacionUsado:=BonificacionUsado, CobranzaContacto:=CobranzaContacto, CobranzaCorreo:=CobranzaCorreo, DiasEspecifico:=DiasPagoEspecifico, DiasRevision:=DìaVisita, CobranzaTelefono:=CobranzaTelefono, CveFormaPago33:=CveFormaPago33, CveUsoCFDI:=CveUsoCFDI, CveSATEstado:=CveSATEstado, CveAdminTrayecto:=0) Then
|
||||||
|
|
||||||
ErrorClientes = True
|
ErrorClientes = True
|
||||||
RFC.GuardaLog
|
RFC.GuardaLog
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If CveCuentaContable > 0 Then
|
||||||
|
|
||||||
|
Dim ObjConta As New ClsContabilidad(ObjClientes.IniciaTransacSQL)
|
||||||
|
|
||||||
|
If Not ObjConta.AddCuentasAsignaciones(1, UsuarioActual.CveEmpresa, CveCuentaContable, -1,
|
||||||
|
-1, ObjClientes.CveCliente, -1, -1, -1, 0, CveBancoCuenta:=-1, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=-1,
|
||||||
|
CveTipoGasto:=-1, RegeneraCuenta:=False) Then
|
||||||
|
ErrorClientes = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
@@ -1065,8 +1217,16 @@ Partial Class General_SaldosIniciales
|
|||||||
End If
|
End If
|
||||||
ObjClientes.Dispose()
|
ObjClientes.Dispose()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
'P R O V E E D O R E S - F A C T U R A S
|
'P R O V E E D O R E S - F A C T U R A S
|
||||||
ElseIf RblFormato.SelectedValue = "3" Then
|
ElseIf RblFormato.SelectedValue = "3" Then
|
||||||
|
|
||||||
|
#Region "P R O V E E D O R E S - F A C T U R A S"
|
||||||
|
|
||||||
Dim ObjCompras As New ClsCompras
|
Dim ObjCompras As New ClsCompras
|
||||||
Dim ErrorCompras As Boolean = False
|
Dim ErrorCompras As Boolean = False
|
||||||
Dim ObjConta As New ClsContabilidad(ObjCompras.IniciaTransacSQL())
|
Dim ObjConta As New ClsContabilidad(ObjCompras.IniciaTransacSQL())
|
||||||
@@ -1201,8 +1361,13 @@ Partial Class General_SaldosIniciales
|
|||||||
End If
|
End If
|
||||||
ObjCompras.Dispose()
|
ObjCompras.Dispose()
|
||||||
|
|
||||||
|
#End Region
|
||||||
|
|
||||||
'C L I E N T E S - F A C T U R A S
|
'C L I E N T E S - F A C T U R A S
|
||||||
ElseIf RblFormato.SelectedValue = "4" Then
|
ElseIf RblFormato.SelectedValue = "4" Then
|
||||||
|
|
||||||
|
#Region "C L I E N T E S - F A C T U R A S"
|
||||||
|
|
||||||
Dim ObjVentas As New ClsVentas
|
Dim ObjVentas As New ClsVentas
|
||||||
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
|
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
|
||||||
Dim ObjIE As New ClsBancos(ObjVentas.IniciaTransacSQL())
|
Dim ObjIE As New ClsBancos(ObjVentas.IniciaTransacSQL())
|
||||||
@@ -1389,19 +1554,64 @@ Partial Class General_SaldosIniciales
|
|||||||
End If
|
End If
|
||||||
ObjVentas.Dispose()
|
ObjVentas.Dispose()
|
||||||
|
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
' R H - P E R S O N A L
|
' R H - P E R S O N A L
|
||||||
ElseIf RblFormato.SelectedValue = "6" Then
|
ElseIf RblFormato.SelectedValue = "6" Then
|
||||||
|
|
||||||
UpPersonal(dt)
|
UpPersonal(dt, DTCuentasContables)
|
||||||
|
|
||||||
|
|
||||||
' A F - A C T I V O F I J O
|
' A F - A C T I V O F I J O
|
||||||
ElseIf RblFormato.SelectedValue = "7" Then
|
ElseIf RblFormato.SelectedValue = "7" Then
|
||||||
|
|
||||||
|
#Region " A F - A C T I V O F I J O"
|
||||||
|
Dim ErrorAF As Boolean = False
|
||||||
|
|
||||||
|
If Not dt.Columns.Contains("CveCuentaContable") Then
|
||||||
|
dt.Columns.Add("CveCuentaContable", GetType(Integer))
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
Dim sbErrores As New StringBuilder
|
||||||
|
|
||||||
|
For Each Row As DataRow In dt.Rows
|
||||||
|
|
||||||
|
Dim Codigo As String = Row("Código").ToString
|
||||||
|
Dim Descripcion As String = Row("Descripción").ToString
|
||||||
|
|
||||||
|
Dim CuentaContable As String = Row("CuentaContable").ToString.Trim.Replace("-", "").Replace(" ", "")
|
||||||
|
|
||||||
|
If CuentaContable.Length > 0 Then
|
||||||
|
Dim CveCuentaContable As Integer = DTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContable}'").ToEntero
|
||||||
|
|
||||||
|
If CveCuentaContable > 0 Then
|
||||||
|
Row("CveCuentaContable") = CveCuentaContable
|
||||||
|
Else
|
||||||
|
sbErrores.AppendLine($"Activo Fijo {Codigo} {Descripcion} cuenta {CuentaContable} no encontrada.<br>")
|
||||||
|
ErrorAF = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If Not ErrorAF Then
|
||||||
|
dt.AcceptChanges()
|
||||||
|
Else
|
||||||
|
Alert($"Errores detectados <br>{sbErrores.ToString()}", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
Dim ObjAF As New ClsAF
|
Dim ObjAF As New ClsAF
|
||||||
Try
|
Try
|
||||||
|
|
||||||
ObjAF.IniciaTransacSQL()
|
ObjAF.IniciaTransacSQL()
|
||||||
Dim ErrorAF As Boolean = False
|
|
||||||
Dim Contador As Integer = 0
|
Dim Contador As Integer = 0
|
||||||
Dim NumRow As Integer = 0
|
Dim NumRow As Integer = 0
|
||||||
|
|
||||||
@@ -1410,44 +1620,60 @@ Partial Class General_SaldosIniciales
|
|||||||
Dim Descripcion As String = Row("Descripción").ToString
|
Dim Descripcion As String = Row("Descripción").ToString
|
||||||
Dim TipoAF As String = Row("Tipo").ToString
|
Dim TipoAF As String = Row("Tipo").ToString
|
||||||
Dim SubTipo As String = Row("SubTipo").ToString
|
Dim SubTipo As String = Row("SubTipo").ToString
|
||||||
Dim Valor As String = Row("Valor").ToString
|
Dim Valor As Decimal = Row("Valor").ToString.ToDecimal
|
||||||
Dim FechaAF As String = Row("Fecha").ToString
|
Dim FechaAF As Date = Row("Fecha").ToString.ToDate
|
||||||
Dim NumeroSerie As String = Row("No. Serie").ToString
|
Dim NumeroSerie As String = Row("No. Serie").ToString
|
||||||
Dim Año As String = Row("Año").ToString
|
Dim Año As Integer = Row("Año").ToString.ToEntero
|
||||||
Dim CuentaContable As String = Row("Cuenta Contable").ToString
|
Dim CuentaContable As String = Row("Cuenta Contable").ToString
|
||||||
Dim Estado As String = Row("Estado").ToString
|
Dim Estado As String = Row("Estado").ToString
|
||||||
Dim Responsable As String = Row("Responsable").ToString
|
|
||||||
Dim Proyecto As String = Row("Proyecto").ToString
|
Dim Proyecto As String = Row("Proyecto").ToString
|
||||||
Dim SubProyecto As String = Row("SubProyecto").ToString
|
Dim SubProyecto As String = Row("SubProyecto").ToString
|
||||||
Dim Cliente As String = Row("Cliente").ToString
|
Dim Cliente As String = Row("Cliente").ToString
|
||||||
Dim Observaciones As String = Row("Observaciones").ToString
|
Dim Observaciones As String = Row("Observaciones").ToString
|
||||||
Dim CtaDepreciacion As String = Row("Cuenta Depreciación").ToString
|
Dim CtaDepreciacion As Integer = Row("Cuenta Depreciación").ToString.ToEntero
|
||||||
Dim PorcentajeDepreciacion As String = Row("% Depreciación").ToString
|
Dim PorcentajeDepreciacion As Decimal = Row("% Depreciación").ToString.ToDecimal
|
||||||
|
|
||||||
'CLAVES
|
'CLAVES
|
||||||
Dim CveAF As Integer = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveActivoFijo", $"Código = '{Codigo}'").ToString.ToEntero
|
Dim CveAF As Integer = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveActivoFijo", $"Codigo = '{Codigo}'").ToString.ToEntero
|
||||||
Dim CveSubTipoAF As Integer = GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubTipoActivoFijo", $"TipoActivoFijo = '{TipoAF}'").ToString.ToEntero
|
Dim CveSubTipoAF As Integer = GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubTipoActivoFijo", $"TipoActivoFijo = '{TipoAF}'").ToString.ToEntero
|
||||||
Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"SubProyecto = '{SubProyecto}'").ToString.ToEntero
|
Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"SubProyecto = '{SubProyecto}'").ToString.ToEntero
|
||||||
Dim CveEstadoFijo As Integer = GlobalDTEstadoActivoFijo().FiltroPrimeroValor("CveEstadoFijo", $"Estado = '{Estado}'").ToString.ToEntero
|
Dim CveEstadoActivoFijo As Integer = GlobalDTEstadoActivoFijo().FiltroPrimeroValor("CveEstadoActivoFijo", $"EstadoActivoFijo = '{Estado}'").ToString.ToEntero
|
||||||
Dim CveCliente As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCliente", $"Nombre = '{Cliente}'").ToString.ToEntero
|
Dim CveCliente As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCliente", $"Nombre = '{Cliente}'").ToString.ToEntero
|
||||||
|
Dim CveCuentaContable As Integer = Row("CveCuentaContable").ToString.ToEntero
|
||||||
|
|
||||||
|
|
||||||
'VALIDACIONES
|
'VALIDACIONES
|
||||||
If Not CveSubTipoAF > 0 Then Alert($"No se encontró el SubTipo: {TipoAF} Renglón: {NumRow}: ", TipoMensaje.MsgAdvertencia) : ErrorAF = True : Exit For
|
If Not CveSubTipoAF > 0 Then Alert($"No se encontró el SubTipo: {TipoAF} Renglón: {NumRow}: ", TipoMensaje.MsgAdvertencia) : ErrorAF = True : Exit For
|
||||||
If Not CveSubProyecto > 0 Then Alert($"No se encontró el SubProyecto: {SubProyecto} Renglón: {NumRow}: ", TipoMensaje.MsgAdvertencia) : ErrorAF = True : Exit For
|
If Not CveSubProyecto > 0 Then Alert($"No se encontró el SubProyecto: {SubProyecto} Renglón: {NumRow}: ", TipoMensaje.MsgAdvertencia) : ErrorAF = True : Exit For
|
||||||
If Not CveEstadoFijo > 0 Then Alert($"No se encontró el Estado: {CveEstadoFijo} Renglón: {NumRow}: ", TipoMensaje.MsgAdvertencia) : ErrorAF = True : Exit For
|
If Not CveEstadoActivoFijo > 0 Then Alert($"No se encontró el Estado: {Estado} Renglón: {NumRow}: ", TipoMensaje.MsgAdvertencia) : ErrorAF = True : Exit For
|
||||||
If Not CveCliente > 0 Then Alert($"No se encontró el Cliente: {Cliente} Renglón: {NumRow}: ", TipoMensaje.MsgAdvertencia) : ErrorAF = True : Exit For
|
If Not CveCliente > 0 Then CveCliente = -1
|
||||||
|
|
||||||
|
|
||||||
'If CveAF > 0 Then
|
If CveAF > 0 Then
|
||||||
' Contador = Contador + 1
|
Contador = Contador + 1
|
||||||
'Else
|
Else
|
||||||
' If Not ObjAF.AddActivosFijos(Codigo, Descripcion, Valor, FechaAF, CveSubTipoAF, -1, NumeroSerie, Año, CveSubProyecto, CtaDepreciacion, CveEstadoFijo,
|
|
||||||
' CtaDepreciacion, PorcentajeDepreciacion, Observaciones, CveCliente, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
CveAF = ObjAF.AddActivosFijos(Codigo, Descripcion, Valor, FechaAF, CveSubTipoAF, -1, NumeroSerie, Año, CveSubProyecto, CtaDepreciacion, CveEstadoActivoFijo,
|
||||||
' ErrorAF = True
|
CtaDepreciacion, PorcentajeDepreciacion, Observaciones, CveCliente, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
' Exit For
|
|
||||||
' End If
|
If CveAF > 0 Then
|
||||||
'End If
|
If CveCuentaContable > 0 Then
|
||||||
|
|
||||||
|
Dim ObjConta As New ClsContabilidad(ObjAF.IniciaTransacSQL)
|
||||||
|
|
||||||
|
If Not ObjConta.AddCuentasAsignaciones(49, UsuarioActual.CveEmpresa, CveCuentaContable, -1,
|
||||||
|
-1, -1, -1, -1, -1, 0, CveBancoCuenta:=-1, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=CveAF,
|
||||||
|
CveTipoGasto:=-1, RegeneraCuenta:=False) Then
|
||||||
|
ErrorAF = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
ErrorAF = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
NumRow = NumRow + 1
|
NumRow = NumRow + 1
|
||||||
Next
|
Next
|
||||||
@@ -1476,6 +1702,10 @@ Partial Class General_SaldosIniciales
|
|||||||
Finally
|
Finally
|
||||||
ObjAF.Dispose()
|
ObjAF.Dispose()
|
||||||
End Try
|
End Try
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
' C U E N T A S C O N T A B L E S
|
' C U E N T A S C O N T A B L E S
|
||||||
ElseIf RblFormato.SelectedValue = "8" Then
|
ElseIf RblFormato.SelectedValue = "8" Then
|
||||||
@@ -2122,7 +2352,48 @@ Partial Class General_SaldosIniciales
|
|||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
Protected Sub UpPersonal(dt As DataTable)
|
Protected Sub UpPersonal(dt As DataTable, DTCuentasContables As DataTable)
|
||||||
|
|
||||||
|
|
||||||
|
Dim ErrorValidacion As Boolean = False
|
||||||
|
|
||||||
|
If Not dt.Columns.Contains("CveCuentaContable") Then
|
||||||
|
dt.Columns.Add("CveCuentaContable", GetType(Integer))
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
Dim sbErrores As New StringBuilder
|
||||||
|
|
||||||
|
For Each Row As DataRow In dt.Rows
|
||||||
|
|
||||||
|
Dim ApellidoPaterno As String = Row("Apellido Paterno").ToString
|
||||||
|
Dim ApellidoMaterno As String = Row("Apellido Materno").ToString
|
||||||
|
Dim Nombre As String = Row("Nombre").ToString
|
||||||
|
|
||||||
|
|
||||||
|
Dim CuentaContable As String = Row("CuentaContable").ToString.Trim.Replace("-", "").Replace(" ", "")
|
||||||
|
|
||||||
|
If CuentaContable.Length > 0 Then
|
||||||
|
Dim CveCuentaContable As Integer = DTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContable}'").ToEntero
|
||||||
|
|
||||||
|
If CveCuentaContable > 0 Then
|
||||||
|
Row("CveCuentaContable") = CveCuentaContable
|
||||||
|
Else
|
||||||
|
sbErrores.AppendLine($"Empleado {Nombre} {ApellidoPaterno} {ApellidoMaterno} cuenta {CuentaContable} no encontrada.<br>")
|
||||||
|
ErrorValidacion = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If Not ErrorValidacion Then
|
||||||
|
dt.AcceptChanges()
|
||||||
|
Else
|
||||||
|
Alert($"Errores detectados <br>{sbErrores.ToString()}", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
Dim NumRows As Integer = 0
|
Dim NumRows As Integer = 0
|
||||||
Dim dtregistrospatronales As New DataTable
|
Dim dtregistrospatronales As New DataTable
|
||||||
@@ -2190,6 +2461,7 @@ Partial Class General_SaldosIniciales
|
|||||||
Dim SDI As String = Row("SDI").ToString
|
Dim SDI As String = Row("SDI").ToString
|
||||||
Dim MetodoPago As String = Row("Metodo Pago").ToString
|
Dim MetodoPago As String = Row("Metodo Pago").ToString
|
||||||
Dim Nominista As String = Row("Nominista").ToString
|
Dim Nominista As String = Row("Nominista").ToString
|
||||||
|
Dim CveCuentaContable As Integer = Row("CveCuentaContable").ToString.ToEntero
|
||||||
|
|
||||||
Dim NombreCompleto As String = $"{Nombre} {ApellidoPaterno} {ApellidoMaterno}"
|
Dim NombreCompleto As String = $"{Nombre} {ApellidoPaterno} {ApellidoMaterno}"
|
||||||
|
|
||||||
@@ -2261,7 +2533,7 @@ Partial Class General_SaldosIniciales
|
|||||||
CveDepartamento = dTDepartamentos.FiltroPrimeroValor("CveDepartamento", $"CveDepartamento = {CveDepartamento}").ToString.ToEntero
|
CveDepartamento = dTDepartamentos.FiltroPrimeroValor("CveDepartamento", $"CveDepartamento = {CveDepartamento}").ToString.ToEntero
|
||||||
Else
|
Else
|
||||||
|
|
||||||
CveDepartamento = DTDepartamentos.FiltroPrimeroValor("CveDepartamento", $"Departamento = '{Departamento}'").ToString.ToEntero
|
CveDepartamento = dTDepartamentos.FiltroPrimeroValor("CveDepartamento", $"Departamento = '{Departamento}'").ToString.ToEntero
|
||||||
End If
|
End If
|
||||||
If CveDepartamento <= 0 Then
|
If CveDepartamento <= 0 Then
|
||||||
CveDepartamento = -1
|
CveDepartamento = -1
|
||||||
@@ -2444,8 +2716,24 @@ Partial Class General_SaldosIniciales
|
|||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
ContadorAgregados = ContadorAgregados + 1
|
ContadorAgregados = ContadorAgregados + 1
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If CveCuentaContable > 0 Then
|
||||||
|
|
||||||
|
Dim ObjConta As New ClsContabilidad(ObjRH.IniciaTransacSQL)
|
||||||
|
|
||||||
|
If Not ObjConta.AddCuentasAsignaciones(28, UsuarioActual.CveEmpresa, CveCuentaContable, -1,
|
||||||
|
-1, -1, ObjRH.CvePersonal, -1, -1, 0, CveBancoCuenta:=-1, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=-1,
|
||||||
|
CveTipoGasto:=-1, RegeneraCuenta:=False) Then
|
||||||
|
ErrorRH = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
NumRow = NumRow + 1
|
NumRow = NumRow + 1
|
||||||
@@ -2766,6 +3054,7 @@ Partial Class General_SaldosIniciales
|
|||||||
libro.Cell(crow, ccol).Value = "SDI" : ccol = ccol + 1
|
libro.Cell(crow, ccol).Value = "SDI" : ccol = ccol + 1
|
||||||
libro.Cell(crow, ccol).Value = "Nominista" : ccol = ccol + 1
|
libro.Cell(crow, ccol).Value = "Nominista" : ccol = ccol + 1
|
||||||
libro.Cell(crow, ccol).Value = "Registro Patronal" : ccol = ccol + 1
|
libro.Cell(crow, ccol).Value = "Registro Patronal" : ccol = ccol + 1
|
||||||
|
libro.Cell(crow, ccol).Value = "CuentaContable" : 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.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(79, 129, 189))
|
||||||
@@ -2848,4 +3137,6 @@ Partial Class General_SaldosIniciales
|
|||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -335,9 +335,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-2" runat="server" id="DvNumRemision1" visible="false"><b>Núm. Remisión</b></div>
|
<div class="col-md-2" runat="server" id="DvNumRemision1" visible="false"><b>Núm. Remisión</b></div>
|
||||||
<div class="col-md-2" runat="server" id="DvNumRemision2" visible="false">
|
<div class="col-md-3" runat="server" id="DvNumRemision2" visible="false">
|
||||||
<asp:TextBox ID="TxtNumRemision" runat="server" MaxLength="10" Width="100%" onblur="ValidaNumRemision()"></asp:TextBox>
|
<asp:TextBox ID="TxtNumRemision" runat="server" MaxLength="10" Width="80%" onblur="ValidaNumRemision()"></asp:TextBox>
|
||||||
<asp:Button ID="BtnValidaNumRemision" ClientIDMode="Static" OnClick="BtnValidaNumRemision_Click" Style="display: none;" runat="server" />
|
<asp:Button ID="BtnValidaNumRemision" ClientIDMode="Static" OnClick="BtnValidaNumRemision_Click" Style="display: none;" runat="server" />
|
||||||
|
<asp:LinkButton runat="server" Visible="false" ID="LnkActualziarNumRemision" OnClick="LnkActualziarNumRemision_Click"
|
||||||
|
data-toggle="confirmation" data-popout="true" data-original-title="Actualizar número remisión"
|
||||||
|
data-btn-ok-label="si" Text="<i class='fa fa-check' style='color:green'></i>" CssClass="btn btn-default btn-circle btn-xs"
|
||||||
|
ToolTip="¿Está seguro que desea actualizar el número de remisión?" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -580,6 +580,22 @@ Partial Class OC_OC
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
|
||||||
|
Private Property NumeroRemisionOriginal As String
|
||||||
|
Get
|
||||||
|
|
||||||
|
If ViewState("NumeroRemisionOriginal") Is Nothing Then
|
||||||
|
ViewState("NumeroRemisionOriginal") = ""
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return ViewState("NumeroRemisionOriginal").ToString
|
||||||
|
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
ViewState("NumeroRemisionOriginal") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
@@ -899,14 +915,19 @@ Partial Class OC_OC
|
|||||||
|
|
||||||
'NO MOSTRAR LA OPCION DE ENTREGA DIRECTA (ECONOLLANTAS)
|
'NO MOSTRAR LA OPCION DE ENTREGA DIRECTA (ECONOLLANTAS)
|
||||||
If UsuarioActual.CveEmpresa = 141 Then
|
If UsuarioActual.CveEmpresa = 141 Then
|
||||||
DivEntregaDirecta.Visible = False
|
DivEntregaDirecta.Visible = False
|
||||||
ChkEntregaDirecta.Enabled = False
|
ChkEntregaDirecta.Enabled = False
|
||||||
ChkEntregaDirecta.Checked = False
|
ChkEntregaDirecta.Checked = False
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
MostrarUsuarioAsignado()
|
|
||||||
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
MostrarUsuarioAsignado()
|
||||||
|
|
||||||
Me.Form.DefaultButton = ""
|
Me.Form.DefaultButton = ""
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#Region " PERMISOS PAGINA "
|
#Region " PERMISOS PAGINA "
|
||||||
@@ -1416,6 +1437,7 @@ Partial Class OC_OC
|
|||||||
TxtFolioAdicional.Text = objOC.FolioAdicional
|
TxtFolioAdicional.Text = objOC.FolioAdicional
|
||||||
|
|
||||||
TxtNumRemision.Text = objOC.NumRemision
|
TxtNumRemision.Text = objOC.NumRemision
|
||||||
|
NumeroRemisionOriginal = objOC.NumRemision
|
||||||
|
|
||||||
If Not IsNothing(objOC.Tipo) Then
|
If Not IsNothing(objOC.Tipo) Then
|
||||||
|
|
||||||
@@ -8745,6 +8767,7 @@ Partial Class OC_OC
|
|||||||
|
|
||||||
Private Function ValidaNumRemision(NumRemision As String, TipoOC As String, CveProveedor As Integer, Optional OcTransaccion As SqlClient.SqlTransaction = Nothing, Optional CveOrdenCompraValida As Integer = -1) As Boolean
|
Private Function ValidaNumRemision(NumRemision As String, TipoOC As String, CveProveedor As Integer, Optional OcTransaccion As SqlClient.SqlTransaction = Nothing, Optional CveOrdenCompraValida As Integer = -1) As Boolean
|
||||||
Dim NumRemisionValida As Boolean = False
|
Dim NumRemisionValida As Boolean = False
|
||||||
|
LnkActualziarNumRemision.Visible = False
|
||||||
|
|
||||||
If NumRemision.Trim.Length > 0 Then
|
If NumRemision.Trim.Length > 0 Then
|
||||||
If UsuarioActual.Empresa.Funcionalidad(590) = "1" AndAlso UsuarioActual.CveRol = 1 Then
|
If UsuarioActual.Empresa.Funcionalidad(590) = "1" AndAlso UsuarioActual.CveRol = 1 Then
|
||||||
@@ -8752,7 +8775,7 @@ Partial Class OC_OC
|
|||||||
Dim ObjOC As New ClsOC(OcTransaccion)
|
Dim ObjOC As New ClsOC(OcTransaccion)
|
||||||
If ObjOC.GetVerificaNumRemision(CveProveedor, TipoOC, NumRemision, UsuarioActual.CveEmpresa, CveOrdenCompraValida) Then
|
If ObjOC.GetVerificaNumRemision(CveProveedor, TipoOC, NumRemision, UsuarioActual.CveEmpresa, CveOrdenCompraValida) Then
|
||||||
If ObjOC.DtResultados.Rows.Count > 0 Then
|
If ObjOC.DtResultados.Rows.Count > 0 Then
|
||||||
Alert($"La remision ya se encuentra asignada a la { If(TipoOC = "OC", "Orden de compra", "Requisición")} <a target='_blank' href='./OC.aspx?OC={ObjOC.DtResultados.Rows(0)("CveOrdenCompra").ToString()}' >{ObjOC.DtResultados.Rows(0)("Folio").ToString() }</a>", TipoMensaje.MsgAdvertencia)
|
Alert($"La remision ya se encuentra asignada a la { If(TipoOC = "OC", "Orden de compra", "Requisición")} <a target='_blank' class='Texto' href='./OC.aspx?OC={ObjOC.DtResultados.Rows(0)("CveOrdenCompra").ToString()}' >{ObjOC.DtResultados.Rows(0)("Folio").ToString() }</a>.", TipoMensaje.MsgAdvertencia)
|
||||||
Else
|
Else
|
||||||
NumRemisionValida = True
|
NumRemisionValida = True
|
||||||
End If
|
End If
|
||||||
@@ -8764,6 +8787,17 @@ Partial Class OC_OC
|
|||||||
NumRemisionValida = True
|
NumRemisionValida = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If NumRemisionValida Then
|
||||||
|
|
||||||
|
If CveOrdenCompra > 0 And BtnGuardar.Enabled And BtnGuardar.Visible Then
|
||||||
|
LnkActualziarNumRemision.Visible = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
UPPEmp.Update()
|
||||||
|
|
||||||
Return NumRemisionValida
|
Return NumRemisionValida
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
@@ -8774,5 +8808,43 @@ Partial Class OC_OC
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub LnkActualziarNumRemision_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If NumeroRemisionOriginal.Trim = TxtNumRemision.Text.Trim Then
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
If ValidaNumRemision(TxtNumRemision.Text.Trim(), TipoOC, DdlProveedores.SelectedValue.ToEntero, Nothing, If(CveOrdenCompra > 0, CveOrdenCompra, -1)) Then
|
||||||
|
|
||||||
|
Dim ObjOC As New ClsOC
|
||||||
|
Dim OCBitacora As New ClsOIEventos(ObjOC.IniciaTransacSQL())
|
||||||
|
Dim ErrorProceso As Boolean = False
|
||||||
|
|
||||||
|
If ObjOC.UpdateNumeroRemision(CveOrdenCompra, TxtNumRemision.Text, UsuarioActual.CveEmpresa) Then
|
||||||
|
If Not OCBitacora.AddEventoBitacora(If(NumeroRemisionOriginal.Trim.Length > 0, $"Se actualilizo número de remisión de { NumeroRemisionOriginal } a {TxtNumRemision.Text.Trim()}", $"Se agrego número de remisión {TxtNumRemision.Text.Trim()}"), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveOC:=CveOrdenCompra) Then
|
||||||
|
ErrorProceso = True
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
ErrorProceso = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not ErrorProceso Then
|
||||||
|
ObjOC.Commit()
|
||||||
|
CargaEventoBitacora()
|
||||||
|
NumeroRemisionOriginal = TxtNumRemision.Text.Trim
|
||||||
|
Alert("Número de remisión actualizado correctemante.")
|
||||||
|
Else
|
||||||
|
ObjOC.RollBack()
|
||||||
|
End If
|
||||||
|
|
||||||
|
ObjOC.Dispose()
|
||||||
|
|
||||||
|
Else
|
||||||
|
Alert("El número de remisión no es valido.")
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -4583,7 +4583,7 @@
|
|||||||
<asp:BoundField DataField="Proveedor" HeaderText="Proveedor" ItemStyle-HorizontalAlign="Left" />
|
<asp:BoundField DataField="Proveedor" HeaderText="Proveedor" ItemStyle-HorizontalAlign="Left" />
|
||||||
<asp:BoundField DataField="Importe" HeaderText="Importe" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField DataField="Importe" HeaderText="Importe" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField DataField="Abreviatura" HeaderText="Moneda" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField DataField="Abreviatura" HeaderText="Moneda" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField DataField="FechaVencimiento" HeaderText="F. Vencimiento" ItemStyle-HorizontalAlign="Left" />
|
<asp:BoundField DataField="FechaVencimiento" HeaderText="F. Vencimiento" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
|
||||||
<asp:BoundField DataField="Estatus" HeaderText="Estatus" ItemStyle-HorizontalAlign="Left" />
|
<asp:BoundField DataField="Estatus" HeaderText="Estatus" ItemStyle-HorizontalAlign="Left" />
|
||||||
<asp:BoundField DataField="TipoLineaSTR" HeaderText="Tipo Linea" ItemStyle-HorizontalAlign="Left" />
|
<asp:BoundField DataField="TipoLineaSTR" HeaderText="Tipo Linea" ItemStyle-HorizontalAlign="Left" />
|
||||||
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" />
|
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" />
|
||||||
@@ -6718,13 +6718,12 @@
|
|||||||
<label for="<%= TxtLineaAdicionalModal.ClientID.ToString()%>">
|
<label for="<%= TxtLineaAdicionalModal.ClientID.ToString()%>">
|
||||||
<asp:Literal ID="LtlLineaAdicionalModal" runat="server" Text="Linea Adicional:"></asp:Literal>
|
<asp:Literal ID="LtlLineaAdicionalModal" runat="server" Text="Linea Adicional:"></asp:Literal>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="form-group form-md-line-input input-iconright" style="padding-top:-5px!important">
|
<div class="form-group form-md-line-input input-iconright" style="padding-top:-5px!important">
|
||||||
<ADS:Dropdownlost ID="DdlProveedorLineaAdicionalModal" SelectedText="-" runat="server" CssStyle="width: 250px; selected2me; margin-top:4px;" Width="250px" DataTextField="RazonSocial" DataValueField="CveProveedor" CssClass="form-control input-sm DdlPS"></ADS:Dropdownlost>
|
<ADS:Dropdownlost ID="DdlProveedorLineaAdicionalModal" SelectedText="-" IncluyeTodos="false" runat="server" CssStyle="width: 250px; selected2me; margin-top:4px;" Width="250px" DataTextField="RazonSocial" DataValueField="CveProveedor" CssClass="form-control input-sm DdlPS"></ADS:Dropdownlost>
|
||||||
<label for="<%= DdlProveedorLineaAdicionalModal.ClientID.ToString()%>">Proveedor: </label>
|
<label for="<%= DdlProveedorLineaAdicionalModal.ClientID.ToString()%>">Proveedor: </label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -6809,8 +6808,6 @@
|
|||||||
|
|
||||||
<asp:DropDownList ID="DdlClasificacionLienaAdicionalModal" DataValueField="CveClasificacion" DataTextField="Clasificacion" Width="250px" runat="server" CssClass="form-control select2me">
|
<asp:DropDownList ID="DdlClasificacionLienaAdicionalModal" DataValueField="CveClasificacion" DataTextField="Clasificacion" Width="250px" runat="server" CssClass="form-control select2me">
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
<%--<asp:RequiredFieldValidator ID="RfvDdlClasificacionLienaAdicionalModal" InitialValue="-1" runat="server" ControlToValidate="DdlClasificacionLienaAdicionalModal" CssClass="help-block errorimput"
|
|
||||||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpLineaAdicional"></asp:RequiredFieldValidator>--%>
|
|
||||||
<label for="<%= DdlClasificacion.ClientID.ToString()%>">Clasificación:</label>
|
<label for="<%= DdlClasificacion.ClientID.ToString()%>">Clasificación:</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -935,7 +935,7 @@ Partial Class Clientes
|
|||||||
MostrarTxtDireccionesClienteEnvio()
|
MostrarTxtDireccionesClienteEnvio()
|
||||||
|
|
||||||
|
|
||||||
If CveCliente > 0 AndAlso UsuarioActual.CveEmpresa.Contiene(119, 1) Then
|
If CveCliente > 0 AndAlso UsuarioActual.CveEmpresa.Contiene(119, 1) AndAlso UsuarioActual.CveRol = 1 Then
|
||||||
CargaCombosLineasAdicionales()
|
CargaCombosLineasAdicionales()
|
||||||
TabLineasAdicionales.Visible = True
|
TabLineasAdicionales.Visible = True
|
||||||
LnkAgregarLineaAdicional.Visible = True
|
LnkAgregarLineaAdicional.Visible = True
|
||||||
@@ -10347,8 +10347,7 @@ Partial Class Clientes
|
|||||||
DdlProveedorLineaAdicionalModal.Attributes.Add("data-metodo", "getproveedores")
|
DdlProveedorLineaAdicionalModal.Attributes.Add("data-metodo", "getproveedores")
|
||||||
DdlProveedorLineaAdicionalModal.SelectedText = "-"
|
DdlProveedorLineaAdicionalModal.SelectedText = "-"
|
||||||
DdlProveedorLineaAdicionalModal.SelectedValue = "-1"
|
DdlProveedorLineaAdicionalModal.SelectedValue = "-1"
|
||||||
DdlProveedorLineaAdicionalModal.txtText.Value = "-"
|
|
||||||
DdlProveedorLineaAdicionalModal.txtValue.Value = "-1"
|
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
@@ -10420,7 +10419,7 @@ Partial Class Clientes
|
|||||||
|
|
||||||
If CveLineaAdicional > 0 Then
|
If CveLineaAdicional > 0 Then
|
||||||
If Not ObjVentas.UpdateLineasAdicionales(CveLineaAdicional, TxtLineaAdicionalModal.Text, CveCliente, DdlProveedorLineaAdicionalModal.SelectedValue.ToEntero, DdlTipoLineaAdicionalModal.SelectedValue.ToEntero, TxtImporteLineaAdicionalModal.Text.ToDecimal,
|
If Not ObjVentas.UpdateLineasAdicionales(CveLineaAdicional, TxtLineaAdicionalModal.Text, CveCliente, DdlProveedorLineaAdicionalModal.SelectedValue.ToEntero, DdlTipoLineaAdicionalModal.SelectedValue.ToEntero, TxtImporteLineaAdicionalModal.Text.ToDecimal,
|
||||||
DdlMonedaLineAdicionalModal.SelectedValue.ToEntero, TxtFechaVencimientoLineaAdicionalModal.Text.ToDate, UsuarioActual.CveUsuario, DdlClasificacionLienaAdicionalModal.SelectedValue.ToEntero, 0, UsuarioActual.CveEmpresa) Then
|
DdlMonedaLineAdicionalModal.SelectedValue.ToEntero, TxtFechaVencimientoLineaAdicionalModal.Text.ToDate, UsuarioActual.CveUsuario, DdlClasificacionLienaAdicionalModal.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa) Then
|
||||||
ErrorAgregar = True
|
ErrorAgregar = True
|
||||||
Else
|
Else
|
||||||
Alert("Linea Adicional Actualizada Correctamente")
|
Alert("Linea Adicional Actualizada Correctamente")
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
</style>
|
</style>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
|
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
|
||||||
<asp:Literal runat="server" ID="LtlEncabezado" ></asp:Literal>
|
<asp:Literal runat="server" ID="LtlEncabezado" Text="Reporte Lineas Adicionales"></asp:Literal>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
@@ -92,6 +92,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="portlet-body" style="display: none;">
|
<div class="portlet-body" style="display: none;">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-1 truncate" >Estatus:</div>
|
||||||
|
<div class="col-md-2 ">
|
||||||
|
<asp:DropDownList runat="server" ID="DdlEstatus" CssClass="select2me" Width="100%">
|
||||||
|
<asp:ListItem Text="Todos" Value="-1" Selected="True"></asp:ListItem>
|
||||||
|
<asp:ListItem Text="Registrado" Value="0"></asp:ListItem>
|
||||||
|
<asp:ListItem Text="Vinculado" Value="1"></asp:ListItem>
|
||||||
|
<asp:ListItem Text="Enviado" Value="2"></asp:ListItem>
|
||||||
|
</asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
@@ -120,6 +132,7 @@
|
|||||||
DataKeyNames="CveLineaAdicional,LineaAdicional,CveCliente,CveProveedor,TipoLinea,Importe,CveMoneda,FechaVencimiento,CveUsuario,CveClasificacionPS,FechaIng,CveEstatus,Proveedor,Comprobante"
|
DataKeyNames="CveLineaAdicional,LineaAdicional,CveCliente,CveProveedor,TipoLinea,Importe,CveMoneda,FechaVencimiento,CveUsuario,CveClasificacionPS,FechaIng,CveEstatus,Proveedor,Comprobante"
|
||||||
CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False"
|
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False"
|
||||||
|
OnRowDataBound="GvLineasAdicionales_RowDataBound"
|
||||||
>
|
>
|
||||||
<Columns>
|
<Columns>
|
||||||
|
|
||||||
@@ -129,15 +142,24 @@
|
|||||||
<asp:BoundField DataField="Proveedor" HeaderText="Proveedor" ItemStyle-HorizontalAlign="Left" />
|
<asp:BoundField DataField="Proveedor" HeaderText="Proveedor" ItemStyle-HorizontalAlign="Left" />
|
||||||
<asp:BoundField DataField="Importe" HeaderText="Importe" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField DataField="Importe" HeaderText="Importe" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField DataField="Abreviatura" HeaderText="Moneda" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField DataField="Abreviatura" HeaderText="Moneda" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField DataField="FechaVencimiento" HeaderText="F. Vencimiento" ItemStyle-HorizontalAlign="Left" />
|
<asp:BoundField DataField="FechaVencimiento" HeaderText="F. Vencimiento" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
|
||||||
<asp:BoundField DataField="Estatus" HeaderText="Estatus" ItemStyle-HorizontalAlign="Left" />
|
<asp:BoundField DataField="Estatus" HeaderText="Estatus" ItemStyle-HorizontalAlign="Left" />
|
||||||
<asp:BoundField DataField="TipoLineaSTR" HeaderText="Tipo Linea" ItemStyle-HorizontalAlign="Left" />
|
|
||||||
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" />
|
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" />
|
||||||
|
|
||||||
<asp:TemplateField HeaderText="Opciones" Visible="false">
|
<asp:TemplateField HeaderText="Opciones" Visible="false" ItemStyle-Width="120px">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:LinkButton ID="LnkCargarComprobante" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-upload'></i>" OnClick="LnkCargarComprobante_Click" />
|
<div class="row" style="width:118px" >
|
||||||
<asp:LinkButton ID="LnkCambiarEstatus" runat="server" AlternateText="Eliminar" CausesValidation="False" CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-arrow-right'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Cambiar Estado?" data-btn-ok-label="si" OnClick="LnkCambiarEstatus_Click" />
|
<div class="col-md-4" >
|
||||||
|
<asp:LinkButton ID="LnkCargarComprobante" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-upload'></i>" OnClick="LnkCargarComprobante_Click" />
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<asp:LinkButton ID="LnkDescargaComprobante" runat="server" AlternateText="Descarga" CausesValidation="False" CssClass="btn btn-circle btn-sm yellow" Text="<i class='fa fa-download'></i>" OnClick="LnkDescargaComprobante_Click" Visible="false" />
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<asp:LinkButton ID="LnkCambiarEstatus" runat="server" AlternateText="Eliminar" CausesValidation="False" CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-arrow-right'></i>"
|
||||||
|
data-toggle="confirmation" data-popout="true" data-original-title="¿Cambiar Estado a Enviado?" data-btn-ok-label="si" OnClick="LnkCambiarEstatus_Click" Visible="false" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
<ItemStyle Width="10%" />
|
<ItemStyle Width="10%" />
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
using System.Web.UI.WebControls;
|
using System.Web.UI.WebControls;
|
||||||
using Extensiones;
|
using Extensiones;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
using static Extensiones.ModExtensiones;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using ListItem = System.Web.UI.WebControls.ListItem;
|
using ListItem = System.Web.UI.WebControls.ListItem;
|
||||||
using DocumentFormat.OpenXml.Spreadsheet;
|
using DocumentFormat.OpenXml.Spreadsheet;
|
||||||
@@ -13,6 +15,25 @@ public partial class Ventas_RepLineasAdicionales : ClsPaginas
|
|||||||
|
|
||||||
private int CveLineaAdicional
|
private int CveLineaAdicional
|
||||||
{
|
{
|
||||||
|
get { return (ViewState["CveLineaAdicional"] == null) ? 0 : int.Parse(ViewState["CveLineaAdicional"].ToString()); }
|
||||||
|
set { ViewState["CveLineaAdicional"] =(int) value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
private int TipoLinea
|
||||||
|
{
|
||||||
|
get { return (ViewState["TipoLinea"] == null) ? 1: int.Parse(ViewState["TipoLinea"].ToString()); }
|
||||||
|
set { ViewState["TipoLinea"] = (int)value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
private DataTable DTDatosGvLineasAdicionales
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (ViewState["DTDatosGvLineasAdicionales"] == null)
|
||||||
|
{
|
||||||
|
ViewState["DTDatosGvLineasAdicionales"] = new DataTable();
|
||||||
|
}
|
||||||
|
return (DataTable)ViewState["DTDatosGvLineasAdicionales"];
|
||||||
}
|
}
|
||||||
set { ViewState["DTDatosGvLineasAdicionales"] = (DataTable)value; }
|
set { ViewState["DTDatosGvLineasAdicionales"] = (DataTable)value; }
|
||||||
}
|
}
|
||||||
@@ -33,6 +54,7 @@ public partial class Ventas_RepLineasAdicionales : ClsPaginas
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
protected void Page_Load(object sender, EventArgs e)
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
if (!IsPostBack)
|
if (!IsPostBack)
|
||||||
{
|
{
|
||||||
InicializaValores();
|
InicializaValores();
|
||||||
@@ -43,23 +65,20 @@ public partial class Ventas_RepLineasAdicionales : ClsPaginas
|
|||||||
private void InicializaValores()
|
private void InicializaValores()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (Request["OP"] != null && Request["OP"].ToString() == "PO")
|
if (Request["OP"] != null && Request["OP"].ToString() == "PO")
|
||||||
|
{
|
||||||
|
DVProveedor1.Visible = true;
|
||||||
DVProveedor2.Visible = true;
|
DVProveedor2.Visible = true;
|
||||||
GvLineasAdicionales.Columns[8].Visible = true;
|
GvLineasAdicionales.Columns[8].Visible = true;
|
||||||
TipoLinea = 2;
|
TipoLinea = 2;
|
||||||
LtlEncabezado.Text = "Reporte PO";
|
LtlEncabezado.Text = "Reporte PO";
|
||||||
}
|
}
|
||||||
|
|
||||||
//Carga Clientes
|
|
||||||
DdlClientes.DataSource = get_GlobalDTCliente(UsuarioActual.CveEmpresa, -1);
|
|
||||||
//Carga Clientes
|
//Carga Clientes
|
||||||
DdlClientes.DataSource = get_GlobalDTCliente(UsuarioActual.CveEmpresa, -1);
|
DdlClientes.DataSource = get_GlobalDTCliente(UsuarioActual.CveEmpresa, -1);
|
||||||
DdlClientes.DataBind();
|
DdlClientes.DataBind();
|
||||||
|
|
||||||
if(UsuarioActual.Empresa.Funcionalidad(105) == "1") {
|
if(UsuarioActual.Empresa.Funcionalidad(105) == "1") {
|
||||||
DdlProveedor.setEsWebService(true);
|
|
||||||
DdlProveedor.Attributes.Add("data-metodo", "getproveedores");
|
|
||||||
DdlProveedor.SelectedText = "Todos";
|
|
||||||
DdlProveedor.setEsWebService(true);
|
DdlProveedor.setEsWebService(true);
|
||||||
DdlProveedor.Attributes.Add("data-metodo", "getproveedores");
|
DdlProveedor.Attributes.Add("data-metodo", "getproveedores");
|
||||||
DdlProveedor.SelectedText = "Todos";
|
DdlProveedor.SelectedText = "Todos";
|
||||||
@@ -85,17 +104,19 @@ public partial class Ventas_RepLineasAdicionales : ClsPaginas
|
|||||||
protected void BtnConsultar_Click(object sender, EventArgs e)
|
protected void BtnConsultar_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
CargaDatos();
|
CargaDatos();
|
||||||
|
}
|
||||||
|
|
||||||
private void CargaDatos()
|
private void CargaDatos()
|
||||||
{
|
{
|
||||||
DTDatosGvLineasAdicionales = new DataTable();
|
DTDatosGvLineasAdicionales = new DataTable();
|
||||||
LnkDescargaExcel.Visible = false;
|
LnkDescargaExcel.Visible = false;
|
||||||
|
|
||||||
ClsVentas objVentas = new ClsVentas();
|
ClsVentas objVentas = new ClsVentas();
|
||||||
|
|
||||||
int CveProveedor = DdlProveedor.SelectedValue.ToEntero() > 0 ? DdlProveedor.SelectedValue.ToEntero() : -1;
|
int CveProveedor = DdlProveedor.SelectedValue.ToEntero() > 0 ? DdlProveedor.SelectedValue.ToEntero() : -1;
|
||||||
|
|
||||||
if(objVentas.GetLineasAdicionales(-1,DdlClientes.SelectedValue.ToEntero(),CveProveedor, TipoLinea, -1,txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), DdlEstatus.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa)){
|
if(objVentas.GetLineasAdicionales(-1,DdlClientes.SelectedValue.ToEntero(),CveProveedor, TipoLinea, -1,txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), DdlEstatus.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa)){
|
||||||
|
GvLineasAdicionales.DataSource = objVentas.DtResultados;
|
||||||
|
|
||||||
if( objVentas.DtResultados.Rows.Count > 0)
|
if( objVentas.DtResultados.Rows.Count > 0)
|
||||||
{
|
{
|
||||||
@@ -240,15 +261,62 @@ public partial class Ventas_RepLineasAdicionales : ClsPaginas
|
|||||||
errorCambioEstatus = true;
|
errorCambioEstatus = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!errorCambioEstatus)
|
|
||||||
if (!errorCambioEstatus)
|
if (!errorCambioEstatus)
|
||||||
{
|
{
|
||||||
CargaDatos();
|
CargaDatos();
|
||||||
}
|
}
|
||||||
objVentas.Dispose();
|
objVentas.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected void LnkDescargaExcel_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
GridView gvTemp = GvLineasAdicionales;
|
GridView gvTemp = GvLineasAdicionales;
|
||||||
gvTemp.Columns[8].Visible = false;
|
gvTemp.Columns[8].Visible = false;
|
||||||
|
gvTemp.ExportToExcelx( TipoLinea == 1 ? "RepLienasAdicionales":"RepPO");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected void GvLineasAdicionales_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||||
|
{
|
||||||
|
if(e.Row.RowType == DataControlRowType.DataRow)
|
||||||
|
{
|
||||||
|
if(e.Row.DataKey("CveEstatus").ToEntero().Contiene(2))
|
||||||
|
{
|
||||||
|
e.Row.FCLinkButton("LnkCambiarEstatus").Visible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.Row.DataKey("CveEstatus").ToEntero() == 3)
|
||||||
|
{
|
||||||
|
e.Row.FCLinkButton("LnkCargarComprobante").Visible = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.Row.DataKey("Comprobante").Length > 0)
|
||||||
|
{
|
||||||
|
FileInfo fi = new FileInfo($@"{UsuarioActual.Empresa.Ruta}\LineasAdicionales\{e.Row.DataKey("Comprobante")}");
|
||||||
|
LinkButton LnkDescargaComprobante = e.Row.FCLinkButton("LnkDescargaComprobante");
|
||||||
|
|
||||||
|
if (fi.Exists)
|
||||||
|
{
|
||||||
|
LnkDescargaComprobante.Visible = true;
|
||||||
|
ScriptManager.GetCurrent(this).RegisterPostBackControl(LnkDescargaComprobante);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void LnkDescargaComprobante_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
GridViewRow GvRow = (GridViewRow)((LinkButton)sender).NamingContainer;
|
||||||
|
string Comprobante = GvRow.DataKey("Comprobante");
|
||||||
|
FileInfo fi = new FileInfo($@"{UsuarioActual.Empresa.Ruta}\LineasAdicionales\{Comprobante}");
|
||||||
|
|
||||||
|
if (fi.Exists)
|
||||||
|
{
|
||||||
|
Response.Clear();
|
||||||
|
Response.AddHeader("Content-Disposition", "attachment; filename=" + fi.Name);
|
||||||
|
Response.AddHeader("Content-Length", fi.Length.ToString());
|
||||||
|
Response.ContentType = "text/octet-stream";
|
||||||
|
Response.Flush();
|
||||||
Response.TransmitFile(fi.FullName);
|
Response.TransmitFile(fi.FullName);
|
||||||
Reference in New Issue
Block a user