This commit is contained in:
Antonio Gonzalez
2020-03-20 11:17:44 -07:00
48 changed files with 9747 additions and 9399 deletions

2
.gitignore vendored
View File

@@ -269,3 +269,5 @@ paket-files/
__pycache__/
*.pyc
/Utilerias
/Default.aspx
/Default.aspx.cs

View File

@@ -90,8 +90,8 @@
<label class="col-md-1 truncate">Estatus:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlEstatus" runat="server" CssClass="select2me" Width="100px" ValidationGroup="GrpGuardar">
<asp:ListItem Text="Todos" Value="-1" Selected="True"></asp:ListItem>
<asp:ListItem Text="Activo" Value="1"></asp:ListItem>
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Activo" Value="1" Selected="True"></asp:ListItem>
<asp:ListItem Text="Inactivo" Value="0"></asp:ListItem>
</asp:DropDownList>
</div>
@@ -151,7 +151,7 @@
&nbsp;<asp:Literal ID="LblPuntos" runat="server" Text='<%# Eval("Estatus")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="AreaTexto" ItemStyle-Width ="100px" HeaderText="Area" />
<asp:TemplateField HeaderText="Fecha Ing." ItemStyle-HorizontalAlign="Center" ItemStyle-Width="150px">
<ItemTemplate>
&nbsp;<asp:Literal ID="lblFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
@@ -281,6 +281,14 @@
<asp:RequiredFieldValidator ID="RfvLimite" runat="server" ControlToValidate="TxtLimite" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFolioGarantia"></asp:RequiredFieldValidator>
<label for="<%= TxtLimite.ClientID.ToString()%>">Limite:</label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<label for="<%= DdlArea.ClientID.ToString()%>">Area:</label>&nbsp;
<asp:DropDownList ID="DdlArea" runat="server" CssClass="select2me" Width="100px" ValidationGroup="GrpGuardar">
<asp:ListItem Value="1" Selected ="True">Piso</asp:ListItem>
<asp:ListItem Value="2">Almacen</asp:ListItem>
</asp:DropDownList>
<i></i>
</div>
<%-- <div class="form-group form-md-line-input input-iconright" style="width: 170px!important">
<asp:TextBox ID="TxtCargo" CssClass="form-control " Width="150px" runat="server" MaxLength="10" CausesValidation="true" Style="text-align: right!important; margin-right: 10px!important" OnKeyup="FormatoMoneda(this);"></asp:TextBox>

View File

@@ -38,7 +38,7 @@ Partial Class Acumuladores_CatFoliosGarantia
If Not Page.IsPostBack Then
CargaSubProyectos()
CargadatosGvFolioGarantia(-1, "-1")
CargadatosGvFolioGarantia(DdlEstatus.SelectedValue.ToEntero, DdlTipoFolio.SelectedValue)
End If
End Sub
@@ -57,7 +57,7 @@ Partial Class Acumuladores_CatFoliosGarantia
Dim objAcum As New ClsAcumuladores
If objAcum.FoliosGarantiaGet(-1, UsuarioActual.Empresa.CveEmpresa, Estatus:=EstatusValor, TipoFolio:=tipoFolioValor) Then
If objAcum.FoliosGarantiaGet(-1, UsuarioActual.Empresa.CveEmpresa, Estatus:=EstatusValor, TipoFolio:=tipoFolioValor, Area:=-1) Then
GvFolioGarantia.DataSource = objAcum.DtResultados
Else
GvFolioGarantia.DataSource = Nothing
@@ -116,7 +116,7 @@ Partial Class Acumuladores_CatFoliosGarantia
If Not Actualizar Then
If ObjAcum.FoliosGarantiaAdd(TxtFolioGarantia.Text, If(ChkEstatus.Checked = True, 1, 0), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlSubProyectos.SelectedValue.ToEntero, DdlTipoFolioModal.SelectedValue, TxtLimite.Text.ToEntero) Then
If ObjAcum.FoliosGarantiaAdd(TxtFolioGarantia.Text, If(ChkEstatus.Checked = True, 1, 0), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlSubProyectos.SelectedValue.ToEntero, DdlTipoFolioModal.SelectedValue, TxtLimite.Text.ToEntero, DdlArea.SelectedValue.ToEntero) Then
TxtFolioGarantia.Text = ""
ChkEstatus.Checked = True

View File

@@ -483,7 +483,7 @@ Public Class ClsAcumuladores
#Region " FOLIOS GARANTÍA "
Public Function FoliosGarantiaGet(CveFolioGarantia As Integer, CveEmpresa As Integer, Optional Estatus As Integer = -1, Optional TipoFolio As String = "-1") As Boolean
Public Function FoliosGarantiaGet(CveFolioGarantia As Integer, CveEmpresa As Integer, Optional Estatus As Integer = -1, Optional TipoFolio As String = "-1", Optional Area As Integer = 1) As Boolean
Dim Retorno As Boolean = False
'Data = New DataTable
@@ -493,7 +493,8 @@ Public Class ClsAcumuladores
.Add("@CveFolioGarantia", SqlDbType.Int).Value = CveFolioGarantia
.Add("@Estatus", SqlDbType.Int).Value = Estatus
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@tipoFolio", SqlDbType.VarChar).Value = TipoFolio
.Add("@tipoFolio", SqlDbType.VarChar).Value = TipoFolio
.Add("@Area", SqlDbType.Int).Value = Area
End With
Try
@@ -508,7 +509,7 @@ Public Class ClsAcumuladores
Return Retorno
End Function
Public Function FoliosGarantiaAdd(FolioGarantia As String, Estatus As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, TipoFolio As String, Limite As Integer) As Boolean
Public Function FoliosGarantiaAdd(FolioGarantia As String, Estatus As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, TipoFolio As String, Limite As Integer, Area As Integer) As Boolean
Dim Retorno As Boolean = False
'Data = New DataTable
@@ -522,7 +523,8 @@ Public Class ClsAcumuladores
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@TipoFolio", SqlDbType.VarChar).Value = TipoFolio
.Add("@Limite", SqlDbType.Int).Value = Limite
.Add("@Limite", SqlDbType.Int).Value = Limite
.Add("@Area", SqlDbType.Int).Value = Area
End With

View File

@@ -149,6 +149,24 @@ Public Class ClsContabilidad
#End Region
Public Function CuentasContablesSigGet(cveEmpresa As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Conta_CuentasContablesSigGet", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa
End With
Try
SqlAdapter.Fill(Data)
retorno = True
Catch ex1 As SqlException
OnError("Ocurrió un error al obtener las Cuentas Contables", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
Catch ex As Exception
OnError("Ocurrió un error al obtener las Cuentas Contables", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return retorno
End Function
#Region " C O N T A B I L I D A D - P R E P O L I Z A"
Public Function ObtenerTipoPoliza(Valor1 As String, Valor2 As String, CveEmpresa As Integer) As Integer
Dim Retorno As Integer = -1

View File

@@ -355,7 +355,7 @@ Public Class ClsInventarios
End Function
Public Function AddAlmacen(Almacen As String, CveTipoAlmacen As Integer, IdCtaContable As Integer, Modalidad As Integer, CveUsuario As Integer, CveEmpresa As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1) As Boolean
Public Function AddAlmacen(Almacen As String, CveTipoAlmacen As Integer, IdCtaContable As Integer, Modalidad As Integer, CveUsuario As Integer, CveEmpresa As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_AlmacenesAdd")
@@ -370,6 +370,7 @@ Public Class ClsInventarios
.Add("@Inventariable", SqlDbType.Bit).Value = Inventariable
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@Orden", SqlDbType.SmallInt).Value = Orden
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
End With
Try
@@ -388,7 +389,7 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function UpdateAlmacen(Almacen As String, CveTipoAlmacen As Integer, IdCtaContable As Integer, Modalidad As Integer, Estatus As Boolean, CveAlmacen As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1) As Boolean
Public Function UpdateAlmacen(Almacen As String, CveTipoAlmacen As Integer, IdCtaContable As Integer, Modalidad As Integer, Estatus As Boolean, CveAlmacen As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_AlmacenesUpdate")
@@ -403,6 +404,7 @@ Public Class ClsInventarios
.Add("@Inventariable", SqlDbType.Bit).Value = Inventariable
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@Orden", SqlDbType.SmallInt).Value = Orden
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
End With
Try

File diff suppressed because it is too large Load Diff

View File

@@ -463,7 +463,8 @@ Public Class ClsSisEmpresas
_Empresa.CveDistribuidor = Data.Rows(0)("CveDistribuidor").ToString.ToEntero
_Empresa.DiasPermitidos = Data.Rows(0)("DiasPermitidos").ToString.ToEntero
_Empresa.AsientoContableComprasContado = If(Data.Rows(0)("Conta_AsientoContableComprasContado").ToString = "", False, CBool(Data.Rows(0)("Conta_AsientoContableComprasContado").ToString))
_Empresa.TipoContabilizacion = Data.Rows(0)("Conta_TipoContabilizacion").ToString.ToEntero '0 - Sin Conta, 1- Contabilidad SIG, 2- Contabilidad Contpaq
_Empresa.TipoContabilizacion = Data.Rows(0)("Conta_TipoContabilizacion").ToString.ToEntero
_Empresa.TipoContabilidad = Data.Rows(0)("Conta_TipoContabilidad").ToString.ToEntero '0 - Sin Conta, 1- Contabilidad SIG, 2- Contabilidad Contpaq
_Empresa.DefaultAsistencias = If(Data.Rows(0)("RH_DefaultAsistencias").ToString = "", False, CBool(Data.Rows(0)("RH_DefaultAsistencias").ToString))
_Empresa.CIEC = Data.Rows(0)("CIEC").ToString
_Empresa.Localidad = Data.Rows(0)("Localidad").ToString

View File

@@ -891,7 +891,7 @@ Public Class ClsSisUsuarios
Return Retorno
End Function
Public Function AddBitacora(CveModulo As Integer, Accion As String, Resultado As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Public Function AddBitacora(CveModulo As Integer, Accion As String, Resultado As String, CveUsuario As Integer, CveEmpresa As Integer, Optional URL As String = "-1", Optional TiempodeEjecucion As Long = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Sis_UsuariosBitacoraAdd")
@@ -901,6 +901,8 @@ Public Class ClsSisUsuarios
.Add("@Resultado", SqlDbType.VarChar).Value = Resultado
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@URL", SqlDbType.VarChar).Value = URL
.Add("@TiempodeEjecucion", SqlDbType.BigInt).Value = TiempodeEjecucion
End With
Try

View File

@@ -153,6 +153,7 @@ Public Class Empresa
Public Property DiasPermitidos As Integer
Public Property AsientoContableComprasContado As Boolean
Public Property TipoContabilizacion As Integer
Public Property TipoContabilidad As Integer
Public Property DefaultAsistencias As Boolean
Public Property FormatoImpresion As Integer
Public Property EsPersonaFisica As Integer

View File

@@ -17,6 +17,7 @@ Public Class LogicNominas
Dim sw As Diagnostics.Stopwatch = Nothing
If guardarLogTimbrado Then
sw = New Diagnostics.Stopwatch
sw.Start()
End If
Dim cfdi As CFDITimbre = PreTimbrar(CveNomina, UsuarioActual) 'CvePersonal, CvePeriodo,

View File

@@ -8828,6 +8828,7 @@ Namespace Modelos
Estado = ""
Pais = ""
CP = ""
Telefono = ""
AplicaFord = False
Ford_GSDB = ""
AplicaFEMSA = False

View File

@@ -15,7 +15,7 @@ Public Class MyHub
Private Sub RemoveUsuarios()
End Sub
Public Shared Sub RemoveConexiones(CveUsuario As Integer)
Public Shared Sub RemoveConexiones(CveUsuario As Integer)
End Sub
Public Sub ShowUsersOnLine()

View File

@@ -31,4 +31,8 @@ Public Class Notificaciones
Clients.Users(Para).AlertaVentana(Titulo, Message, DirectCast(Tipo, Integer), timeoutseconds)
End Sub
'Public Shared Sub AlertaVentana(Message As String, Para As List(Of String), Optional Titulo As String = "", Optional timeoutseconds As Integer = 5, Optional Tipo As TipoNotificacion = TipoNotificacion.AlertaVentanaNoOcultar)
' Dim Clients As Hubs.IHubConnectionContext(Of Object) = GlobalHost.ConnectionManager.GetHubContext(Of Notificaciones)().Clients
' Clients.Users(Para).AlertaVentana(Titulo, Message, DirectCast(Tipo, Integer), timeoutseconds)
'End Sub
End Class

View File

@@ -115,6 +115,7 @@ Namespace ADSSession
getListasession = 3 'solo lectura
CambiarEmpresa = 4
getSession = 5
CambiarModulo = 6
End Enum
Public Enum OpcionHub As Integer
agregar = 1
@@ -158,7 +159,7 @@ Namespace ADSSession
HttpContext.Current.Session(strsessionDpage) = value
End Set
End Property
Public Shared Function SessionManager(opcion As OpcionSession, Optional obj As ADSSessionObj = Nothing, Optional CveEmpresa As Integer = -1, Optional SessionID As String = Nothing) As Object
Public Shared Function SessionManager(opcion As OpcionSession, Optional obj As ADSSessionObj = Nothing, Optional CveEmpresa As Integer = -1, Optional SessionID As String = Nothing, Optional modulo As String = "") As Object
SyncLock strsessionid 'todo el codigo que este dentro de este corchete no se ejecutara mas de una vez al mismo tiempo en el servidor
If _dicSessionobj Is Nothing Then
_dicSessionobj = New ConcurrentDictionary(Of String, ADSSessionObj)
@@ -194,6 +195,18 @@ Namespace ADSSession
obj.CveEmpresa = CveEmpresa
End If
retorno = obj
Case OpcionSession.CambiarModulo
If Not IsNothing(HttpContext.Current) AndAlso Not IsNothing(HttpContext.Current.Session) AndAlso Not IsNothing(HttpContext.Current.Session(strsessionid)) Then
obj = DirectCast(HttpContext.Current.Session(strsessionid), ADSSessionObj)
obj.Modulo = modulo
obj.LastPostback = DateTime.Now
If _dicSessionobj.TryGetValue(obj.SessionID, obj) Then
obj.Modulo = modulo
obj.LastPostback = DateTime.Now
End If
retorno = obj
End If
End Select
Catch ex As Exception
retorno = Nothing
@@ -227,6 +240,8 @@ Namespace ADSSession
End Sub
Public Property CveUsuario As Integer
Public Property CveEmpresa As Integer
Public Property Modulo As String
Public Property LastPostback As DateTime
Protected Property _SessionID As String
Private Property _ipAdrres As String
Public ReadOnly Property IpAddres As String

View File

@@ -33,8 +33,8 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
If Not GetEventos(CveUsuario, CveEmpresa, FI, FF) Then
'Convierte el objeto de Eventos en JSON
Dim oSerializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer
Dim sJSON As String = oSerializer.Serialize(events)
'Dim oSerializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer
Dim sJSON As String = Newtonsoft.Json.JsonConvert.SerializeObject(events)
context.Response.Write(sJSON)
End If

View File

@@ -363,7 +363,7 @@ Public Class SIGGPS : Implements IHttpHandler, IRequiresSessionState
strBody.Append("</tr>")
End If
strBody.Append("<tr>")
strBody.Append("<td style=""width: 187px;"" colspan=""3""><img src=""https://maps.googleapis.com/maps/api/staticmap?size=700x340&amp;zoom=14&amp;center=20.5269,-100.868&amp;path=&amp;markers=icon:http://gps.signalsgps.com/Imagenes/rsz_11rsz_car.png|20.5269,-100.868&amp;sensor=false&amp;key=AIzaSyAF7s8wwhzCVXDUYopc9mXxqaWB33cDro4"" /></td>")
strBody.AppendFormat("<td style=""width: 187px;"" colspan=""3""><img src=""{0}"" /></td>", Row("Liga"))
strBody.Append("</tr>")
strBody.Append("</tbody>")
strBody.Append("</table>")

View File

@@ -210,6 +210,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
DtRetorno = dt.FiltraParametros($"NombreComercial like '%{Name}%' OR Nombre like '%{Name}%' ")
End If
dt.Dispose()
End If
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
@@ -220,6 +221,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Else
context.Response.Write("[]")
End If
DtRetorno.Dispose()
Return retorno
End Function
@@ -256,6 +258,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
DtRetorno = dt.FiltraParametros($"NombreCortoProveedor like '%{Name}%'")
End If
dt.Dispose()
End If
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
@@ -266,7 +269,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Else
context.Response.Write("[]")
End If
DtRetorno.Dispose()
Return retorno
End Function
#End Region
@@ -464,6 +467,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
End Try
End If
DTPS = Nothing
End If
If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then
DtPSRetorno.Columns("CvePS").ColumnName = "id"
@@ -478,6 +482,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Else
context.Response.Write("[]")
End If
DtPSRetorno.Dispose()
End If
Return retorno

View File

@@ -322,6 +322,15 @@ Partial Class Bancos_PopIEVentas
End Set
End Property
Private Property CveCorte As Integer
Get
Return ViewState("CveCorte").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveCorte") = value
End Set
End Property
Private Property TipoCambioOriginal As Decimal
Get
Return ViewState("TipoCambioOriginal").ToString.ToDecimal
@@ -527,7 +536,7 @@ Partial Class Bancos_PopIEVentas
ViewState("IdCtaAnticipo") = 0
ViewState("IdCtaContMonedaExtranjeraAnticipo") = 0
ViewState("IdCtaContMonedaComplementariaAnticipo") = 0
CveCorte = -1
IdCuentaBancariaComplementaria = 0
@@ -672,48 +681,46 @@ Partial Class Bancos_PopIEVentas
If ObjVenta.DtResultados IsNot Nothing AndAlso ObjVenta.DtResultados.Rows.Count > 0 Then
'CargaProveedor
Dim dr As DataRow = ObjVenta.DtResultados.Rows(0)
Dim Validada As Boolean = True
'JJMQ:20190606 Se cancela código de validacion ante el SAT por lentitud en el servicio.
'Sustituir la línea anterior por todo lo siguiente hasta donde termina el end if para que valide de nueva cuenta
'Dim Validada As Boolean = False
'If Not UsuarioActual.Empresa.Funcionalidad(529) = "1" Then
If Not UsuarioActual.Empresa.Funcionalidad(529) = "1" Then
' Dim Valida As New ClsValidaCFDi(dr("FolioFiscal").ToString(), dr("ClienteRFC").ToString, UsuarioActual.Empresa.RFC)
Dim Valida As New ClsValidaCFDi(dr("FolioFiscal").ToString(), dr("ClienteRFC").ToString, UsuarioActual.Empresa.RFC)
' If Valida.EsValida > 0 Then
' If Valida.EsValida = 2 Then
' Validada = False
' 'Dim ObjDatos As New ClsCompras
If Valida.EsValida > 0 Then
If Valida.EsValida = 2 Then
Validada = False
'Dim ObjDatos As New ClsCompras
' 'If ObjDatos.UpdateEstatus(Valida.EsValida, gvr.DataKey("CveFactura").ToEntero) Then
'If ObjDatos.UpdateEstatus(Valida.EsValida, gvr.DataKey("CveFactura").ToEntero) Then
' 'End If
' 'ObjDatos.Dispose()
'End If
'ObjDatos.Dispose()
' BtnGuardar.Enabled = False
BtnGuardar.Enabled = False
' If UsuarioActual.Empresa.UsaAC Then
' RegistraScript("if (confirm('La factura está cancelada ante el SAT., ¿Desea eliminar la compra?')) { $get('BtnEliminarCompra').click();}")
' Else
' Alert("La factura está cancelada ante el SAT.")
' End If
If UsuarioActual.Empresa.UsaAC Then
RegistraScript("if (confirm('La factura está cancelada ante el SAT., ¿Desea eliminar la compra?')) { $get('BtnEliminarCompra').click();}")
Else
Alert("La factura está cancelada ante el SAT.")
End If
' Else
' Validada = True
' End If
' Else
' 'no se pudo validar, pero ya tuvo la primera vuelta de validacion
' Validada = True
' End If
' Valida.Dispose()
'Else
' Validada = True
'End If
Else
Validada = True
End If
Else
'no se pudo validar, pero ya tuvo la primera vuelta de validacion
Validada = True
End If
Valida.Dispose()
Else
Validada = True
End If
If Validada Then
@@ -725,7 +732,7 @@ Partial Class Bancos_PopIEVentas
CveMoneda = dr("CveMoneda").ToString.ToEntero
CveMonedaVenta = dr("CveMoneda").ToString.ToEntero
CveMonedaFiltros = dr("CveMoneda").ToString.ToEntero
NombreCliente = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Nombre", String.Format("CveCliente = {0}", CveCliente))
NombreCliente = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=CveCliente).FiltroPrimeroValor("Nombre", String.Format("CveCliente = {0}", CveCliente))
SerieFolio = dr("SerieFolio").ToString
TipoCambioOriginal = dr("TipoCambio").ToString.ToDecimal
CveSubProyectoVenta = dr("CveSubProyecto").ToString.ToEntero
@@ -777,6 +784,12 @@ Partial Class Bancos_PopIEVentas
FechaVenta = dr("Fecha").ToString.ToDate
SaldoVenta = dr("Saldo").ToString.ToDouble
'Cortes de Caja
If UsuarioActual.TienePermisoProceso(160) Then
CargaCorteCaja()
End If
End If
@@ -786,6 +799,19 @@ Partial Class Bancos_PopIEVentas
ObjVenta.Dispose()
End Sub
Private Sub CargaCorteCaja()
'Checar si hay un Turno Abierto
Dim ObjPVenta As New ClsPuntoVenta
If ObjPVenta.GetVta_Cortes("-1", "-1", UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, 0) Then
If ObjPVenta.DtResultados.Rows.Count > 0 Then
CveCorte = ObjPVenta.CveCorte
End If
End If
ObjPVenta.Dispose()
End Sub
Private Sub CargaCliente(ByVal CveCliente As Integer, RFC As String)
Dim ObjCliente As New ClsClientes
@@ -1497,7 +1523,7 @@ Partial Class Bancos_PopIEVentas
Select Case RBLContado.SelectedValue
Case "1" ' Banco
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, Fecha, TxtFolio.Text.Trim, TxtPagueseA.Text.Trim, ImportePagado, CveMoneda, tipoCambioPago, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1), CveCuentaDeposito:=CveCuentaDeposito, Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"))
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, Fecha, TxtFolio.Text.Trim, TxtPagueseA.Text.Trim, ImportePagado, CveMoneda, tipoCambioPago, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1), CveCuentaDeposito:=CveCuentaDeposito, Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"), CveCorte:=CveCorte)
If CveIE > 0 Then
If CveVenta > 0 Then
CveConcepto = 2

View File

@@ -12,7 +12,7 @@
<asp:Content ID="Content8" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content9" ContentPlaceHolderID="C" runat="Server">
<rvweb:ReportViewer Width="1000" Height="500" ID="ReportViewer1" runat="server"></rvweb:ReportViewer>
</asp:Content>
<asp:Content ID="Content10" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -129,7 +129,7 @@
<asp:TemplateField>
<ItemTemplate>
<asp:Panel ID="PnlDetalleCompras" runat="server" CssClass="Texto">
<asp:GridView ID="GvD" runat="server" AutoGenerateColumns="False" CssClass="table detallerow table-hover" Style=" float: right; width: 95%;" DataKeyNames="IdCtaContable,Cargo,Abono" GridLines="None" OnRowDataBound="GvD_RowDataBound">
<asp:GridView ID="GvD" runat="server" AutoGenerateColumns="False" CssClass="table detallerow table-hover" Style=" float: right; width: 95%;" DataKeyNames="IdCtaContable,CveCuenta,Cargo,Abono" GridLines="None" OnRowDataBound="GvD_RowDataBound">
<Columns>
<asp:BoundField DataField="ConceptoContable" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" HeaderText="Movimiento">
<ItemStyle HorizontalAlign="Left" Width="150px" />
@@ -142,7 +142,7 @@
<asp:BoundField DataField="SubProyecto" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderText="SubProyecto">
<ItemStyle HorizontalAlign="Left" Width="120px" />
</asp:BoundField>
<asp:BoundField DataField="IdCtaContable" ItemStyle-Font-Italic="true" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" ItemStyle-CssClass="truncate" HeaderText="Cuenta">
<asp:BoundField DataField="CodigoNombreCuenta" ItemStyle-Font-Italic="true" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" ItemStyle-CssClass="truncate" HeaderText="Cuenta">
<ItemStyle CssClass="truncate" Font-Italic="True" HorizontalAlign="Left" Width="150px" />
</asp:BoundField>
<asp:TemplateField HeaderText="Cargos">
@@ -249,7 +249,7 @@
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="SubProyecto" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" HeaderText="SubProyecto" />
<asp:BoundField DataField="IdCtaContable" ItemStyle-Font-Italic="true" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" ItemStyle-CssClass="truncate" HeaderText="Cuenta" />
<asp:BoundField DataField="CodigoNombreCuenta" ItemStyle-Font-Italic="true" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" ItemStyle-CssClass="truncate" HeaderText="Cuenta" />
<asp:TemplateField HeaderText="Cargos">
<ItemTemplate>
<asp:Literal ID="LtlC" runat="server" Text='<%# Eval("Cargo", "{0:N2}") %>'></asp:Literal>
@@ -345,7 +345,7 @@
<asp:TemplateField>
<ItemTemplate>
<asp:Panel ID="PnlDetalleAnticipos" runat="server">
<asp:GridView ID="GvD" runat="server" AutoGenerateColumns="false" CssClass="table detallerow table-hover" Style="text-align: center; float: right; width: 95%;" DataKeyNames="IdCtaContable, Cargo, Abono" GridLines="None" OnRowDataBound="GvD_RowDataBound">
<asp:GridView ID="GvD" runat="server" AutoGenerateColumns="false" CssClass="table detallerow table-hover" Style="text-align: center; float: right; width: 95%;" DataKeyNames="IdCtaContable,CveCuenta, Cargo, Abono" GridLines="None" OnRowDataBound="GvD_RowDataBound">
<Columns>
<asp:BoundField DataField="ConceptoContable" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" HeaderText="Movimiento" />
<asp:TemplateField HeaderText="Concepto">
@@ -354,7 +354,7 @@
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="SubProyecto" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderText="SubProyecto" />
<asp:BoundField DataField="IdCtaContable" ItemStyle-Font-Size="Smaller" ItemStyle-Font-Italic="true" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" ItemStyle-CssClass="truncate" HeaderText="Cuenta" />
<asp:BoundField DataField="CodigoNombreCuenta" ItemStyle-Font-Size="Smaller" ItemStyle-Font-Italic="true" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" ItemStyle-CssClass="truncate" HeaderText="Cuenta" />
<asp:BoundField DataField="Cargo" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" DataFormatString="{0:N2}" HeaderText="Cargos" />
<asp:BoundField DataField="Abono" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" DataFormatString="{0:N2}" HeaderText="Abonos" />
</Columns>
@@ -435,7 +435,7 @@
<asp:TemplateField>
<ItemTemplate>
<asp:Panel ID="PnlDetalleAmortizaciones" runat="server">
<asp:GridView ID="GvD" runat="server" AutoGenerateColumns="false" CssClass="table detallerow table-hover" Style="text-align: center; float: right; width: 95%;" DataKeyNames="IdCtaContable, Cargo, Abono" GridLines="None" OnRowDataBound="GvD_RowDataBound">
<asp:GridView ID="GvD" runat="server" AutoGenerateColumns="false" CssClass="table detallerow table-hover" Style="text-align: center; float: right; width: 95%;" DataKeyNames="IdCtaContable,CveCuenta, Cargo, Abono" GridLines="None" OnRowDataBound="GvD_RowDataBound">
<Columns>
<asp:BoundField DataField="ConceptoContable" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" HeaderText="Movimiento" />
<asp:TemplateField HeaderText="Concepto">
@@ -444,7 +444,7 @@
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="SubProyecto" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderText="SubProyecto" />
<asp:BoundField DataField="IdCtaContable" ItemStyle-Font-Size="Smaller" ItemStyle-Font-Italic="true" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" ItemStyle-CssClass="truncate" HeaderText="Cuenta" />
<asp:BoundField DataField="CodigoNombreCuenta" ItemStyle-Font-Size="Smaller" ItemStyle-Font-Italic="true" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" ItemStyle-CssClass="truncate" HeaderText="Cuenta" />
<asp:BoundField DataField="Cargo" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" DataFormatString="{0:N2}" HeaderText="Cargos" />
<asp:BoundField DataField="Abono" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" DataFormatString="{0:N2}" HeaderText="Abonos" />
</Columns>

View File

@@ -42,7 +42,7 @@ public partial class Contabilidad_ContabilizacionCompras : ClsPaginas
TienePermisoEditar = false;
DdlProveedores.setEsWebService(true);
DdlProveedores.Attributes.Add("data-metodo", "getproveedores");
if (UsuarioActual.Empresa.UsaContabilidad)
if (UsuarioActual.Empresa.TipoContabilidad == 2 && UsuarioActual.Empresa.UsaContabilidad)
{
TienePermisoEditar = false;
ClsContPAQi ObjCont = new ClsContPAQi(UsuarioActual.Empresa);
@@ -65,23 +65,27 @@ public partial class Contabilidad_ContabilizacionCompras : ClsPaginas
txtFechaF.Text = DateTime.Now.ToShortDateString();
//CargaDatos();
}
if (UsuarioActual.CveRol == 1 || UsuarioActual.CveUsuario == 17 || UsuarioActual.CveUsuario == 171 || UsuarioActual.TienePermisoProceso(221))
{
TienePermisoEditar = true;
TienePermisoVerPoliza = true;
}
}
else
if (UsuarioActual.CveRol == 1 || UsuarioActual.CveUsuario == 17 || UsuarioActual.CveUsuario == 171 || UsuarioActual.TienePermisoProceso(221))
{
Alert("Este módulo requiere el uso de Contabilidad.", ModExtensiones.TipoMensaje.MsgAdvertencia);
// BtnConsultar.Enabled = false;
BtnContabilizarCompras.Enabled = false;
BtnContabilizarPagos.Enabled = false;
BtnContabilizarAnticipos.Enabled = false;
BtnContabilizarAmortizaciones.Enabled = false;
TienePermisoEditar = true;
TienePermisoVerPoliza = true;
}
txtFechaI.Text = DateTime.Now.ToShortDateString();
txtFechaF.Text = DateTime.Now.ToShortDateString();
//else
//{
// Alert("Este módulo requiere el uso de Contabilidad.", ModExtensiones.TipoMensaje.MsgAdvertencia);
// // BtnConsultar.Enabled = false;
// BtnContabilizarCompras.Enabled = false;
// BtnContabilizarPagos.Enabled = false;
// BtnContabilizarAnticipos.Enabled = false;
// BtnContabilizarAmortizaciones.Enabled = false;
//}
}
BtnConsultar.Click += new EventHandler(this.BtnConsultar_Click);
@@ -310,6 +314,7 @@ public partial class Contabilidad_ContabilizacionCompras : ClsPaginas
if (e.Row.RowType == DataControlRowType.DataRow)
{
int cuenta = e.Row.DataKey("IdCtaContable").ToString().ToEntero();
int cvecuenta = e.Row.DataKey("CveCuenta").ToString().ToEntero();
int CveConcepto = e.Row.DBCampo("CveConceptoContable").ToEntero();
if (CveConcepto.Contiene(5, 6, 14, 16, 17, 19, 206, 22, 23, 25, 26, 18, 60, 183, 184, 185, 186 ,205, 240, 243, 244, 248, 249,15,22,248,249,237))
@@ -337,21 +342,37 @@ public partial class Contabilidad_ContabilizacionCompras : ClsPaginas
e.Row.FCHyperLink("HplC").NavigateUrl = string.Format("/OC/OC.aspx?OC={0}", e.Row.DBCampo("CveOC"));
}
if (cuenta > 0)
if (UsuarioActual.Empresa.TipoContabilidad == 1) // conta SIG
{
DataRow dr = DTmpC.FiltroPrimero(String.Format("Id = {0}", cuenta));
if (cvecuenta == 0)
{
e.Row.Cells[0].ForeColor = System.Drawing.Color.Red;
((GridViewRow)((GridView)e.Row.NamingContainer).BindingContainer).FCCheckBox("Chk").Visible = false;
}
if (dr != null) e.Row.Cells[3].Text = string.Format("{0}<br/>{1}", dr["CuentaFormato"], dr["Nombre"]);
}
else
{
e.Row.Cells[0].ForeColor = System.Drawing.Color.Red;
if (UsuarioActual.Empresa.TipoContabilidad == 2) // conta Contpaq
{
((GridViewRow)((GridView)e.Row.NamingContainer).BindingContainer).FCCheckBox("Chk").Enabled = false;
((GridViewRow)((GridView)e.Row.NamingContainer).BindingContainer).FCCheckBox("Chk").ToolTip = "Hay conceptos sin cuenta asignada";
if (cuenta > 0)
{
DataRow dr = DTmpC.FiltroPrimero(String.Format("Id = {0}", cuenta));
if (dr != null) e.Row.Cells[3].Text = string.Format("{0}<br/>{1}", dr["CuentaFormato"], dr["Nombre"]);
}
else
{
e.Row.Cells[0].ForeColor = System.Drawing.Color.Red;
((GridViewRow)((GridView)e.Row.NamingContainer).BindingContainer).FCCheckBox("Chk").Enabled = false;
((GridViewRow)((GridView)e.Row.NamingContainer).BindingContainer).FCCheckBox("Chk").ToolTip = "Hay conceptos sin cuenta asignada";
}
}
}
if (Convert.ToDecimal(e.Row.DataKey("Cargo").ToString()) == 0) e.Row.Cells[4].Text = "";
if (Convert.ToDecimal(e.Row.DataKey("Abono").ToString()) == 0) e.Row.Cells[5].Text = "";

View File

@@ -111,12 +111,12 @@
<asp:Button ID="BtnContabilizarVentas" runat="server" CssClass="btn btn-success" Text="Contabilizar" />
</div>
<asp:GridView ID="GvV" runat="server" AutoGenerateColumns="False" Width="100%" CssClass="table table-advance table-hover" Style="text-align: center;" ForeColor="Black" DataKeyNames="CvePrePoliza,Fecha" OnRowDataBound="OnRowDataBound" GridLines="None" ShowHeader="false">
<asp:GridView ID="GvV" runat="server" AutoGenerateColumns="False" Width="100%" CssClass="table table-advance table-hover" ForeColor="Black" DataKeyNames="CvePrePoliza,Fecha" OnRowDataBound="OnRowDataBound" GridLines="None" ShowHeader="false">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Panel ID="PnlDetalleVentas" runat="server" CssClass="Texto">
<asp:GridView ID="GvD" runat="server" AutoGenerateColumns="false" CssClass="table detallerow table-hover" Style="float: right; width: 95%;" DataKeyNames="IdCtaContable,Cargo,Abono" GridLines="None" OnRowDataBound="GvD_RowDataBound">
<asp:GridView ID="GvD" runat="server" AutoGenerateColumns="false" CssClass="table detallerow table-hover" Style="float: right; width: 95%;" DataKeyNames="CveCuenta,IdCtaContable,Cargo,Abono" GridLines="None" OnRowDataBound="GvD_RowDataBound">
<Columns>
<asp:BoundField DataField="ConceptoContable" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" HeaderText="Movimiento" />
<asp:TemplateField HeaderText="Concepto" ItemStyle-Font-Size="Smaller">
@@ -125,7 +125,7 @@
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="SubProyecto" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderText="SubProyecto" />
<asp:BoundField DataField="" ItemStyle-Font-Size="Smaller" ItemStyle-Font-Italic="true" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" HeaderText="Cuenta" />
<asp:BoundField DataField="CodigoNombreCuenta" ItemStyle-Font-Size="Smaller" ItemStyle-Font-Italic="true" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" HeaderText="Cuenta" />
<asp:BoundField DataField="Cargo" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" DataFormatString="{0:N2}" HeaderText="Cargos" />
<asp:BoundField DataField="Abono" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" DataFormatString="{0:N2}" HeaderText="Abonos" />
</Columns>
@@ -203,12 +203,12 @@
<asp:Button ID="BtnContabilizarPagos" runat="server" CssClass="btn btn-success" Text="Contabilizar" />
</div>
<asp:GridView ID="GvP" runat="server" AutoGenerateColumns="False" Width="100%" CssClass="table table-advance table-hover" Style="text-align: center;" ForeColor="Black" DataKeyNames="CvePrePoliza,Fecha" OnRowDataBound="OnRowDataBound" GridLines="None" ShowHeader="false">
<asp:GridView ID="GvP" runat="server" AutoGenerateColumns="False" Width="100%" CssClass="table table-advance table-hover" ForeColor="Black" DataKeyNames="CvePrePoliza,Fecha" OnRowDataBound="OnRowDataBound" GridLines="None" ShowHeader="false">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Panel ID="PnlDetallePagos" runat="server">
<asp:GridView ID="GvD" runat="server" AutoGenerateColumns="false" CssClass="table detallerow table-hover" Style="float: right; width: 95%;" DataKeyNames="IdCtaContable, Cargo, Abono" GridLines="None" OnRowDataBound="GvD_RowDataBound">
<asp:GridView ID="GvD" runat="server" AutoGenerateColumns="false" CssClass="table detallerow table-hover" Style="float: right; width: 95%;" DataKeyNames="CveCuenta,IdCtaContable, Cargo, Abono" GridLines="None" OnRowDataBound="GvD_RowDataBound">
<Columns>
<asp:BoundField DataField="ConceptoContable" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" HeaderText="Movimiento" />
<asp:TemplateField HeaderText="Concepto" ItemStyle-Font-Size="Smaller">
@@ -217,7 +217,7 @@
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="SubProyecto" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderText="SubProyecto" />
<asp:BoundField DataField="" ItemStyle-Font-Size="Smaller" ItemStyle-Font-Italic="true" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="150px" HeaderText="Cuenta" />
<asp:BoundField DataField="CodigoNombreCuenta" ItemStyle-Font-Size="Smaller" ItemStyle-Font-Italic="true" ItemStyle-Width="150px" HeaderText="Cuenta" />
<asp:BoundField DataField="Cargo" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" DataFormatString="{0:N2}" HeaderText="Cargos" />
<asp:BoundField DataField="Abono" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" DataFormatString="{0:N2}" HeaderText="Abonos" />
</Columns>
@@ -292,12 +292,12 @@
<asp:Button ID="BtnContabilizarAnticipos" runat="server" CssClass="btn btn-success" Text="Contabilizar" />
</div>
<asp:GridView ID="GvA" runat="server" AutoGenerateColumns="False" Width="100%" CssClass="table table-advance table-hover" Style="text-align: center;" ForeColor="Black" DataKeyNames="CvePrePoliza,Fecha" OnRowDataBound="OnRowDataBound" GridLines="None" ShowHeader="false">
<asp:GridView ID="GvA" runat="server" AutoGenerateColumns="False" Width="100%" CssClass="table table-advance table-hover" ForeColor="Black" DataKeyNames="CvePrePoliza,Fecha" OnRowDataBound="OnRowDataBound" GridLines="None" ShowHeader="false">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Panel ID="PnlDetalleAnticipos" runat="server">
<asp:GridView ID="GvD" runat="server" AutoGenerateColumns="false" CssClass="table detallerow table-hover" Style="float: right; width: 95%;" DataKeyNames="IdCtaContable, Cargo, Abono" GridLines="None" OnRowDataBound="GvD_RowDataBound">
<asp:GridView ID="GvD" runat="server" AutoGenerateColumns="false" CssClass="table detallerow table-hover" Style="float: right; width: 95%;" DataKeyNames="CveCuenta,IdCtaContable, Cargo, Abono" GridLines="None" OnRowDataBound="GvD_RowDataBound">
<Columns>
<asp:BoundField DataField="ConceptoContable" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" HeaderText="Movimiento" />
<asp:TemplateField HeaderText="Concepto" ItemStyle-Font-Size="Smaller">
@@ -306,7 +306,7 @@
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="SubProyecto" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderText="SubProyecto" />
<asp:BoundField DataField="" ItemStyle-Font-Size="Smaller" ItemStyle-Font-Italic="true" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="150px" HeaderText="Cuenta" />
<asp:BoundField DataField="CodigoNombreCuenta" ItemStyle-Font-Size="Smaller" ItemStyle-Font-Italic="true" ItemStyle-Width="150px" HeaderText="Cuenta" />
<asp:BoundField DataField="Cargo" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" DataFormatString="{0:N2}" HeaderText="Cargos" />
<asp:BoundField DataField="Abono" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" DataFormatString="{0:N2}" HeaderText="Abonos" />
</Columns>
@@ -386,7 +386,7 @@
<asp:TemplateField>
<ItemTemplate>
<asp:Panel ID="PnlDetalleAmortizaciones" runat="server">
<asp:GridView ID="GvD" runat="server" AutoGenerateColumns="false" CssClass="table detallerow table-hover" Style=" float: right; width: 95%;" DataKeyNames="IdCtaContable, Cargo, Abono" GridLines="None" OnRowDataBound="GvD_RowDataBound">
<asp:GridView ID="GvD" runat="server" AutoGenerateColumns="false" CssClass="table detallerow table-hover" Style=" float: right; width: 95%;" DataKeyNames="CveCuenta,IdCtaContable, Cargo, Abono" GridLines="None" OnRowDataBound="GvD_RowDataBound">
<Columns>
<asp:BoundField DataField="ConceptoContable" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" HeaderText="Movimiento" />
<asp:TemplateField HeaderText="Concepto" ItemStyle-Font-Size="Smaller">
@@ -395,7 +395,7 @@
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="SubProyecto" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderText="SubProyecto" />
<asp:BoundField DataField="" ItemStyle-Font-Size="Smaller" ItemStyle-Font-Italic="true" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="150px" HeaderText="Cuenta" />
<asp:BoundField DataField="CodigoNombreCuenta" ItemStyle-Font-Size="Smaller" ItemStyle-Font-Italic="true" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="150px" HeaderText="Cuenta" />
<asp:BoundField DataField="Cargo" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" DataFormatString="{0:N2}" HeaderText="Cargos" />
<asp:BoundField DataField="Abono" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" DataFormatString="{0:N2}" HeaderText="Abonos" />
</Columns>

View File

@@ -35,7 +35,7 @@ public partial class Contabilidad_ContabilizacionVentas : ClsPaginas
{
TienePermisoVerPoliza = false;
TienePermisoEditar = false;
if (UsuarioActual.Empresa.UsaContabilidad)
if (UsuarioActual.Empresa.TipoContabilidad == 2 && UsuarioActual.Empresa.UsaContabilidad)
{
TienePermisoEditar = UsuarioActual.TienePermisoProceso(221);
@@ -51,16 +51,16 @@ public partial class Contabilidad_ContabilizacionVentas : ClsPaginas
TienePermisoVerPoliza = true;
}
}
else
{
Alert("Este módulo requiere el uso de Contabilidad.", ModExtensiones.TipoMensaje.MsgAdvertencia);
//BtnConsultar.Enabled = false;
BtnContabilizarVentas.Enabled = false;
BtnContabilizarPagos.Enabled = false;
BtnContabilizarAnticipos.Enabled = false;
BtnContabilizarAmortizaciones.Enabled = false;
ImgExcel2.Visible = false;
}
//else
//{
// Alert("Este módulo requiere el uso de Contabilidad.", ModExtensiones.TipoMensaje.MsgAdvertencia);
// //BtnConsultar.Enabled = false;
// BtnContabilizarVentas.Enabled = false;
// BtnContabilizarPagos.Enabled = false;
// BtnContabilizarAnticipos.Enabled = false;
// BtnContabilizarAmortizaciones.Enabled = false;
// ImgExcel2.Visible = false;
//}
DdlClientes.setEsWebService(true);
DdlClientes.Attributes.Add("data-metodo", "getcliente");
@@ -330,7 +330,8 @@ public partial class Contabilidad_ContabilizacionVentas : ClsPaginas
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
int cuenta = e.Row.DataKey("IdCtaContable").ToString().ToEntero();
int cuenta = e.Row.DataKey("IdCtaContable").ToString().ToEntero();
int cvecuenta = e.Row.DataKey("CveCuenta").ToString().ToEntero();
int CveConcepto = e.Row.DBCampo("CveConceptoContable").ToEntero();
if (CveConcepto.Contiene(5, 6, 14, 19, 17, 206, 25, 26))
@@ -354,19 +355,36 @@ public partial class Contabilidad_ContabilizacionVentas : ClsPaginas
e.Row.FCHyperLink("HplC").NavigateUrl = string.Format("/RH/Personal.aspx?CvePersonal={0}", e.Row.DBCampo("CvePersonal"));
}
if (cuenta > 0)
{
DataRow dr = DTmpC.FiltroPrimero(String.Format("Id = {0}", cuenta));
if (dr != null) e.Row.Cells[3].Text = string.Format("{0}<br/>{1}", dr["CuentaFormato"], dr["Nombre"]);
if (UsuarioActual.Empresa.TipoContabilidad == 1) // conta SIG
{
if (cvecuenta == 0)
{
e.Row.Cells[0].ForeColor = System.Drawing.Color.Red;
((GridViewRow)((GridView)e.Row.NamingContainer).BindingContainer).FCCheckBox("Chk").Visible = false;
}
}
else
{
e.Row.Cells[0].ForeColor = System.Drawing.Color.Red;
if (UsuarioActual.Empresa.TipoContabilidad == 2) // conta Contpaq
{
if (cuenta > 0)
{
DataRow dr = DTmpC.FiltroPrimero(String.Format("Id = {0}", cuenta));
((GridViewRow)((GridView)e.Row.NamingContainer).BindingContainer).FCCheckBox("Chk").Visible = false;
if (dr != null) e.Row.Cells[3].Text = string.Format("{0}<br/>{1}", dr["CuentaFormato"], dr["Nombre"]);
}
else
{
e.Row.Cells[0].ForeColor = System.Drawing.Color.Red;
((GridViewRow)((GridView)e.Row.NamingContainer).BindingContainer).FCCheckBox("Chk").Visible = false;
}
}
}
if (Convert.ToDecimal(e.Row.DataKey("Cargo").ToString()) == 0) e.Row.Cells[4].Text = "";
if (Convert.ToDecimal(e.Row.DataKey("Abono").ToString()) == 0) e.Row.Cells[5].Text = "";

View File

@@ -171,7 +171,7 @@ Partial Class ContabilidadC_RegPrePoliza
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
If UsuarioActual.Empresa.TipoContabilizacion = 1 Then
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
Response.Redirect(Request.Url.PathAndQuery.Replace("RegPrePoliza", "RegPrePolizaS"))
End If

View File

@@ -456,7 +456,7 @@
<asp:TemplateField>
<HeaderTemplate>Cuenta</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="DdlCtaContable" runat="server" Text='<%# Eval("CodigoCuentaContable") %>'></asp:Literal><br />
<asp:Literal ID="DdlCtaContable" runat="server" Text='<%# Eval("CodigoNombreCuenta") %>'></asp:Literal><br />
<%--<asp:HiddenField ID="HdnCtaContable" runat="server" Value='<%# Eval("IdCtaContable") %>' />--%>
<%--<asp:DropDownList ID="DdlCtaContable" runat="server" Width="200px" CssClass="form-control input-sm select2me" DataValueField="Id" DataTextField="CtaCodigo"></asp:DropDownList><br />--%>
</ItemTemplate>

View File

@@ -191,7 +191,7 @@
<div class="catcuentas left">
<asp:Label runat="server" Text="Porcentaje IVA():"></asp:Label></div>
<div class="catcuentas right">
<asp:TextBox ID="TxtPorcentaje" runat="server"></asp:TextBox>
<asp:TextBox ID="TxtPorcentaje" runat="server"></asp:TextBox>(0% - 100% )
</div>
</asp:Panel>
<asp:Panel runat="server" ID="pnlOpcion3" Visible="false" CssClass="form-line">
@@ -205,8 +205,9 @@
</asp:Panel>
<asp:Panel runat="server" ID="pnlOpcion4" Visible="false" CssClass="form-line">
<div class="catcuentas left">
<asp:Label runat="server" Text=" "></asp:Label></div>
<asp:Label runat="server" Text="Cuenta Bancaria "></asp:Label></div>
<div class="catcuentas right">
<asp:DropDownList ID="ddlBancos" Width="100%" CssClass="select2me" DataValueField="CveCuenta" DataTextField="NumCuenta" runat="server"></asp:DropDownList>
</div>
</asp:Panel>
<asp:Panel runat="server" ID="pnlOpcion5" Visible="false" CssClass="form-line">

View File

@@ -83,6 +83,7 @@ Partial Class Contabilidad2_CatCuentas
' If UsuarioActual.Empresa.UsaContabilidad Then
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
DdlAlmacen.DataBind()
DdlAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
CargaMonedas()
CargaAgrupadorSAT()
CargaDatos()
@@ -90,6 +91,15 @@ Partial Class Contabilidad2_CatCuentas
objconta.GetConta_ConceptosContables(1)
DtConceptosconta = objconta.DtResultados
End Using
Using ObjBancos As New ClsBancos
If ObjBancos.GetBancosCuentas(-1) Then
ddlBancos.DataSource = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
ddlBancos.DataBind()
ddlBancos.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
End Using
DdlConcepto.DataSource = DtConceptosconta
DdlConcepto.DataBind()
DdlConcepto.Items.Insert(0, New ListItem("Seleccione", "-1"))
@@ -224,7 +234,7 @@ Partial Class Contabilidad2_CatCuentas
objconta.GetConta_CuentasDataContabilidad(IDSelected, UsuarioActual.CveEmpresa)
If objconta.DtResultados.Rows.Count > 0 Then
Dim rowcc As DataRow = objconta.DtResultados.Rows(0)
DdlConcepto.SelectedValue = -1
DdlConcepto.SelectedValueExist(rowcc("CveConceptoAdmin").ToString().ToEntero())
onconceptochange()
CveProveedor = rowcc("CveProveedor").ToString().ToEntero()
@@ -234,11 +244,14 @@ Partial Class Contabilidad2_CatCuentas
DdlClientesWS.SelectedText = rowcc("Cliente").ToString().ToEntero()
DdlClientesWS.SelectedValue = CveCliente
Dim PorcentajeImpuesto As Decimal = rowcc("PorcentajeImpuesto").ToString().ToDecimal() * 100
DdlClasificacion.SelectedValueExist(PorcentajeImpuesto)
TxtPorcentaje.Text = (PorcentajeImpuesto)
CveClasificacion = rowcc("CveClasificacion").ToString().ToEntero()
DdlClasificacion.SelectedValueExist(CveClasificacion)
CveBancoCuenta = rowcc("CveBancoCuenta").ToString().ToEntero()
ddlBancos.SelectedValue = -1
ddlBancos.SelectedValueExist(CveBancoCuenta)
CveAlmacen = rowcc("CveAlmacen").ToString().ToEntero()
DdlAlmacen.SelectedValue = -1
DdlAlmacen.SelectedValueExist(CveAlmacen)
End If
@@ -286,27 +299,31 @@ Partial Class Contabilidad2_CatCuentas
Dim CveCliente As Integer = DdlClientesWS.SelectedValue.ToEntero()
Dim CveClasificacion As Integer = DdlClasificacion.SelectedValue.ToEntero()
Dim PorcentajeImpuesto As Decimal = TxtPorcentaje.Text.ToDecimal() / 100
Dim CveBancoCuenta As Integer = -1
Dim CveBancoCuenta As Integer = ddlBancos.SelectedValue.ToEntero
Dim CveAlmacen As Integer = DdlAlmacen.SelectedValue.ToEntero()
If ObjConta.UpdateCuenta(IDSelected.ToEntero, Tnombre.Text, DTcuenta.SelectedValue.ToString, DcuentaMayor.SelectedValue.ToString.ToEntero, DdlMoneda.SelectedValue.ToEntero, TxtDigAgrup.Text.ToString.ToEntero, DdlAgrupadorSAT.SelectedValue.ToEntero, TxtNomIngles.Text.ToString,
CveConceptoAdmin:=CveConceptoAdmin, CveProveedor:=CveProveedor, CveCliente:=CveCliente, CveClasificacion:=CveClasificacion, PorcentajeImpuesto:=PorcentajeImpuesto, CveBancoCuenta:=CveBancoCuenta, CveAlmacen:=CveAlmacen) Then
Dim codigo As String = DtDatos.FiltroPrimeroValor("Codigo", $"CveCuenta={IDSelected}")
Using ObjConta2 As New ClsContPAQi(UsuarioActual.Empresa)
If ObjConta2.GetCuentas(-1, "-1", -1) Then
Dim Id As Integer = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"Codigo='{codigo}'").ToEntero
Dim IdAgrupador As Integer
If UsuarioActual.Empresa.TipoContabilidad <> 1 Then
If ObjConta2.GetAgrupadoresSAT() Then
IdAgrupador = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"CodigoNombre='{DdlAgrupadorSAT.SelectedItem.Text}'").ToEntero
End If
If Id > 0 Then
If ObjConta2.UpdateCuenta(Id, Tnombre.Text, DTcuenta.SelectedValue.ToString, DcuentaMayor.SelectedValue.ToString.ToEntero, DdlMoneda.SelectedValue.ToEntero, IdAgrupador, SubCuentaDe:=Tsubcuenta.Text.Trim) > 0 Then
Using ObjConta2 As New ClsContPAQi(UsuarioActual.Empresa)
If ObjConta2.GetCuentas(-1, "-1", -1) Then
Dim Id As Integer = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"Codigo='{codigo}'").ToEntero
Dim IdAgrupador As Integer
If ObjConta2.GetAgrupadoresSAT() Then
IdAgrupador = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"CodigoNombre='{DdlAgrupadorSAT.SelectedItem.Text}'").ToEntero
End If
If Id > 0 Then
If ObjConta2.UpdateCuenta(Id, Tnombre.Text, DTcuenta.SelectedValue.ToString, DcuentaMayor.SelectedValue.ToString.ToEntero, DdlMoneda.SelectedValue.ToEntero, IdAgrupador, SubCuentaDe:=Tsubcuenta.Text.Trim) > 0 Then
End If
End If
End If
End If
End Using
End Using
End If
Dim customerRow As Data.DataRow
customerRow = DtDatos.Select(String.Format("CveCuenta = {0}", IDSelected))(0)

View File

@@ -185,7 +185,7 @@ Partial Class GPS_Trayectos
Try
Dim CveTrayecto As Integer = ObjGPS.AddTrayecto(Nombre, DateTime.Now, "", CveDispositivo, UsuarioActual.CveCliente, EnviarNotificacion:=ChkNotificacion.Checked,
CorreosNotificacion:=TxtCorreoNot.Text, Intervalo:=If(ChkNotificacion.Checked, 0, DdlIntervalo.SelectedValue.ToEntero()),
CorreosNotificacion:=TxtCorreoNot.Text, Intervalo:=If(ChkNotificacion.Checked, DdlIntervalo.SelectedValue.ToEntero(), 0),
EnviarLiga:=ChkEnviarLiga.Checked)
If CveTrayecto > 0 Then

View File

@@ -151,7 +151,7 @@
</div>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAlmacen,IdCtaContable,Inventariable,Modalidad,CveTipoAlmacen,Almacen,Estatus,CveSubProyecto,Orden" EmptyDataText="No se encontraron Almacenes" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-heighterror="300px" data-freezerows="1" GridLines="None">
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAlmacen,IdCtaContable,Inventariable,Modalidad,CveTipoAlmacen,Almacen,Estatus,CveSubProyecto,Orden,CveCuenta" EmptyDataText="No se encontraron Almacenes" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-heighterror="300px" data-freezerows="1" GridLines="None">
<Columns>
<asp:TemplateField ItemStyle-Width="15%" HeaderText="Almacen">
<ItemTemplate>
@@ -233,7 +233,7 @@
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtAlmacen" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVAlmacen" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtAlmacen" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Almacen''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= TxtAlmacen.ClientID.ToString()%>">Almacen:</label>
<asp:Label AssociatedControlID="TxtAlmacen" runat="server" Text="Almacen:"></asp:Label>
</div>
<div class="row">
<div class="col-md-6">
@@ -244,13 +244,13 @@
</div>--%>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataValueField="CveSubProyecto" DataTextField="SubProyecto" ValidationGroup="GrpObligatorio" Width="100%" CssClass="form-control input-sm select2me"></asp:DropDownList>
<label for="<%= DdlSubProyecto.ClientID.ToString()%>">SubProyecto:</label>
<asp:Label AssociatedControlID="DdlSubProyecto" runat="server" Text="SubProyecto:"></asp:Label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoAlmacen" runat="server" AppendDataBoundItems="true" DataValueField="CveTipoAlmacen" DataTextField="TipoAlmacen" ValidationGroup="GrpObligatorio" Width="100%" CssClass="form-control input-sm select2me"></asp:DropDownList>
<label for="<%= DdlTipoAlmacen.ClientID.ToString()%>">Tipo de Almacen:</label>
<asp:Label AssociatedControlID="DdlTipoAlmacen" runat="server" Text="Tipo de Almacen:"></asp:Label>
</div>
</div>
</div>
@@ -261,14 +261,21 @@
<asp:ListItem Text="Contable" Value="1"></asp:ListItem>
<asp:ListItem Selected="True" Text="Solo Existencia" Value="0"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlModalidad.ClientID.ToString()%>">Modalidad:</label>
<asp:Label AssociatedControlID="DdlModalidad" runat="server" Text="Modalidad:"></asp:Label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright" id="divddlcc" visible="false" runat="server">
<asp:DropDownList ID="DdlCuentasContables" runat="server" AppendDataBoundItems="true" DataTextField="CtaCodigo" DataValueField="Id" Width="100%" ValidationGroup="GrpObligatorio" CssClass="form-control input-sm select2me"></asp:DropDownList>
<label for="<%= DdlCuentasContables.ClientID.ToString()%>">Cuenta Contable:</label>
</div>
<asp:Panel CssClass="" ID="divddlcc" Visible="false" runat="server">
<asp:Panel CssClass="form-group form-md-line-input input-iconright" ID="divCuentasCompac" Visible="false" runat="server">
<asp:DropDownList ID="DdlCuentasContables" runat="server" AppendDataBoundItems="true" DataTextField="CtaCodigo" DataValueField="Id" Width="100%" ValidationGroup="GrpObligatorio" CssClass="form-control input-sm select2me"></asp:DropDownList>
<asp:Label AssociatedControlID="DdlCuentasContables" runat="server" Text="Cuenta Contable:"></asp:Label>
</asp:Panel>
<asp:Panel CssClass="form-group form-md-line-input input-iconright" ID="pnlCuentassig" Visible="false" runat="server">
<asp:DropDownList ID="DdlCuentasSig" runat="server" AppendDataBoundItems="true" DataTextField="CtaCodigo" DataValueField="CveCuenta" Width="100%" ValidationGroup="GrpObligatorio" CssClass="form-control input-sm select2me"></asp:DropDownList>
<asp:Label AssociatedControlID="DdlCuentasSig" runat="server" Text="Cuenta Contable:"></asp:Label>
</asp:Panel>
</asp:Panel>
</div>
</div>
<div class="row">
@@ -278,14 +285,14 @@
<asp:ListItem Selected="True" Text="Si" Value="1"></asp:ListItem>
<asp:ListItem Text="No" Value="0"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlInventariable.ClientID.ToString()%>">Inventariable:</label>
<asp:Label AssociatedControlID="DdlInventariable" runat="server" Text="Inventariable:"></asp:Label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright" style="width: 250px!important">
<asp:TextBox ID="TxtOrden" CssClass="form-control " Width="250px" runat="server" MaxLength="10" CausesValidation="true" Style="text-align: right!important" OnKeyup="FormatoMoneda(this);"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtOrden" runat="server" ControlToValidate="TxtOrden" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Orden''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= TxtOrden.ClientID.ToString()%>">Orden:</label>
<asp:Label AssociatedControlID="TxtOrden" runat="server" Text="Orden:"></asp:Label>
<i></i>
</div>
</div>
@@ -293,7 +300,7 @@
<br />
<div class="form-group form-md-line-input input-iconright" id="divEstatus" runat="server">
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="form-control" />
<label for="<%= ChkEstatus.ClientID.ToString()%>">Estatus:</label>
<asp:Label AssociatedControlID="ChkEstatus" runat="server" Text="Estatus:"></asp:Label>
</div>
</ContentTemplate>
</asp:UpdatePanel>

View File

@@ -84,17 +84,33 @@ Partial Class Inventarios_CatAlmacenes
End Sub
Private Sub CargaCuentasContables()
Dim ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa)
'UsuarioActual.Empresa.Funcionalidad(208).ToEntero
If ObjContabilidad.GetCuentasRecursiva(UsuarioActual.Empresa.Funcionalidad(208).ToEntero, 1) Then
DtCuentasContables = ObjContabilidad.DtResultados
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
divCuentasCompac.Visible = False
pnlCuentassig.Visible = True
Using ObjContabilidad As New ClsContabilidad
'UsuarioActual.Empresa.Funcionalidad(208).ToEntero
If ObjContabilidad.CuentasContablesSigGet(UsuarioActual.CveEmpresa) Then
DdlCuentasSig.DataSource = ObjContabilidad.DtResultados
DdlCuentasSig.DataBind()
DdlCuentasSig.Items.Insert(0, New ListItem("Selecione", "-1"))
End If
End Using
Else
DtCuentasContables = Nothing
divCuentasCompac.Visible = True
pnlCuentassig.Visible = False
Using ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa)
'UsuarioActual.Empresa.Funcionalidad(208).ToEntero
If ObjContabilidad.GetCuentasRecursiva(UsuarioActual.Empresa.Funcionalidad(208).ToEntero, 1) Then
DtCuentasContables = ObjContabilidad.DtResultados
Else
DtCuentasContables = Nothing
End If
End Using
DdlCuentasContables.DataSource = DtCuentasContables
DdlCuentasContables.DataBind()
End If
ObjContabilidad.Dispose()
DdlCuentasContables.DataSource = DtCuentasContables
DdlCuentasContables.DataBind()
UpAddAlmacen.Update()
End Sub
@@ -207,12 +223,17 @@ Partial Class Inventarios_CatAlmacenes
Dim TieneError = False
Dim Estatus = 0
If ChkEstatus.Checked Then Estatus = 1
Dim CuentaContable = DdlCuentasContables.SelectedValue.ToEntero
If divddlcc.Visible = False Then
CuentaContable = 0
Dim CuentaContable As Integer = 0
Dim CveCuenta As Integer = 0
If divddlcc.Visible Then
If pnlCuentassig.Visible Then
CveCuenta = DdlCuentasSig.SelectedValue.ToEntero()
Else
CuentaContable = DdlCuentasContables.SelectedValue.ToEntero()
End If
End If
If HdnModalidad.Value = "A" Then
If ObjAlmacen.AddAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, CuentaContable, DdlModalidad.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, TxtOrden.Text.ToEntero) Then
If ObjAlmacen.AddAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, CuentaContable, DdlModalidad.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, TxtOrden.Text.ToEntero, CveCuenta) Then
Alert("El nuevo Almacen se guardó correctamente.", TipoMensaje.MsgInformacion)
UpDatos.Update()
ViewState("DTAlmacenes") = ObjAlmacen.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
@@ -222,7 +243,7 @@ Partial Class Inventarios_CatAlmacenes
Else
TieneError = True
End If
ElseIf ObjAlmacen.UpdateAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, CuentaContable, DdlModalidad.SelectedValue.ToEntero, (CByte(Estatus)), HdnID.Value.ToEntero, CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, TxtOrden.Text.ToEntero) Then
ElseIf ObjAlmacen.UpdateAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, CuentaContable, DdlModalidad.SelectedValue.ToEntero, (CByte(Estatus)), HdnID.Value.ToEntero, CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, TxtOrden.Text.ToEntero, CveCuenta) Then
Alert("El Almacen se actualizo correctamente.", TipoMensaje.MsgInformacion)
UpDatos.Update()
ViewState("DTAlmacenes") = ObjAlmacen.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
@@ -280,6 +301,8 @@ Partial Class Inventarios_CatAlmacenes
DdlModalidad.SelectedValue = If((GvRow.DataKey("Modalidad")) = "Solo Existencia", 0, 1)
divddlcc.Visible = If((DdlModalidad.SelectedValue) = 1, True, False)
DdlCuentasContables.SelectedValueExist(GvRow.DataKey("IdCtaContable"))
DdlCuentasSig.SelectedValueExist(-1)
DdlCuentasSig.SelectedValueExist(GvRow.DataKey("CveCuenta"))
DdlSubProyecto.SelectedValueExist(GvRow.DataKey("CveSubProyecto"))
DdlTipoAlmacen.SelectedValueExist(GvRow.DataKey("CveTipoAlmacen"))
TxtAlmacen.Text = GvRow.DataKey("Almacen")

View File

@@ -256,7 +256,7 @@
</div>
<asp:Button Text="Recarga" Width="75px" ID="BtnConsultarPendientes" OnClick="BtnConsultarPendientes_Click" CssClass="btn btn-primary" runat="server" ValidationGroup="GrpPendientes" />
<asp:Timer runat="server" ID="TimmerRefresh" Interval="100000" OnTick="TimmerRefresh_Tick"></asp:Timer>
<asp:Timer runat="server" ID="TimmerRefresh" Interval="300000" OnTick="TimmerRefresh_Tick"></asp:Timer>
<a href="javascript:;" class="collapse"></a>
</asp:Panel>
</div>

View File

@@ -283,7 +283,7 @@
<asp:Button Text="Recarga" Width="75px" ID="BtnConsultarPendientes" OnClick="BtnConsultarPendientes_Click" CssClass="btn btn-primary" runat="server" ValidationGroup="GrpPendientes" />
<asp:Timer runat="server" ID="TimmerRefresh" Interval="100000" OnTick="TimmerRefresh_Tick"></asp:Timer>
<asp:Timer runat="server" ID="TimmerRefresh" Interval="300000" OnTick="TimmerRefresh_Tick"></asp:Timer>
<a href="javascript:;" class="collapse"></a>
</asp:Panel>

View File

@@ -1877,110 +1877,121 @@ Partial Class Inventarios_RecepcionEntrega
Dim Almacen1 = DdlAlmacen.SelectedValue.ToEntero
If TipoDocto = "Rem" AndAlso CveAlmacenTraspasoDestino = 0 Then
ErrorMovInv = True
TextoError = "Ocurrió un error. no se tiene definido el almacen destino"
End If
'DEVOLUCION REMISION
If TipoMovimiento = 2 And TipoDocto = "Rem" Then
ConceptoMovimiento = 8
Almacen1 = CveAlmacenTraspasoDestino
CveAlmacenTraspasoDestino = DdlAlmacen.SelectedValue.ToEntero
End If
ConceptoMovimiento = 8
Almacen1 = CveAlmacenTraspasoDestino
CveAlmacenTraspasoDestino = DdlAlmacen.SelectedValue.ToEntero
End If
'CANCELACION DE DEVOLUCION
If TipoMovimiento = 2 And TipoDocto = "Dev" And EsDevolucionVenta = 1 Then
ConceptoMovimiento = 3
Almacen1 = DdlAlmacen.SelectedValue.ToEntero
CveAlmacenTraspasoDestino = DdlAlmacen.SelectedValue.ToEntero
End If
'CANCELACION DE DEVOLUCION
If TipoMovimiento = 2 And TipoDocto = "Dev" And EsDevolucionVenta = 1 Then
ConceptoMovimiento = 3
Almacen1 = DdlAlmacen.SelectedValue.ToEntero
CveAlmacenTraspasoDestino = DdlAlmacen.SelectedValue.ToEntero
End If
CveMovimiento = ObjInventario.AddMovimiento(Almacen1, ConceptoMovimiento, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text,
CveMovimiento = ObjInventario.AddMovimiento(Almacen1, ConceptoMovimiento, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text,
CveContrato:=CveContrato, CveAlmacenDestino:=CveAlmacenTraspasoDestino, Modulo:="RE/G7")
Folio = ObjInventario.Folio
Folio = ObjInventario.Folio
'SALIDA DE ALMACEN - SALIDA POR TRASPASO CUANDO ES REMISION - DEVOLUCION (SI ES TRASPASO Y TIENE CONTRATO NO HACE DEVOLUCIóN)
'If Not (CveContrato > 0 And CveAlmacenTraspasoDestino > 0) Then
If CveMovimiento > 0 Then
'SALIDA DE ALMACEN - SALIDA POR TRASPASO CUANDO ES REMISION - DEVOLUCION (SI ES TRASPASO Y TIENE CONTRATO NO HACE DEVOLUCIóN)
'If Not (CveContrato > 0 And CveAlmacenTraspasoDestino > 0) Then
If CveMovimiento > 0 Then
'SACA LO DE TRASPASOS - APARTADO
For Each Dr1 As DataRow In DtTraspasos.Rows
CveMovimientoSalida = Dr1("CveMovimientoEntrada").ToString.ToEntero
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then
'SACA LO DE TRASPASOS - APARTADO
For Each Dr1 As DataRow In DtTraspasos.Rows
CveMovimientoSalida = Dr1("CveMovimientoEntrada").ToString.ToEntero
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
If ObjInventario.DtResultados.Rows.Count = 0 Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar."
Exit For
End If
Next
End If
If ErrorMovInv Then Exit For
Next
'ES EL MOVIMIENTO PRINCIPAL
CantidadPendiente = 0
Dim Cont As Integer = 0
For Each Dr As DataRow In DtDatos.Rows
CantidadPendiente = Dr("CantidadGV").ToString.ToDecimal - Dr("CantidadTraspaso").ToString.ToDecimal
If CantidadPendiente > 0 Then
Dim PU As Decimal = 0
'SI FUE POR SERIELOTE
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
DtDetalleLote = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
If DtDetalle.Rows.Count > 0 Then
For Each Dr1 As DataRow In DtDetalle.Rows
If TipoMovimiento = 2 AndAlso DtExistencias IsNot Nothing Then
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero} AND SerieLote = '{Dr1("SerieLote").ToString}'").ToString.ToDecimal
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, -1, SerieLote:=Dr1("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar."
Exit For
End If
Next
ElseIf DtDetalleLote.Rows.Count > 0 Then
For Each Dr1 As DataRow In DtDetalleLote.Rows
If TipoMovimiento = 2 AndAlso DtExistencias IsNot Nothing Then
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero} AND SerieLote = '{Dr1("SerieLote").ToString}'").ToString.ToDecimal
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr1("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, -1, Lote:=Dr1("Lote").ToString, Batch:=Dr1("Batch").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar."
Exit For
End If
Next
Else
If TipoMovimiento = 2 AndAlso DtExistencias IsNot Nothing Then
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero}").ToString.ToDecimal
TextoError = "Ocurrió un error, no se tienen registros que ingresar"
Exit Sub
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadPendiente, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, -1, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar."
Exit For
End If
End If
If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
For Each Dr2 As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {Cont}").Rows
If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr2("CveSeccionAlmacen").ToString.ToEntero, -Dr2("CantidadSeccionAlmacen").ToString.ToDecimal) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
TextoError = "Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar."
Exit For
End If
Next
End If
Cont += 1
End If
Next
Else
ErrorMovInv = True
If ErrorMovInv Then Exit For
Next
'ES EL MOVIMIENTO PRINCIPAL
CantidadPendiente = 0
Dim Cont As Integer = 0
For Each Dr As DataRow In DtDatos.Rows
CantidadPendiente = Dr("CantidadGV").ToString.ToDecimal - Dr("CantidadTraspaso").ToString.ToDecimal
If CantidadPendiente > 0 Then
Dim PU As Decimal = 0
'SI FUE POR SERIELOTE
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
DtDetalleLote = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
If DtDetalle.Rows.Count > 0 Then
For Each Dr1 As DataRow In DtDetalle.Rows
If TipoMovimiento = 2 AndAlso DtExistencias IsNot Nothing Then
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero} AND SerieLote = '{Dr1("SerieLote").ToString}'").ToString.ToDecimal
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, -1, SerieLote:=Dr1("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar."
Exit For
End If
Next
ElseIf DtDetalleLote.Rows.Count > 0 Then
For Each Dr1 As DataRow In DtDetalleLote.Rows
If TipoMovimiento = 2 AndAlso DtExistencias IsNot Nothing Then
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero} AND SerieLote = '{Dr1("SerieLote").ToString}'").ToString.ToDecimal
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr1("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, -1, Lote:=Dr1("Lote").ToString, Batch:=Dr1("Batch").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar."
Exit For
End If
Next
Else
If TipoMovimiento = 2 AndAlso DtExistencias IsNot Nothing Then
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero}").ToString.ToDecimal
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadPendiente, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, -1, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar."
Exit For
End If
End If
If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
For Each Dr2 As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {Cont}").Rows
If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr2("CveSeccionAlmacen").ToString.ToEntero, -Dr2("CantidadSeccionAlmacen").ToString.ToDecimal) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
Exit For
End If
Next
End If
Cont += 1
End If
Next
Else
ErrorMovInv = True
End If
End If
End If
'End If
'End If
'ENTRADA POR TRASPASO CUANDO ES REMISION
If Not ErrorMovInv Then
'ENTRADA POR TRASPASO CUANDO ES REMISION
If Not ErrorMovInv Then
If CveAlmacenTraspasoDestino > 0 AndAlso Not (TipoMovimiento = 2 And TipoDocto = "Dev" And EsDevolucionVenta = 1) Then ' TRASPASO CUANDO ES REMISION
CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenTraspasoDestino, 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato,
CveMovimientoRelacionado:=CveMovimiento, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero, Modulo:="RE/G8")
@@ -2212,7 +2223,7 @@ Partial Class Inventarios_RecepcionEntrega
End If
' COMIENZA: VIRTUAL
If TipoDocto.Contiene("Ing", "Dev") AndAlso UsuarioActual.Empresa.Funcionalidad(573) = "1" AndAlso CveMovimiento > 0 Then
If Not ErrorMovInv AndAlso TipoDocto.Contiene("Ing", "Dev") AndAlso UsuarioActual.Empresa.Funcionalidad(573) = "1" AndAlso CveMovimiento > 0 Then
Dim DtPSVirtual As New DataTable("DtTamanios")
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimiento, UsuarioActual.CveEmpresa) Then
@@ -2246,46 +2257,46 @@ Partial Class Inventarios_RecepcionEntrega
End If
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 AndAlso CveAlmacenVirtual > 0 AndAlso CveConceptoMovimientoVirtual > 0 Then
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1,
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1,
Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveMovimientoRelacionado:=CveMovimientoRelacionadoVirtual, Modulo:="RE/G6")
FolioVirtual = ObjInventario.Folio
FolioVirtual = ObjInventario.Folio
If CveMovimientoVirtual > 0 Then
For Each RowUsado As DataRow In DtPSVirtual.Rows
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble()
Dim PU As Double = RowUsado("PU").ToString().ToDouble()
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar."
Exit For
End If
Next
Else
ErrorMovInv = True
End If
If CveMovimientoVirtual > 0 Then
For Each RowUsado As DataRow In DtPSVirtual.Rows
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble()
Dim PU As Double = RowUsado("PU").ToString().ToDouble()
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar."
Exit For
End If
Next
Else
If ValidaVirtual Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar el movimiento en almacen virtual. Por favor vuelva a intentar."
End If
ErrorMovInv = True
End If
If DtPSVirtual.Rows.Count = 0 AndAlso ValidaVirtual = True Then
Else
If ValidaVirtual Then
ErrorMovInv = True
TextoError = "No se tienen productos para el almacen virtual."
TextoError = "Ocurrió un error al procesar el movimiento en almacen virtual. Por favor vuelva a intentar."
End If
End If
' TERMINA: VIRTUAL
If DtPSVirtual.Rows.Count = 0 AndAlso ValidaVirtual = True Then
ErrorMovInv = True
TextoError = "No se tienen productos para el almacen virtual."
End If
End If
' TERMINA: VIRTUAL
'AGREGA BITACORA A VENTA
If Not ErrorMovInv Then
'AGREGA BITACORA A VENTA
If Not ErrorMovInv Then
Dim MensajeBitacora = If(TipoMovimiento = 1, "Surtida", "Devuelta")
If Not ObjEventos.AddEventoBitacora(String.Format("Venta {2} en Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovimiento, Folio, MensajeBitacora), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVentaSurtir) Then
ErrorMovInv = True

View File

@@ -1730,11 +1730,12 @@ Partial Class Inventarios_RecepcionUsados
DivClienteSucursal.Visible = False
DdlClientesSucursales.Items.Clear()
Me.EsDistribuidor = CBool(GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("EsDistribuidor", $"CveCliente = {DdlClientes.SelectedValue.ToEntero()}"))
CargaSucursalesCliente()
CargaFacturasCliente()
If DdlClientes.SelectedValue.ToEntero > 0 Then
Me.EsDistribuidor = CBool(GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=DdlClientes.SelectedValue.ToEntero()).FiltroPrimeroValor("EsDistribuidor", ""))
CargaSucursalesCliente()
CargaFacturasCliente()
End If
UpGenerales.Update()
End Sub
Private Sub CargaFacturasCliente()
@@ -2621,7 +2622,7 @@ Partial Class Inventarios_RecepcionUsados
Private Sub CargaFolioAjuste()
DdlFolioGarantia.Items.Clear()
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.FoliosGarantiaGet(-1, UsuarioActual.CveEmpresa) Then
If ObjAcum.FoliosGarantiaGet(-1, UsuarioActual.CveEmpresa, Estatus:=1, Area:=2) Then
DdlFolioGarantia.DataSource = ObjAcum.DtResultados
DdlFolioGarantia.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
@@ -2767,6 +2768,8 @@ Partial Class Inventarios_RecepcionUsados
"", "-1", "-1", "-1", "", "", "", -1, "", "", CveTamaño)
End If
Else
Alert("No se pudo cargar el producto", TipoMensaje.MsgError)
End If
ObjPS.Dispose()
End Sub

View File

@@ -40,7 +40,7 @@ Partial Class Inventarios_RepAlmacen
DdlTipoAlmacen.DataBind()
DdlTipoAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1)
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1, CveEstatus:=-1)
DdlAlmacen.DataBind()
DdlAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))

View File

@@ -129,6 +129,7 @@
<script type="text/javascript" src="/Scripts/Notificaciones.js"></script>
<script>
// aqui debe de llammarse Sr, para desconectar
window.addEventListener("beforeunload", NotificacionesADS.closeopenConexion);
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_initializeRequest(function (s, e) {

View File

@@ -93,26 +93,26 @@ var NotificacionesADS = function () {
closeopenConexion()
}
function loadConection() {
VentanaConConexion = true;
localStorage.setItem("AdsNotificacionesIsConnected", valueok);
if ($.connection) {
let nointentos =0
var proxy = $.connection.notificaciones;
/*$.connection.hub.url = '/signalr';*/
$.connection.hub.disconnected(function () {
setTimeout(function () { nointentos = nointentos + 1; if (nointentos < 4) { $.connection.hub.start().done(function () { nointentos = 0 }); console.log('Reconected'); } }, 120000);
});
// VentanaConConexion = true;
//localStorage.setItem("AdsNotificacionesIsConnected", valueok);
//if ($.connection) {
// let nointentos =0
// var proxy = $.connection.notificaciones;
// /*$.connection.hub.url = '/signalr';*/
// $.connection.hub.disconnected(function () {
// setTimeout(function () { nointentos = nointentos + 1; if (nointentos < 4) { $.connection.hub.start().done(function () { nointentos = 0 }); console.log('Reconected'); } }, 120000);
// });
proxy.client.AlertaVentana = AlertaVentana;
// proxy.client.AlertaVentana = AlertaVentana;
$.connection.hub.start().done(function () {
console.log('Bienvenido');
});
} else {
console.error('Signal Error (no se encontro $.connection)');
// $.connection.hub.start().done(function () {
// console.log('Bienvenido');
// });
//} else {
// console.error('Signal Error (no se encontro $.connection)');
}
window.addEventListener("beforeunload", beforeunloadcloseopenConexion);
//}
//window.addEventListener("beforeunload", beforeunloadcloseopenConexion);
}
function initConnection() {
let isconnected = localStorage.getItem("AdsNotificacionesIsConnected");

View File

@@ -67,7 +67,7 @@
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha Login">
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaSLogin")%>'></asp:Literal>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaSLogin", "{0:dd/MM/yyyy HH:mm}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="IP">
@@ -75,6 +75,16 @@
<asp:Literal ID="LtlRemoteIpAddres" runat="server" Text='<%# Eval("RemoteIpAddres")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Modulo">
<ItemTemplate>
<asp:Literal ID="LtlModulo" runat="server" Text='<%# Eval("Modulo")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Post">
<ItemTemplate>
<asp:Literal ID="LtlPost" runat="server" Text='<%# Eval("LastPostback")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="LnkEnviarMensaje" OnClick="LnkEnviarMensaje_Click" CssClass="btn btn-circle btn-sm blue" runat="server" Text="<i class='fa fa-comments-o'></i>"></asp:LinkButton>

View File

@@ -14,9 +14,46 @@ Partial Class SessionesActivas
ViewState("RCveUsuario") = value
End Set
End Property
ReadOnly Property UsuarioActual() As Usuario
Get
Try
'UsuarioActual = DirectCast(Session("UsuarioSIG"), Usuario)
UsuarioActual = CType(Context.Session("UsuarioSIG"), Usuario)
Catch ex As Exception
Usuario.CerrarSession()
Return Nothing
End Try
End Get
End Property
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
If Not User.Identity.IsAuthenticated OrElse UsuarioActual Is Nothing Then
Dim AuthorizeRequest As Boolean = False
Dim HuboError = False
Dim statusCode = 401
AuthorizeRequest = False
Response.StatusCode = statusCode
If Not AuthorizeRequest Then
Usuario.CerrarSession()
Response.End()
End If
End If
If UsuarioActual.CveRol <> 1 Then
Dim AuthorizeRequest As Boolean = False
Dim HuboError = False
Dim statusCode = 401
AuthorizeRequest = False
Response.StatusCode = statusCode
If Not AuthorizeRequest Then
Usuario.CerrarSession()
Response.End()
End If
End If
' Dim listacve As New List(Of String)
' listacve.Add("1815")
' Notificaciones.AlertaVentana("notificacion", listacve, timeoutseconds:=0)
@@ -33,6 +70,8 @@ Partial Class SessionesActivas
Dim dtU As DataTable = objUsuarios.DtResultados
dtU.Columns.Add("FechaSLogin", System.Type.GetType("System.DateTime"))
dtU.Columns.Add("RemoteIpAddres", System.Type.GetType("System.String"))
dtU.Columns.Add("LastPostback", System.Type.GetType("System.DateTime"))
dtU.Columns.Add("Modulo", System.Type.GetType("System.String"))
Dim dtF As DataTable = dtU.Clone
Dim objlist As List(Of ADSSession.ADSSessionObj) = ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.getListasession)
@@ -41,6 +80,8 @@ Partial Class SessionesActivas
If Not IsNothing(row) Then
row("FechaSLogin") = user.FechaLogin
row("RemoteIpAddres") = user.IpAddres
row("LastPostback") = user.LastPostback
row("Modulo") = user.Modulo
dtF.Rows.Add(row.ItemArray())
End If
Next

View File

@@ -1288,12 +1288,14 @@ Partial Class Sistemas_UsuarioDetalle
Private Sub RecargaGlobales(TieneError As Boolean, ObjSubProyectos As ClsSubProyectos, ObjBancos As ClsBancos, ObjOC As ClsOC, ObjUsuarios As ClsSisUsuarios)
'RECARGA GLOBAL SUBPROYECTOS
If Not TieneError Then
If ObjSubProyectos.GetSubProyectosUsuarios Then
Application("GlobalDTSubProyectosUsuarios") = ObjSubProyectos.DtResultados
Else
Application("GlobalDTSubProyectosUsuarios") = Nothing
TieneError = True
End If
GlobalDTSubProyectosUsuarios(-1, -1, UsuarioActual.CveEmpresa) = Nothing
'If ObjSubProyectos.GetSubProyectosUsuarios Then
' Application("GlobalDTSubProyectosUsuarios") = ObjSubProyectos.DtResultados
'Else
' Application("GlobalDTSubProyectosUsuarios") = Nothing
' TieneError = True
'End If
End If
If Not TieneError Then

View File

@@ -694,7 +694,7 @@
<script type="text/javascript" src="/Scripts/jquery.signalR-2.2.2.min.js"></script>
<script type="text/javascript" src="/signalr/signalr/hubs"></script>
<%: Scripts.Render("~/Metronic/assets/global/scripts/JS") %>
<script type="text/javascript" src="/Scripts/Notificaciones.js"></script>
<script type="text/javascript" src="/Scripts/Notificaciones.js?var1=1"></script>
<script type="text/javascript">
NotificacionesADS.init();

File diff suppressed because it is too large Load Diff

View File

@@ -3017,7 +3017,7 @@
return;
//AUTOMOTRIZ-ACUMULADORES
} else {
let regex = new RegExp("^[1X]|^[0-9][A-HJ-M]([[0-2][0-9]|3[0-1])[0-9A-Z][ACEN][2-5]$");
let regex = new RegExp("^[1X]|^[0-9][A-HJ-M][0-3][0-9][A-Z][ACEN][2-5]$");
arguments.IsValid = regex.test(arguments.Value);
return;
}

View File

@@ -5772,7 +5772,7 @@ Partial Class PV
Private Sub CargaAjuste()
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.FoliosGarantiaGet(-1, UsuarioActual.CveEmpresa, 1) Then
If ObjAcum.FoliosGarantiaGet(-1, UsuarioActual.CveEmpresa, Estatus:=1, Area:=1) Then
DdlFolioGarantia.DataSource = ObjAcum.DtResultados
DdlFolioGarantia.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If

View File

@@ -3355,7 +3355,7 @@
<asp:Button ID="BtnGenerarRemision" runat="server" Text="Generar Remisión" Visible="false" ValidationGroup="GrpEmitirImprimir" CssClass="btn myventasbutton btn-primary" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea generar la remisión?" data-btn-ok-label="si" />
<asp:Button ID="BtnGeneraAutorizacion" runat="server" Text="Generar Autorización" OnClick="BtnGeneraAutorizacion_Click" Visible="false" ValidationGroup="GrpEmitirImprimir" CssClass="btn myventasbutton btn-primary" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea generar la autorización?" data-btn-ok-label="si" />
<%--<asp:Button ID="Button2" runat="server" Text="Button" />--%>
<asp:Button ID="BtnGenerarPoliza" runat="server" Text="GenerarPoliza" Visible="false" CssClass="btn myventasbutton btn-primary" />
<asp:Button ID="BtnGenerarOS" runat="server" Text="Generar OS" Visible="false" CssClass="btn myventasbutton btn-primary" />
@@ -3364,8 +3364,7 @@
<asp:Button ID="BtnEditarRemision" runat="server" Text="Actualizar Remision" CssClass="btn myventasbutton btn-primary" Visible="false" />
<asp:Button ID="BtnPermisoEditarRemision" runat="server" Text="Editar Remision" CssClass="btn myventasbutton btn-primary" Visible="false" />
<asp:Button ID="BtnMandaMail" runat="server" Text="MandaMail" CssClass="btn myventasbutton btn-primary" Visible="false" />
<asp:Button ID="BtnCrearApartirDe" runat="server" Text="Crear a partir de" CssClass="btn myventasbutton btn-primary" Visible="false" />

View File

@@ -2418,18 +2418,21 @@ Partial Class Ventas
LblSubProyecto.Text = ""
divProyectoPyME.Visible = False
LblSubProyectoPyME.InnerText = "Sucursal"
Dim dttSub As New DataTable
dttSub = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
DdlSubProyecto.Items.Clear()
DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
DdlSubProyecto.DataSource = dttSub
'DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("", "", {"CveSubProyecto", "SubProyecto"})
DdlSubProyecto.DataBind()
DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlSubProyectoPyME.Items.Clear()
DdlSubProyectoPyME.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
DdlSubProyectoPyME.DataSource = dttSub
'DdlSubProyectoPyME.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("", "", {"CveSubProyecto", "SubProyecto"})
DdlSubProyectoPyME.DataBind()
DdlSubProyectoPyME.Items.Insert(0, New ListItem("Seleccione", "-1"))
dttSub.Dispose()
ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then
DdlProyecto.Visible = False
@@ -2439,18 +2442,21 @@ Partial Class Ventas
LblSubProyecto.Text = ""
divProyectoPyME.Visible = False
LblSubProyectoPyME.InnerText = "Proyecto"
Dim dttSub As New DataTable
dttSub = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
DdlSubProyecto.Items.Clear()
DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
DdlSubProyecto.DataSource = dttSub
'DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("", "", {"CveSubProyecto", "SubProyecto"})
DdlSubProyecto.DataBind()
DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlSubProyectoPyME.Items.Clear()
DdlSubProyectoPyME.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
DdlSubProyectoPyME.DataSource = dttSub
'DdlSubProyectoPyME.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("", "", {"CveSubProyecto", "SubProyecto"})
DdlSubProyectoPyME.DataBind()
DdlSubProyectoPyME.Items.Insert(0, New ListItem("Seleccione", "-1"))
dttSub.Dispose()
ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 4 Then
LblProyectoHeader.Text = "Sucursal"
@@ -2603,8 +2609,6 @@ Partial Class Ventas
End If
TxtFecha.Enabled = True
CargaPorcentajeMarcas()
BloqueaCondiconesPago()
BloqueaClasificaciones()
@@ -3538,13 +3542,17 @@ Partial Class Ventas
Dim DbRowVenta As DataRow = ObjVentas.DtResultados.Rows(0)
Dim CveCliente As Integer = DbRowVenta("CveCliente").ToString.ToEntero
HdnCveVenta.Value = CveVenta.ToString
Dim ObjUsados As New ClsVentas
Dim DtUsados As DataTable = Nothing
If ObjUsados.GetVentasUsados(CveVenta, DdlSubProyectoDatos.SelectedValue.ToEntero(), DbRowVenta("Fecha").ToString.ToDateTime, UsuarioActual.CveEmpresa) Then
DtUsados = ObjUsados.DtResultados
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
Dim ObjUsados As New ClsVentas
If ObjUsados.GetVentasUsados(CveVenta, DdlSubProyectoDatos.SelectedValue.ToEntero(), DbRowVenta("Fecha").ToString.ToDateTime, UsuarioActual.CveEmpresa) Then
DtUsados = ObjUsados.DtResultados
End If
ObjUsados.Dispose()
End If
ObjUsados.Dispose()
Me.CveEstatusFacturaPadre = DbRowVenta("CveEstatusFacturaPadre").ToString.ToEntero
'CargaEncabezado
@@ -3605,6 +3613,19 @@ Partial Class Ventas
End If
End If
'CargaDetalle
If ObjVentas.GetVentaDetalle(CveVenta) Then
TmpDT = ObjVentas.DtResultados
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
GvPS.DataSource = ObjVentas.DtResultados
GvPS.DataBind()
'IEPS A NIVEL DETALLE
'TxtIEPS.Text = If(TmpDT.SUM("IEPS") > 0, TmpDT.SUM("IEPS").FormatoNumero, TxtIEPS.Text)
End If
If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev") AndAlso LblFolioFiscal.Text.Trim = "" Then HplFolioFiscalModal.Visible = True
Select Case DbRowVenta("TipoDocto").ToString
@@ -3622,7 +3643,7 @@ Partial Class Ventas
If TienePermiso <> "" Then ' si tiene acceso en el subproyecto
'LkNotaCredito.Visible = UsuarioActual.TienePermisoProceso(175)
If UsuarioActual.TienePermisoProceso(264) Then
InicializaAplicaDevolucion()
InicializaAplicaDevolucion(TmpDT)
End If
End If
@@ -3754,11 +3775,11 @@ Partial Class Ventas
End If
'contado 0, credito 1, terminal 2
If ObjVentas.DtResultados(0)("CondicionesPago").ToString.ToEntero = 1 Then
If DbRowVenta("CondicionesPago").ToString.ToEntero = 1 Then
RBLPago.SelectedValue = "1"
RBLPago_SelectedIndexChanged(Nothing, Nothing)
UPCondicionesPago.Update()
ElseIf ObjVentas.DtResultados(0)("CondicionesPago").ToString.ToEntero = 0 Then
ElseIf DbRowVenta("CondicionesPago").ToString.ToEntero = 0 Then
RBLPago.SelectedValue = "2"
RBLPago.Items(0).Enabled = False
RBLPago_SelectedIndexChanged(Nothing, Nothing)
@@ -3771,17 +3792,6 @@ Partial Class Ventas
UPCondicionesPago.Update()
End If
'CargaDetalle
If ObjVentas.GetVentaDetalle(CveVenta) Then
TmpDT = ObjVentas.DtResultados
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
GvPS.DataSource = ObjVentas.DtResultados
GvPS.DataBind()
'IEPS A NIVEL DETALLE
'TxtIEPS.Text = If(TmpDT.SUM("IEPS") > 0, TmpDT.SUM("IEPS").FormatoNumero, TxtIEPS.Text)
End If
'ESCONDE ACCIONES
LnkRemisiones.Visible = False
@@ -5151,6 +5161,10 @@ Partial Class Ventas
CargaRestriccionesCreditoCliente(True, Me.CveVenta)
End If
' si es empresa acumuladores
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
CargaPorcentajeMarcas()
End If
UpFacturar.Update()
UpEstatus.Update()
@@ -5205,186 +5219,182 @@ Partial Class Ventas
End Sub
Private Sub CargaRestriccionesCreditoCliente(Optional Alertas As Boolean = False, Optional CveVenta As Integer = -1)
Dim ObjCliente As New ClsClientes()
If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
If UsuarioActual.Empresa.Funcionalidad(570) = "1" AndAlso ObjCliente.DtResultados.Rows(0)("PermiteCredito").ToString = "False" AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") AndAlso CveVenta < 1 Then
RBLPago.SelectedValue = "2"
RBLPago.Items(0).Enabled = False
RBLPago_SelectedIndexChanged(Nothing, Nothing)
If UsuarioActual.CveEmpresa.Contiene(119) AndAlso Not UsuarioActual.TienePermisoProceso(268) Then
If UsuarioActual.Empresa.Funcionalidad(570) = "1" AndAlso Me.PermiteCredito = False AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") AndAlso CveVenta < 1 Then
RBLPago.SelectedValue = "2"
RBLPago.Items(0).Enabled = False
RBLPago_SelectedIndexChanged(Nothing, Nothing)
If UsuarioActual.CveEmpresa.Contiene(119) AndAlso Not UsuarioActual.TienePermisoProceso(268) Then
DdlTipoComprobante.SelectedValueExistInsert("PA", "Autorización")
DdlTipoComprobante.SelectedValue = "PA"
TxtFechaPago.Text = Now.AddDays(PlazoCobranza).ToShortDateString
'si llegó por la opción de cotización no debe de restringuir
If IfNull(Request("Op"), "").ToString = "Cot" Then DdlTipoComprobante.SelectedValue = "Cot"
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ing"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Rem"))
LnkPedido2SinFacturar.Visible = False
LnkCotizaciones.Visible = False
End If
UPCondicionesPago.Update()
ElseIf UsuarioActual.CveEmpresa.Contiene(72, 119) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot", "PA") AndAlso CveVenta < 1 Then
RBLPago.SelectedValue = "1"
RBLPago_SelectedIndexChanged(Nothing, Nothing)
UPCondicionesPago.Update()
Dim CreditoDispo As Decimal = CargaCreditoDisponible(CveCliente, DdlSucursalCliente.SelectedValue.ToEntero)
If CreditoDispo > 0 Then
TrCreditoDisponible.Visible = True
LblCreditoDisponible.Text = CreditoDispo.FormatoNumero
If PorcentajeCredito > 80 Then TrPorcentajeCredito.Visible = True : LblPorcentajeCredito.Text = $"{PorcentajeCredito.FormatoNumero}%"
If UsuarioActual.CveEmpresa = 119 AndAlso Not UsuarioActual.TienePermisoProceso(268) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "PA") Then
'If LblRFC.Text.Trim <> "XAXX010101000" Then
Dim Vta As New ClsVentas
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón: <br> <br> {0}", Vta.SerieVenta)
Vta.Dispose()
If Opcion > 0 Then
'si la cotización no debe de existir este canddado
If Alertas Then Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
'RBLPago.SelectedValue = "2"
'RBLPago.Items(0).Enabled = False
RBLPago_SelectedIndexChanged(Nothing, Nothing)
UPCondicionesPago.Update()
DdlTipoComprobante.SelectedValueExistInsert("PA", "Autorización")
DdlTipoComprobante.SelectedValue = "PA"
TxtFechaPago.Text = Now.AddDays(PlazoCobranza).ToShortDateString
'si llegó por la opción de cotización no debe de restringuir
If IfNull(Request("Op"), "").ToString = "Cot" Then DdlTipoComprobante.SelectedValue = "Cot"
'quito remisión y factura
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ing"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Rem"))
LnkPedido2SinFacturar.Visible = False
LnkCotizaciones.Visible = False
End If
UPCondicionesPago.Update()
ElseIf UsuarioActual.CveEmpresa.Contiene(72, 119) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot", "PA") AndAlso CveVenta < 1 Then
RBLPago.SelectedValue = "1"
RBLPago_SelectedIndexChanged(Nothing, Nothing)
UPCondicionesPago.Update()
Dim CreditoDispo As Decimal = CargaCreditoDisponible(CveCliente, DdlSucursalCliente.SelectedValue.ToEntero)
If CreditoDispo > 0 Then
TrCreditoDisponible.Visible = True
LblCreditoDisponible.Text = CreditoDispo.FormatoNumero
If PorcentajeCredito > 80 Then TrPorcentajeCredito.Visible = True : LblPorcentajeCredito.Text = $"{PorcentajeCredito.FormatoNumero}%"
If UsuarioActual.CveEmpresa = 119 AndAlso Not UsuarioActual.TienePermisoProceso(268) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "PA") Then
'If LblRFC.Text.Trim <> "XAXX010101000" Then
Dim Vta As New ClsVentas
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón: <br> <br> {0}", Vta.SerieVenta)
Vta.Dispose()
If Opcion > 0 Then
'si la cotización no debe de existir este canddado
If Alertas Then Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
'RBLPago.SelectedValue = "2"
'RBLPago.Items(0).Enabled = False
RBLPago_SelectedIndexChanged(Nothing, Nothing)
UPCondicionesPago.Update()
DdlTipoComprobante.SelectedValueExistInsert("PA", "Autorización")
DdlTipoComprobante.SelectedValue = "PA"
TxtFechaPago.Text = Now.AddDays(PlazoCobranza).ToShortDateString
'si llegó por la opción de cotización no debe de restringuir
If IfNull(Request("Op"), "").ToString = "Cot" Then DdlTipoComprobante.SelectedValue = "Cot"
'quito remisión y factura
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ing"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Rem"))
If Opcion = 1 Then
BtnEmitirImprimir.Visible = False
BtnsFacturar.Visible = False
BtnGenerarRemision.Visible = False
LnkPedido2SinFacturar.Visible = False
LnkCotizaciones.Visible = False
LnkOCs.Visible = False
End If
Else
' el cliente tiene crédito disponible, no tiene bloqueo
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("PA"))
If UsuarioActual.TienePermisoProceso(60) Then DdlTipoComprobante.SelectedValueExistInsert("Ing", "Ingresos") 'puede facturar
If UsuarioActual.TienePermisoProceso(199) Then DdlTipoComprobante.SelectedValueExistInsert("Rem", "Remisión") ' puede remisionar
DdlTipoComprobante.SelectedValueExist(UsuarioActual.CveTipoDocumento)
TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza)).ToShortDateString
End If
'Else
' 'que no de crédito, solo contado
' RBLPago.SelectedValue = "2"
' RBLPago.Items(0).Enabled = False
'End If
End If
Else
If UsuarioActual.CveEmpresa = 119 AndAlso Not UsuarioActual.TienePermisoProceso(268) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "Ant", "PA") Then
Dim Vta As New ClsVentas
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón: <br> <br> {0}", Vta.SerieVenta)
Vta.Dispose()
If Opcion > 0 Then
If Opcion = 1 Then
BtnEmitirImprimir.Visible = False
End If
If Alertas Then Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
Else
If Alertas Then Alert("El cliente tiene su límite de crédito agotado.", TipoMensaje.MsgAdvertencia)
End If
'RBLPago.SelectedValue = "2"
'RBLPago.Items(0).Enabled = False
RBLPago_SelectedIndexChanged(Nothing, Nothing)
UPCondicionesPago.Update()
DdlTipoComprobante.SelectedValueExistInsert("PA", "Autorización")
DdlTipoComprobante.SelectedValue = "PA"
TxtFechaPago.Text = Now.AddDays(PlazoCobranza).ToShortDateString
'si llegó por la opción de cotización no debe de restringuir
If IfNull(Request("Op"), "").ToString = "Cot" Then DdlTipoComprobante.SelectedValue = "Cot"
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ing"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Rem"))
If Opcion = 1 Then
BtnEmitirImprimir.Visible = False
BtnsFacturar.Visible = False
BtnGenerarRemision.Visible = False
LnkPedido2SinFacturar.Visible = False
LnkCotizaciones.Visible = False
LnkOCs.Visible = False
End If
End If
UPPCreditoDisponible.Update()
ElseIf UsuarioActual.CveEmpresa.Contiene(119, 1) AndAlso Not UsuarioActual.TienePermisoProceso(268) AndAlso CveVenta > 0 AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Pd2", "Cot") Or (DdlTipoComprobante.SelectedValue = "Rem" And ModalidadEdicion And ViewState("CveClienteAnterior").ToString.ToEntero > 0 And LblRFC.Text.Trim <> "XAXX010101000")) Then
Dim CreditoDispo As Decimal = CargaCreditoDisponible(CveCliente, DdlSucursalCliente.SelectedValue.ToEntero)
If CreditoDispo > 0 Then
Dim Vta As New ClsVentas
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón: <br> <br> {0}", Vta.SerieVenta)
Vta.Dispose()
If Opcion > 0 Then
If ModalidadEdicion AndAlso ViewState("CveCliente").ToString.ToEntero <> ViewState("CveClienteAnterior").ToString.ToEntero And DdlTipoComprobante.SelectedValue = "Rem" And ViewState("CveClienteAnterior").ToString.ToEntero > 0 And LblRFC.Text.Trim <> "XAXX010101000" Then
ViewState("CveCliente") = ViewState("CveClienteAnterior").ToString.ToEntero
ObjCliente.Dispose()
CargaCliente(ViewState("CveCliente").ToString.ToEntero)
If Opcion > 0 Then
If Alertas Then Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
Else
If Alertas Then Alert("El cliente tiene su límite de crédito agotado.", TipoMensaje.MsgAdvertencia)
End If
BtnEmitirImprimir.Visible = False
BtnVistaPrevia.Visible = False
UpFacturar.Update()
Exit Sub
ElseIf DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso EsCreaApartirDe Then
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ing"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Rem"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Pd2"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Egs"))
BtnGenerarRemision.Visible = False
BtnGenerarOS.Visible = False
BtnEmitirImprimir.Visible = True
BtnsFacturar.Visible = False
Else
If DdlTipoComprobante.SelectedValue.Contiene("Pd2") Then
BtnGeneraAutorizacion.Visible = If(CveEstatus <> 21, True, False)
End If
BtnGenerarRemision.Visible = False
BtnGenerarOS.Visible = False
BtnEmitirImprimir.Visible = False
BtnsFacturar.Visible = False
If ViewState("CveCliente").ToString.ToEntero <> ViewState("CveClienteAnterior").ToString.ToEntero Then
If Opcion > 0 Then
If Alertas Then Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
Else
If Alertas Then Alert("El cliente tiene límite de crédito agotado.", TipoMensaje.MsgAdvertencia)
End If
End If
End If
Else
BtnGeneraAutorizacion.Visible = False
If DdlTipoComprobante.SelectedValue.Contiene("Pd2") Then
BtnGenerarRemision.Visible = If(CveEstatus <> 21, True, False)
End If
End If
Else
' el cliente tiene crédito disponible, no tiene bloqueo
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("PA"))
If UsuarioActual.TienePermisoProceso(60) Then DdlTipoComprobante.SelectedValueExistInsert("Ing", "Ingresos") 'puede facturar
If UsuarioActual.TienePermisoProceso(199) Then DdlTipoComprobante.SelectedValueExistInsert("Rem", "Remisión") ' puede remisionar
DdlTipoComprobante.SelectedValueExist(UsuarioActual.CveTipoDocumento)
TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza)).ToShortDateString
End If
'Else
' 'que no de crédito, solo contado
' RBLPago.SelectedValue = "2"
' RBLPago.Items(0).Enabled = False
'End If
End If
Else
If UsuarioActual.CveEmpresa = 119 AndAlso Not UsuarioActual.TienePermisoProceso(268) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "Ant", "PA") Then
Dim Vta As New ClsVentas
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón: <br> <br> {0}", Vta.SerieVenta)
Vta.Dispose()
If Opcion > 0 Then
If Opcion = 1 Then
BtnEmitirImprimir.Visible = False
End If
If Alertas Then Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
Else
If Alertas Then Alert("El cliente tiene su límite de crédito agotado.", TipoMensaje.MsgAdvertencia)
End If
'RBLPago.SelectedValue = "2"
'RBLPago.Items(0).Enabled = False
RBLPago_SelectedIndexChanged(Nothing, Nothing)
UPCondicionesPago.Update()
DdlTipoComprobante.SelectedValueExistInsert("PA", "Autorización")
DdlTipoComprobante.SelectedValue = "PA"
TxtFechaPago.Text = Now.AddDays(PlazoCobranza).ToShortDateString
'si llegó por la opción de cotización no debe de restringuir
If IfNull(Request("Op"), "").ToString = "Cot" Then DdlTipoComprobante.SelectedValue = "Cot"
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ing"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Rem"))
BtnsFacturar.Visible = False
BtnGenerarRemision.Visible = False
LnkPedido2SinFacturar.Visible = False
LnkCotizaciones.Visible = False
LnkOCs.Visible = False
End If
End If
UPPCreditoDisponible.Update()
ElseIf UsuarioActual.CveEmpresa.Contiene(119, 1) AndAlso Not UsuarioActual.TienePermisoProceso(268) AndAlso CveVenta > 0 AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Pd2", "Cot") Or (DdlTipoComprobante.SelectedValue = "Rem" And ModalidadEdicion And ViewState("CveClienteAnterior").ToString.ToEntero > 0 And LblRFC.Text.Trim <> "XAXX010101000")) Then
Dim CreditoDispo As Decimal = CargaCreditoDisponible(CveCliente, DdlSucursalCliente.SelectedValue.ToEntero)
If CreditoDispo > 0 Then
Dim Vta As New ClsVentas
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón: <br> <br> {0}", Vta.SerieVenta)
Vta.Dispose()
If Opcion > 0 Then
If ModalidadEdicion AndAlso ViewState("CveCliente").ToString.ToEntero <> ViewState("CveClienteAnterior").ToString.ToEntero And DdlTipoComprobante.SelectedValue = "Rem" And ViewState("CveClienteAnterior").ToString.ToEntero > 0 And LblRFC.Text.Trim <> "XAXX010101000" Then
ViewState("CveCliente") = ViewState("CveClienteAnterior").ToString.ToEntero
CargaCliente(ViewState("CveCliente").ToString.ToEntero)
If Opcion > 0 Then
If Alertas Then Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
Else
If Alertas Then Alert("El cliente tiene su límite de crédito agotado.", TipoMensaje.MsgAdvertencia)
End If
BtnEmitirImprimir.Visible = False
BtnVistaPrevia.Visible = False
UpFacturar.Update()
Exit Sub
ElseIf DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso EsCreaApartirDe Then
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ing"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Rem"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Pd2"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Egs"))
BtnGenerarRemision.Visible = False
BtnGenerarOS.Visible = False
BtnEmitirImprimir.Visible = True
BtnsFacturar.Visible = False
Else
If DdlTipoComprobante.SelectedValue.Contiene("Pd2") Then
BtnGeneraAutorizacion.Visible = If(CveEstatus <> 21, True, False)
End If
BtnGenerarRemision.Visible = False
BtnGenerarOS.Visible = False
BtnEmitirImprimir.Visible = False
BtnsFacturar.Visible = False
If ViewState("CveCliente").ToString.ToEntero <> ViewState("CveClienteAnterior").ToString.ToEntero Then
If Opcion > 0 Then
If Alertas Then Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
Else
If Alertas Then Alert("El cliente tiene límite de crédito agotado.", TipoMensaje.MsgAdvertencia)
End If
End If
End If
Else
BtnGeneraAutorizacion.Visible = False
If DdlTipoComprobante.SelectedValue.Contiene("Pd2") Then
BtnGenerarRemision.Visible = If(CveEstatus <> 21, True, False)
End If
End If
Else
BtnGenerarRemision.Visible = False
If DdlTipoComprobante.SelectedValue.Contiene("Pd2") Then
BtnGeneraAutorizacion.Visible = If(CveEstatus <> 21, True, False)
End If
End If
End If
ObjCliente.Dispose()
End Sub
@@ -5516,14 +5526,17 @@ Partial Class Ventas
Return Retorno
End Function
Private Sub CargaDdlSubProyectos()
DdlSubProyectoDatos.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1).FiltraParametros("EsSucursal = True ")
Dim dtt As New DataTable
dtt = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
DdlSubProyectoDatos.DataSource = dtt.FiltraParametros("EsSucursal = True ")
DdlSubProyectoDatos.DataBind()
DdlSubProyectoCobranza.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1).FiltraParametros("EsSucursal = True ")
DdlSubProyectoCobranza.DataSource = dtt.FiltraParametros("EsSucursal = True ")
DdlSubProyectoCobranza.DataBind()
DdlSubProyectoEjecucion.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1).FiltraParametros("EsSucursal = True ")
DdlSubProyectoEjecucion.DataSource = dtt.FiltraParametros("EsSucursal = True ")
DdlSubProyectoEjecucion.DataBind()
DdlSubProyectoPyME.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
DdlSubProyectoPyME.DataSource = dtt
DdlSubProyectoPyME.DataBind()
dtt.Dispose()
End Sub
Private Sub CargaClasificaciones()
If UsuarioActual.Empresa.UsaAC Then
@@ -5618,13 +5631,16 @@ Partial Class Ventas
Public Sub CargaDdlNCPS()
Dim CveSATNC = "84111506"
DdlNCPS.DataSource = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1) ', SATClavePS:=CveSATNC
Dim dtt As New DataTable
dtt = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1) ', SATClavePS:=CveSATNC
DdlNCPS.DataSource = dtt
DdlNCPS.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlNCPS.DataBind()
DdlNCPSAnt.DataSource = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1) ', SATClavePS:=CveSATNC
DdlNCPSAnt.DataSource = dtt
DdlNCPSAnt.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlNCPSAnt.DataBind()
dtt.Dispose()
End Sub
#End Region
@@ -13739,7 +13755,9 @@ Partial Class Ventas
End Sub
Protected Sub DdlSucursalCliente_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSucursalCliente.SelectedIndexChanged
CargaClienteSucursal(DdlSucursalCliente.SelectedValue.ToEntero)
CargaRestriccionesCreditoCliente(Alertas:=True)
'If Me.CveVenta > 0 Then
' CargaRestriccionesCreditoCliente(Alertas:=True)
'End If
End Sub
Protected Sub DdlCCEdit_SelectedIndexChanged(sender As Object, e As System.EventArgs)
Dim gvr As GridViewRow = DirectCast(DirectCast(sender, DropDownList).BindingContainer, GridViewRow)
@@ -15780,7 +15798,7 @@ Partial Class Ventas
If ConSalida AndAlso Not OcurrioError Then
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
OcurrioError = Not GenerarMovimientoAlmacenVirtual(CveRemision, ObjInventario, ObjFactura)
OcurrioError = Not GenerarMovimientoAlmacenVirtual(CveRemision, ObjInventario, ObjFactura, ObjConta:=ObjConta)
End If
If Not OcurrioError Then
@@ -16136,7 +16154,7 @@ Partial Class Ventas
Return Not OcurrioError
End Function
Private Function GenerarMovimientoAlmacenVirtual(CveRemision As Integer, ByRef ObjInventario As ClsInventarios, ObjFactura As Modelos.Factura) As Boolean
Private Function GenerarMovimientoAlmacenVirtual(CveRemision As Integer, ByRef ObjInventario As ClsInventarios, ObjFactura As Modelos.Factura, Optional ByRef ObjConta As ClsContabilidad = Nothing) As Boolean
Dim OcurrioError As Boolean = False
Try
@@ -16190,6 +16208,57 @@ Partial Class Ventas
OcurrioError = True
End If
'Agregamos las PrePolizas
If Not OcurrioError Then
If CveMovimientoVirtual > 0 Then
'OcurrioError = Not GeneraPrePolizaMovimientoAlmacen(ObjInventario, ObjConta, ObjContPaq, ObjFactura, ObjFactura.CvePrePoliza, CveMovimientoInventario, CveAlmacen)
If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtual, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
Dim DtCostos = ObjInventario.DtResultados.Copy
Dim DtCostosDistinct As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"})
Dim IdCtaContable As Integer = 0
Dim CveCuenta As Integer = 0
Dim ValorInventario As Decimal
Dim TotalCostoAcumulado As Decimal = 0D
Dim Cont As Integer = 1
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL
For Each RowInv As DataRow In DtCostosDistinct.Rows
ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundSQL
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
TotalCostoAcumulado += ValorInventario
'cuando es el último movimiento y hay diferencias en los importes
If Cont = DtCostosDistinct.Rows.Count AndAlso TotalCosto <> TotalCostoAcumulado Then
ValorInventario = ValorInventario + (TotalCosto - TotalCostoAcumulado)
End If
Try
'If ValorInventario <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ValorInventario, ObjFactura.SerieFolio, 69, ObjFactura.SerieFolio, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoVirtual, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta, CveSubProyecto:=ObjFactura.CveSubProyecto) Then
OcurrioError = True
Exit For
End If
'End If
Catch ex As Exception
OcurrioError = True
Alert("Error inesperado (15148). Por favor comuniquese con atención SIG.", TipoMensaje.ToastError)
End Try
Cont += 1
Next
If Not OcurrioError Then
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacenVirtual)).ToEntero
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, TotalCosto, ObjFactura.SerieFolio, 68, ObjFactura.SerieFolio, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveMovimientoAlmacen:=CveMovimientoVirtual, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=ObjFactura.CveSubProyecto) Then
OcurrioError = True
End If
End If
Else
OcurrioError = True
End If
End If
End If
End If
Catch ex As Exception
@@ -22034,7 +22103,7 @@ Partial Class Ventas
#End Region
#Region " APLICA DEVOLUCION "
Private Sub InicializaAplicaDevolucion()
Private Sub InicializaAplicaDevolucion(DtDetalle As DataTable)
'If Not UsuarioActual.CveUsuario = 100 Then
' If Not UsuarioActual.CveEmpresa.Contiene(72, 80, 119, 140, 141, 146) Then
' Exit Sub
@@ -22048,13 +22117,13 @@ Partial Class Ventas
LBAplicaDevolucion.Visible = True
Dim SeEsconde As Boolean = False
Dim ObjVenta As New ClsVentas
If ObjVenta.GetVentaDetalle(CveVenta) Then
If Not ObjVenta.DtResultados.SUM("CantSur").ToString.ToDecimal > 0 Then SeEsconde = True
If DtDetalle IsNot Nothing AndAlso DtDetalle.Rows.Count > 0 Then
If Not DtDetalle.SUM("CantSur").ToString.ToDecimal > 0 Then SeEsconde = True
'NO MOSTRAR LOS PRODUCTOS CON LA CLASIFICACION DE USADOS
GvAplicaDevolucion.DataSource = ObjVenta.DtResultados.FiltraParametros("CantRes > 0 AND CveClasificacion <> 20519")
GvAplicaDevolucion.DataSource = DtDetalle.FiltraParametros("CantRes > 0 AND CveClasificacion <> 20519")
End If
ObjVenta.Dispose()
'activo el permiso para registrar el importe diferente a la devolución
GvAplicaDevolucion.Columns(9).Visible = UsuarioActual.TienePermisoProceso(253)
@@ -24100,9 +24169,11 @@ Partial Class Ventas
PlazoCobranzaRemision = ObjCliente.PlazoCobranzaRemision
'TxtNumCtaPago.Text = ObjCliente.NumCtaPago
TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza)).ToShortDateString
DdlTipoRetencion.SelectedValueExist(ObjCliente.DtResultados(0)("CveTipoRetencion").ToString)
End If
End If
ObjCliente.Dispose()
DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty)
TrVistaPrevia.Visible = True
TxtFechaVencimientoCotizacion.Text = Now.ToShortDateString
@@ -24863,7 +24934,7 @@ Partial Class Ventas
Protected Sub DdlTipoRetencion_SelectedIndexChanged(sender As Object, e As EventArgs)
If CveVenta <= 0 Then
If CveVenta <= 0 OrElse EsCreaApartirDe Then
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 Then
For Each RowServicio As DataRow In TmpDT.Rows
@@ -24984,4 +25055,25 @@ Partial Class Ventas
Protected Sub LnkGenerarOC_Click(sender As Object, e As EventArgs)
Response.Redirect($"~/OC/OC.aspx?CveCotizacion={Me.CveVenta}&Tipo=OC")
End Sub
'Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
' Dim ObjVentas As New ClsVentas
' ObjVentas.IniciaTransacSQL()
' Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
' Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
' Dim ObjCGame As New ClsCGame(ObjVentas.IniciaTransacSQL())
' Dim ObjAC As ClsContPAQi = Nothing
' If Not RegeneracionPolizas(ObjVentas, ObjAC, ObjConta, ObjBancos) Then
' ObjVentas.Commit()
' If ObjAC IsNot Nothing Then ObjAC.Commit()
' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion, JSBtnAceptar:="BtnRefrescarPagina();")
' End If
' ObjVentas.Dispose()
' ObjConta.Dispose()
' ObjBancos.Dispose()
' If ObjAC IsNot Nothing Then ObjAC.Dispose()
'End Sub
End Class

View File

@@ -17,6 +17,14 @@