Merge branch 'master' of http://jperez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -10,6 +10,7 @@ Imports System.Threading.Tasks
|
|||||||
Imports Newtonsoft.Json
|
Imports Newtonsoft.Json
|
||||||
Imports Extensiones
|
Imports Extensiones
|
||||||
Imports MoreLinq
|
Imports MoreLinq
|
||||||
|
Imports ClbNegBICFDv3_3
|
||||||
|
|
||||||
Partial Class Compras_Compras
|
Partial Class Compras_Compras
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
@@ -1341,7 +1342,7 @@ Partial Class Compras_Compras
|
|||||||
CambiaEjercicioAC()
|
CambiaEjercicioAC()
|
||||||
End If
|
End If
|
||||||
UpConsignaciones.Update()
|
UpConsignaciones.Update()
|
||||||
UpINV.Update()
|
UpInv.Update()
|
||||||
'DdlIVA.Visible = True ' cuando es compra manual
|
'DdlIVA.Visible = True ' cuando es compra manual
|
||||||
'If UsuarioActual.CveEmpresa = 126 Then
|
'If UsuarioActual.CveEmpresa = 126 Then
|
||||||
' CargaOrdenCorte()
|
' CargaOrdenCorte()
|
||||||
@@ -1735,6 +1736,50 @@ Partial Class Compras_Compras
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Dim SbValRet As New StringBuilder
|
||||||
|
For Each concepto As XmlNode In nodeconceptos
|
||||||
|
' Obtener la descripción del concepto
|
||||||
|
Dim descripcion As String = ValorXML(concepto, "Descripcion")
|
||||||
|
Dim importeValue As Decimal = Decimal.Parse(ValorXML(concepto, "Importe"))
|
||||||
|
|
||||||
|
' Seleccionar el nodo de Impuestos dentro de Concepto, si existe
|
||||||
|
Dim impuestosNode As XmlNode = concepto.SelectSingleNode("cfdi:Impuestos", namespaces)
|
||||||
|
|
||||||
|
If Not impuestosNode Is Nothing Then
|
||||||
|
' Seleccionar los nodos de Retencion dentro de Impuestos
|
||||||
|
Dim retenciones As XmlNodeList = impuestosNode.SelectNodes("cfdi:Retenciones/cfdi:Retencion", namespaces)
|
||||||
|
For Each retencion As XmlNode In retenciones
|
||||||
|
' Obtener los valores de los atributos Base e Importe
|
||||||
|
Dim baseValue As Decimal = Decimal.Parse(ValorXML(retencion, "Base"))
|
||||||
|
Dim impuesto As String = ValorXML(retencion, "Impuesto")
|
||||||
|
|
||||||
|
If impuesto = "001" Then
|
||||||
|
impuesto = "Retención ISR"
|
||||||
|
ElseIf impuesto = "002" Then
|
||||||
|
impuesto = "Retención IVA"
|
||||||
|
ElseIf impuesto = "003" Then
|
||||||
|
impuesto = "IEPS"
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
' Validar si Base coincide con Importe
|
||||||
|
If baseValue <> importeValue Then
|
||||||
|
'SbValRet.Append($"La base e importe de la retención del impuesto {impuesto} no coinciden para {descripcion}. Base: {baseValue.ToString()}, Importe: {importeValue.ToString()} <br>")
|
||||||
|
SbValRet.Append($"Producto: {descripcion} La base e importe del impuesto {impuesto} no coincide Base: {baseValue.ToString()}, Importe Producto: {importeValue.ToString()} <br>")
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
If SbValRet.ToString.Trim.Length > 0 Then
|
||||||
|
Alert(SbValRet.ToString, TipoMensaje.MsgAdvertencia)
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
CargaConceptosXML(XMLDoc)
|
CargaConceptosXML(XMLDoc)
|
||||||
End If
|
End If
|
||||||
@@ -5107,11 +5152,7 @@ Partial Class Compras_Compras
|
|||||||
' Next
|
' Next
|
||||||
'End If
|
'End If
|
||||||
|
|
||||||
If DdlTipoCompra.SelectedValue = "14" Then 'recolección
|
|
||||||
If Not ObjGrales.UpdateInvEntregaAlmacenEstatus(DdlRecoleccion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 2, CveCompra) Then
|
|
||||||
ErrorDetalles = True
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
'AGREGA AF COMPRA - Cuando es Compra se guarda CveCompraDetalle en AF
|
'AGREGA AF COMPRA - Cuando es Compra se guarda CveCompraDetalle en AF
|
||||||
If Row("TipoAF").ToString.ToEntero = 2 Then
|
If Row("TipoAF").ToString.ToEntero = 2 Then
|
||||||
@@ -5136,6 +5177,12 @@ Partial Class Compras_Compras
|
|||||||
Next
|
Next
|
||||||
''TERMINA: INSERTA DETALLES DE LA COMPRA
|
''TERMINA: INSERTA DETALLES DE LA COMPRA
|
||||||
|
|
||||||
|
If DdlTipoCompra.SelectedValue = "14" Then 'recolección
|
||||||
|
If Not ObjGrales.UpdateInvEntregaAlmacenEstatus(DdlRecoleccion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 2, CveCompra) Then
|
||||||
|
ErrorDetalles = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
'QUEMA SALDOS DE INV-COMPRA | MERCANCIA RECIBIDA POR ADELANTADO (OC) | PP 176
|
'QUEMA SALDOS DE INV-COMPRA | MERCANCIA RECIBIDA POR ADELANTADO (OC) | PP 176
|
||||||
If OCVinculada And Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
|
If OCVinculada And Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
|
||||||
For Each Row As DataRow In TmpDT.FiltraParametros("CveTipoPS = 2").Rows
|
For Each Row As DataRow In TmpDT.FiltraParametros("CveTipoPS = 2").Rows
|
||||||
@@ -19742,6 +19789,10 @@ Partial Class Compras_Compras
|
|||||||
Dim cantidad As Decimal = dr("CantidadDisponible").ToString.ToDecimal
|
Dim cantidad As Decimal = dr("CantidadDisponible").ToString.ToDecimal
|
||||||
AddPS(cantidad, dr("CveUM").ToString.ToEntero, "", dr("CveClasificacion").ToString.ToEntero, "", dr("CvePS").ToString.ToEntero, dr("PS").ToString, 2, tCveSub.ToString, "SE", "SE", "", "", pu, Total, Porcentaje, 0, 0, 0, 0, 0, PorcentajeIVA:=Porcentaje, TCalculaTotales:=True, CveTipoGasto:=tCveTipoGasto)
|
AddPS(cantidad, dr("CveUM").ToString.ToEntero, "", dr("CveClasificacion").ToString.ToEntero, "", dr("CvePS").ToString.ToEntero, dr("PS").ToString, 2, tCveSub.ToString, "SE", "SE", "", "", pu, Total, Porcentaje, 0, 0, 0, 0, 0, PorcentajeIVA:=Porcentaje, TCalculaTotales:=True, CveTipoGasto:=tCveTipoGasto)
|
||||||
Next
|
Next
|
||||||
|
'cambia si hay ps con uso de serie
|
||||||
|
For Each dr As DataRow In TmpDT.Rows
|
||||||
|
dr("CveMetodoInventario") = 1
|
||||||
|
Next
|
||||||
AddPS2()
|
AddPS2()
|
||||||
|
|
||||||
End If
|
End If
|
||||||
@@ -20085,6 +20136,10 @@ Partial Class Compras_Compras
|
|||||||
DdlRefacturacionFacturas.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
DdlRefacturacionFacturas.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Protected Sub BtnRecolecciónAplicar_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,8 @@
|
|||||||
<asp:RadioButtonList runat="server" ID="RblFormato">
|
<asp:RadioButtonList runat="server" ID="RblFormato">
|
||||||
<asp:ListItem Value="1" Text="Proveedores" Selected="True"></asp:ListItem>
|
<asp:ListItem Value="1" Text="Proveedores" Selected="True"></asp:ListItem>
|
||||||
<asp:ListItem Value="3" Text="Factura - Proveedor"></asp:ListItem>
|
<asp:ListItem Value="3" Text="Factura - Proveedor"></asp:ListItem>
|
||||||
|
<asp:ListItem Value="18" Text="Factura - Proveedor Detalle"></asp:ListItem>
|
||||||
|
|
||||||
<asp:ListItem Value="13" Text="Anticipo Proveedores"></asp:ListItem>
|
<asp:ListItem Value="13" Text="Anticipo Proveedores"></asp:ListItem>
|
||||||
<asp:ListItem Value="2" Text="Clientes"></asp:ListItem>
|
<asp:ListItem Value="2" Text="Clientes"></asp:ListItem>
|
||||||
<asp:ListItem Value="4" Text="Factura - Cliente"></asp:ListItem>
|
<asp:ListItem Value="4" Text="Factura - Cliente"></asp:ListItem>
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ Partial Class General_SaldosIniciales
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
ElseIf RblFormato.SelectedValue = "3" Or RblFormato.SelectedValue = "4" Or RblFormato.SelectedValue = "17" Then
|
ElseIf RblFormato.SelectedValue = "3" Or RblFormato.SelectedValue = "4" Or RblFormato.SelectedValue = "17" Or RblFormato.SelectedValue = "18" Then
|
||||||
If Not dt.Columns(0).ColumnName = "Sucursal" Then
|
If Not dt.Columns(0).ColumnName = "Sucursal" Then
|
||||||
Alert("El nombre de la primera columna debe ser 'Sucursal'. Favor de corregirlo", TipoMensaje.MsgError)
|
Alert("El nombre de la primera columna debe ser 'Sucursal'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
@@ -293,54 +293,84 @@ Partial Class General_SaldosIniciales
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not dt.Columns(15).ColumnName = "Folio Fiscal" Then
|
|
||||||
Alert("El nombre de la decimosexta columna debe ser 'Folio Fiscalo'. Favor de corregirlo", TipoMensaje.MsgError)
|
|
||||||
Exit Sub
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Not dt.Columns(16).ColumnName = "PorcentajeIVA" Then
|
If RblFormato.SelectedValue = "3" Or RblFormato.SelectedValue = "18" Then
|
||||||
Alert("El nombre de la decimoséptima columna debe ser 'PorcentajeIVA'. Favor de corregirlo", TipoMensaje.MsgError)
|
|
||||||
Exit Sub
|
|
||||||
End If
|
|
||||||
|
|
||||||
'If RblFormato.SelectedValue = "4" Then
|
If Not dt.Columns(15).ColumnName = "PorcentajeIVA" Then
|
||||||
' If Not dt.Columns(15).ColumnName = "ImpuestoLocal" Then
|
Alert("El nombre de la quinceava columna debe ser 'PorcentajeIVA'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
' Alert("El nombre de la diesciseisava columna debe ser 'ImpuestoLocal'. Favor de corregirlo", TipoMensaje.MsgError)
|
|
||||||
' Exit Sub
|
|
||||||
' End If
|
|
||||||
|
|
||||||
' If Not dt.Columns(16).ColumnName = "Amort.Ant" Then
|
|
||||||
' Alert("El nombre de la diescisieteava columna debe ser 'Amort.Ant'. Favor de corregirlo", TipoMensaje.MsgError)
|
|
||||||
' Exit Sub
|
|
||||||
' End If
|
|
||||||
'End If
|
|
||||||
|
|
||||||
If RblFormato.SelectedValue = "17" Then
|
|
||||||
|
|
||||||
|
|
||||||
If Not dt.Columns(17).ColumnName = "Cantidad" Then
|
|
||||||
Alert("El nombre de la Decimoctava columna debe ser 'Cantidad'. Favor de corregirlo", TipoMensaje.MsgError)
|
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not dt.Columns(18).ColumnName = "PU" Then
|
If Not dt.Columns(16).ColumnName = "ImpuestosLocales" Then
|
||||||
Alert("El nombre de la Decimonovena columna debe ser 'PU'. Favor de corregirlo", TipoMensaje.MsgError)
|
Alert("El nombre de la quinceava columna debe ser 'ImpuestosLocales'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not dt.Columns(19).ColumnName = "IVA" Then
|
If RblFormato.SelectedValue = "18" Then
|
||||||
Alert("El nombre de la Vigésima columna debe ser 'IVA'. Favor de corregirlo", TipoMensaje.MsgError)
|
If Not dt.Columns(17).ColumnName = "Cantidad" Then
|
||||||
Exit Sub
|
Alert("El nombre de la Decimoctava columna debe ser 'Cantidad'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
End If
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not dt.Columns(18).ColumnName = "Codigo" Then
|
||||||
If Not dt.Columns(20).ColumnName = "IEPS" Then
|
Alert("El nombre de la Decimonovena columna debe ser 'Codigo'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
Alert("El nombre de la Vigésimo primera columna debe ser 'IEPS'. Favor de corregirlo", TipoMensaje.MsgError)
|
Exit Sub
|
||||||
Exit Sub
|
End If
|
||||||
|
If Not dt.Columns(19).ColumnName = "PU" Then
|
||||||
|
Alert("El nombre de la Vigésima columna debe ser 'PU'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
If Not dt.Columns(20).ColumnName = "IVADetalle" Then
|
||||||
|
Alert("El nombre de la Vigésimo primera columna debe ser 'IVADetalle'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
If Not dt.Columns(21).ColumnName = "IEPS" Then
|
||||||
|
Alert("El nombre de la Vigésimo segunda columna debe ser 'IEPS'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If RblFormato.SelectedValue = "4" Or RblFormato.SelectedValue = "17" Then
|
||||||
|
If Not dt.Columns(15).ColumnName = "Folio Fiscal" Then
|
||||||
|
Alert("El nombre de la decimosexta columna debe ser 'Folio Fiscalo'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not dt.Columns(16).ColumnName = "PorcentajeIVA" Then
|
||||||
|
Alert("El nombre de la decimoséptima columna debe ser 'PorcentajeIVA'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
If RblFormato.SelectedValue = "17" Then
|
||||||
|
If Not dt.Columns(17).ColumnName = "Cantidad" Then
|
||||||
|
Alert("El nombre de la Decimoctava columna debe ser 'Cantidad'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not dt.Columns(18).ColumnName = "Codigo" Then
|
||||||
|
Alert("El nombre de la Decimonovena columna debe ser 'Codigo'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
If Not dt.Columns(19).ColumnName = "PU" Then
|
||||||
|
Alert("El nombre de la Vigésima columna debe ser 'PU'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
If Not dt.Columns(20).ColumnName = "IVADetalle" Then
|
||||||
|
Alert("El nombre de la Vigésimo primera columna debe ser 'IVADetalle'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
If Not dt.Columns(21).ColumnName = "IEPS" Then
|
||||||
|
Alert("El nombre de la Vigésimo segunda columna debe ser 'IEPS'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ElseIf RblFormato.SelectedValue = "5" Then
|
ElseIf RblFormato.SelectedValue = "5" Then
|
||||||
|
|
||||||
If Not dt.Columns(0).ColumnName = "Codigo" Then
|
If Not dt.Columns(0).ColumnName = "Codigo" Then
|
||||||
@@ -1444,7 +1474,7 @@ Partial Class General_SaldosIniciales
|
|||||||
|
|
||||||
|
|
||||||
'P R O V E E D O R E S - F A C T U R A S
|
'P R O V E E D O R E S - F A C T U R A S
|
||||||
ElseIf RblFormato.SelectedValue = "3" Then
|
ElseIf RblFormato.SelectedValue = "3" Or RblFormato.SelectedValue = "18" Then
|
||||||
|
|
||||||
#Region "P R O V E E D O R E S - F A C T U R A S"
|
#Region "P R O V E E D O R E S - F A C T U R A S"
|
||||||
|
|
||||||
@@ -1469,6 +1499,9 @@ Partial Class General_SaldosIniciales
|
|||||||
Dim CveClasificacion As Integer = drr("CveClasificacion").ToString().ToEntero()
|
Dim CveClasificacion As Integer = drr("CveClasificacion").ToString().ToEntero()
|
||||||
Dim dtsubp As DataTable = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
|
Dim dtsubp As DataTable = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Dim CountRow As Integer = 1
|
||||||
For Each Row As DataRow In dt.FiltraParametros("RFC <> ''").Rows
|
For Each Row As DataRow In dt.FiltraParametros("RFC <> ''").Rows
|
||||||
Dim Sucursal As String = dtsubp.FiltroPrimeroValor("CveSubProyecto", $"SubProyecto = '{Row("Sucursal").ToString()}'")
|
Dim Sucursal As String = dtsubp.FiltroPrimeroValor("CveSubProyecto", $"SubProyecto = '{Row("Sucursal").ToString()}'")
|
||||||
RFC = Row("RFC").ToString().Trim
|
RFC = Row("RFC").ToString().Trim
|
||||||
@@ -1529,6 +1562,45 @@ Partial Class General_SaldosIniciales
|
|||||||
TipoCambio = GlobalTipoCambio(Fecha).ToString
|
TipoCambio = GlobalTipoCambio(Fecha).ToString
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
Dim IEPSDetalle As Decimal = 0
|
||||||
|
Dim CantidadDetalle As Decimal = 0
|
||||||
|
Dim PUDetalle As Decimal = 0
|
||||||
|
Dim IVADetalle As Decimal = 0
|
||||||
|
|
||||||
|
If RblFormato.SelectedValue = "18" Then
|
||||||
|
|
||||||
|
Dim CodigoDetalle As String = Row("Codigo").ToString
|
||||||
|
If CodigoDetalle.Trim.Length > 0 Then
|
||||||
|
Dim DrDetalles As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"Codigo = '{CodigoDetalle}'")
|
||||||
|
|
||||||
|
If DrDetalles IsNot Nothing Then
|
||||||
|
CvePS = DrDetalles("CvePS").ToString().ToEntero()
|
||||||
|
CveUnidadMedida = DrDetalles("CveUnidadMedida").ToString().ToEntero()
|
||||||
|
CveClasificacion = DrDetalles("CveClasificacion").ToString().ToEntero()
|
||||||
|
Else
|
||||||
|
Alert($"El código del producto no se encontro, error en registro {CountRow}")
|
||||||
|
ErrorCompras = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
Else
|
||||||
|
Alert($"El código es requerido, error en registro {CountRow}")
|
||||||
|
ErrorCompras = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
IEPSDetalle = Row("IEPS").ToString.ToDecimal
|
||||||
|
CantidadDetalle = Row("Cantidad").ToString.ToDecimal
|
||||||
|
PUDetalle = Row("PU").ToString.ToDecimal
|
||||||
|
IVADetalle = Row("IVA").ToString.ToDecimal
|
||||||
|
|
||||||
|
If CantidadDetalle = 0 Then
|
||||||
|
Alert($"No se especifico la cantidad, error en registro {CountRow}")
|
||||||
|
ErrorCompras = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
'PrePóliza
|
'PrePóliza
|
||||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Compras/SaldoInicial", 1, Total, Total, CveMoneda, Fecha, String.Format("{0}-{1}", Serie, Folio), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Compras/SaldoInicial", 1, Total, Total, CveMoneda, Fecha, String.Format("{0}-{1}", Serie, Folio), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
If Not CvePrePoliza > 0 Then
|
If Not CvePrePoliza > 0 Then
|
||||||
@@ -1548,10 +1620,24 @@ Partial Class General_SaldosIniciales
|
|||||||
CveCompra = ObjCompras.CveCompra
|
CveCompra = ObjCompras.CveCompra
|
||||||
|
|
||||||
'Compra Detalle
|
'Compra Detalle
|
||||||
If Not ObjCompras.AddCompraDetalle(CveCompra, CveUnidadMedida, CvePS, CveSubProyecto, -1, 0, 1, SubTotal, SubTotal * PorcentajeIVA, SubTotal, 0, "Carga Inicial", -1, IVAPorcentaje:=PorcentajeIVA, RetIVAPorcentaje:=RetIVAPorcentaje, RetISRPorcentaje:=RetISRPorcentaje) Then
|
If RblFormato.SelectedValue = "18" Then
|
||||||
ErrorCompras = True
|
|
||||||
Exit For
|
Dim TotalDetalles As Decimal = SubTotal
|
||||||
|
If PUDetalle > 0 Then
|
||||||
|
TotalDetalles = (CantidadDetalle * PUDetalle) + IVA - RetIVA - RetISR + IEPSDetalle
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not ObjCompras.AddCompraDetalle(CveCompra, CveUnidadMedida, CvePS, CveSubProyecto, -1, 0, CantidadDetalle, PUDetalle, (CantidadDetalle * PUDetalle) * PorcentajeIVA, TotalDetalles, 0, "Carga Inicial", -1, IVAPorcentaje:=PorcentajeIVA, RetIVAPorcentaje:=RetIVAPorcentaje, RetISRPorcentaje:=RetISRPorcentaje, IEPSPS:=IEPSDetalle) Then
|
||||||
|
ErrorCompras = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
If Not ObjCompras.AddCompraDetalle(CveCompra, CveUnidadMedida, CvePS, CveSubProyecto, -1, 0, 1, SubTotal, SubTotal * PorcentajeIVA, SubTotal, 0, "Carga Inicial", -1, IVAPorcentaje:=PorcentajeIVA, RetIVAPorcentaje:=RetIVAPorcentaje, RetISRPorcentaje:=RetISRPorcentaje) Then
|
||||||
|
ErrorCompras = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ImpuestosLocales > 0 Then 'se agrega como parte de la partida, sin iva.
|
If ImpuestosLocales > 0 Then 'se agrega como parte de la partida, sin iva.
|
||||||
If Not ObjCompras.AddCompraDetalle(CveCompra, CveUnidadMedida, CvePS, CveSubProyecto, -1, 0, 1, ImpuestosLocales, ImpuestosLocales, ImpuestosLocales, 0, "Carga Inicial", -1, IVAPorcentaje:=0, RetIVAPorcentaje:=0, RetISRPorcentaje:=0) Then
|
If Not ObjCompras.AddCompraDetalle(CveCompra, CveUnidadMedida, CvePS, CveSubProyecto, -1, 0, 1, ImpuestosLocales, ImpuestosLocales, ImpuestosLocales, 0, "Carga Inicial", -1, IVAPorcentaje:=0, RetIVAPorcentaje:=0, RetISRPorcentaje:=0) Then
|
||||||
ErrorCompras = True
|
ErrorCompras = True
|
||||||
@@ -1580,6 +1666,7 @@ Partial Class General_SaldosIniciales
|
|||||||
End If
|
End If
|
||||||
Encontrados = Encontrados + 1
|
Encontrados = Encontrados + 1
|
||||||
|
|
||||||
|
CountRow = CountRow + 1
|
||||||
Next
|
Next
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
@@ -1688,7 +1775,7 @@ Partial Class General_SaldosIniciales
|
|||||||
|
|
||||||
Dim CodigoDetalle As String = Row("Codigo").ToString
|
Dim CodigoDetalle As String = Row("Codigo").ToString
|
||||||
If CodigoDetalle.Trim.Length > 0 Then
|
If CodigoDetalle.Trim.Length > 0 Then
|
||||||
Dim DrDetalles As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"Codigo = {CodigoDetalle}")
|
Dim DrDetalles As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"Codigo = '{CodigoDetalle}'")
|
||||||
|
|
||||||
If DrDetalles IsNot Nothing Then
|
If DrDetalles IsNot Nothing Then
|
||||||
CvePS = DrDetalles("CvePS").ToString().ToEntero()
|
CvePS = DrDetalles("CvePS").ToString().ToEntero()
|
||||||
@@ -1811,9 +1898,6 @@ Partial Class General_SaldosIniciales
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Dim ConceptoContable As Integer = 1
|
Dim ConceptoContable As Integer = 1
|
||||||
Dim ConceptoContablePago As Integer = 2
|
Dim ConceptoContablePago As Integer = 2
|
||||||
If TipoDocto = "Egs" Then
|
If TipoDocto = "Egs" Then
|
||||||
@@ -1844,6 +1928,11 @@ Partial Class General_SaldosIniciales
|
|||||||
If RetIVA > 0 Then
|
If RetIVA > 0 Then
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, RetIVA, RetIVA, 8, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, RetIVA, RetIVA, 8, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'If RetISR > 0 Then
|
||||||
|
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, RetISR, RetISR, 9, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, PorcentajeImpuesto:=Porce, Contabilizable:=False) Then ErrorVentas = True : Exit For
|
||||||
|
'End If
|
||||||
|
|
||||||
If ImpuestoLocal > 0 Then
|
If ImpuestoLocal > 0 Then
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImpuestoLocal, ImpuestoLocal, 27, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImpuestoLocal, ImpuestoLocal, 27, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
|
||||||
End If
|
End If
|
||||||
@@ -2387,7 +2476,7 @@ Partial Class General_SaldosIniciales
|
|||||||
Dim AlmacenRef As DataTable = GlobalDTAlmacen(UsuarioActual.CveEmpresa)
|
Dim AlmacenRef As DataTable = GlobalDTAlmacen(UsuarioActual.CveEmpresa)
|
||||||
Dim contadorMovimientos As Integer = 0
|
Dim contadorMovimientos As Integer = 0
|
||||||
Dim listadoMovimientos As String = ""
|
Dim listadoMovimientos As String = ""
|
||||||
Dim mensajeError As String = ""
|
Dim mensajeError As New StringBuilder
|
||||||
Dim Fecha As DateTime = (TxtFecha.Text).ToDate
|
Dim Fecha As DateTime = (TxtFecha.Text).ToDate
|
||||||
Try
|
Try
|
||||||
For Each almacenSinRepetir As DataRow In dt.FiltraParametros("Almacen <> ''", DistinctColumns:={"Almacen"}).Rows
|
For Each almacenSinRepetir As DataRow In dt.FiltraParametros("Almacen <> ''", DistinctColumns:={"Almacen"}).Rows
|
||||||
@@ -2403,6 +2492,7 @@ Partial Class General_SaldosIniciales
|
|||||||
contadorMovimientos += 1
|
contadorMovimientos += 1
|
||||||
Dim RowPS As DataRow = ProductosServiciosRef.FiltroPrimero($"Codigo = '{nuevaEntrada("CodigoPS")}' ")
|
Dim RowPS As DataRow = ProductosServiciosRef.FiltroPrimero($"Codigo = '{nuevaEntrada("CodigoPS")}' ")
|
||||||
If RowPS IsNot Nothing Then
|
If RowPS IsNot Nothing Then
|
||||||
|
|
||||||
Dim CvePS As Integer = RowPS("CvePS").ToString().ToEntero()
|
Dim CvePS As Integer = RowPS("CvePS").ToString().ToEntero()
|
||||||
Dim CveUM As Integer = RowPS("CveUnidadMedida").ToString().ToEntero()
|
Dim CveUM As Integer = RowPS("CveUnidadMedida").ToString().ToEntero()
|
||||||
If CveUM > 0 Then
|
If CveUM > 0 Then
|
||||||
@@ -2415,47 +2505,47 @@ Partial Class General_SaldosIniciales
|
|||||||
Dim PU As Decimal = If(Valor = 0, 0, (Valor / Cantidad))
|
Dim PU As Decimal = If(Valor = 0, 0, (Valor / Cantidad))
|
||||||
|
|
||||||
If Not ObjMovimientos.AddMovimientoDetalle(movimientoCabecera, Cantidad, CveUM, CvePS, PU, -1, -1, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad) Then
|
If Not ObjMovimientos.AddMovimientoDetalle(movimientoCabecera, Cantidad, CveUM, CvePS, PU, -1, -1, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad) Then
|
||||||
mensajeError = "No se logró generar el detalle del movimiento"
|
mensajeError.Append("No se logró generar el detalle del movimiento")
|
||||||
Throw New Exception()
|
Throw New Exception()
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
mensajeError = $"La unidad de medida no se reconoce para el producto servicio:{nuevaEntrada("CodigoPS")}"
|
mensajeError.Append($"La unidad de medida no se reconoce para el producto servicio:{nuevaEntrada("CodigoPS")}")
|
||||||
Throw New Exception()
|
Throw New Exception()
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
mensajeError = "" '$"No se encontró el producto o servicio con código ""{nuevaEntrada("CodigoPS")}"""
|
mensajeError.Append($"No se encontró el producto o servicio con código ""{nuevaEntrada("CodigoPS")}"" <br>")
|
||||||
'Throw New Exception()
|
' Throw New Exception()
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
If contadorMovimientos = 0 Then
|
If contadorMovimientos = 0 Then
|
||||||
mensajeError = $"No se encontraros registros del almacen: ""{almacenActual}"""
|
mensajeError.Append($"No se encontraros registros del almacen: ""{almacenActual}""")
|
||||||
Throw New Exception()
|
Throw New Exception()
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
mensajeError = $"No se registró el encabezado ""{almacenActual}"""
|
mensajeError.Append($"No se registró el encabezado ""{almacenActual}""")
|
||||||
Throw New Exception()
|
Throw New Exception()
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
mensajeError = $"No se encontró el almacén con nombre ""{almacenActual}"""
|
mensajeError.Append($"No se encontró el almacén con nombre ""{almacenActual}""")
|
||||||
Throw New Exception()
|
Throw New Exception()
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
If mensajeError = "" Then
|
If mensajeError.ToString = "" Then
|
||||||
mensajeError = "Error técnico, informar a soporte" & ex.Message
|
mensajeError.Append("Error técnico, informar a soporte" & ex.Message)
|
||||||
End If
|
End If
|
||||||
ObjMovimientos.RollBack()
|
ObjMovimientos.RollBack()
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
If mensajeError = "" Then
|
If mensajeError.ToString = "" Then
|
||||||
ObjMovimientos.Commit()
|
ObjMovimientos.Commit()
|
||||||
Alert($"Se cargaron correctamente {contadorMovimientos} movimientos<br/><br/>{listadoMovimientos}")
|
Alert($"Se cargaron correctamente {contadorMovimientos} movimientos<br/><br/>{listadoMovimientos}")
|
||||||
Else
|
Else
|
||||||
Alert(mensajeError, TipoMensaje.MsgError)
|
Alert(mensajeError.ToString, TipoMensaje.MsgError)
|
||||||
ObjMovimientos.RollBack()
|
ObjMovimientos.RollBack()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -3083,6 +3173,8 @@ Partial Class General_SaldosIniciales
|
|||||||
Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoClasificaciones.xlsx"
|
Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoClasificaciones.xlsx"
|
||||||
ElseIf RblFormato.SelectedValue = "17" Then
|
ElseIf RblFormato.SelectedValue = "17" Then
|
||||||
Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoClientes-Facturas-Detalles.xlsx"
|
Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoClientes-Facturas-Detalles.xlsx"
|
||||||
|
ElseIf RblFormato.SelectedValue = "18" Then
|
||||||
|
Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoProveedores-Facturas-Detalles.xlsx"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not (Directorio = "") Then
|
If Not (Directorio = "") Then
|
||||||
|
|||||||
@@ -970,6 +970,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" class=" xspadding .nolineheight bordered whitoutcol" style="color: white;">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div id="DivBloqueoAcceso" runat="server" style="width: 100%; text-align: center;" visible="false">
|
||||||
|
<asp:Button ID="BtnBloquearAcceso" ClientIDMode="Static" CssClass="btn red-haze btn-outline btn-circle btn-sm" runat="server" Text="Bloquear Turno" OnClick="BtnBloquearAcceso_Click" />
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<asp:UpdatePanel ID="Updatetabs" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="Updatetabs" runat="server" UpdateMode="Conditional">
|
||||||
@@ -8676,7 +8683,41 @@
|
|||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<asp:Button ID="BtnShowBloqueoAcceso" runat="server" Text="Show Modal Popup" Style="visibility: hidden; display: none;" />
|
||||||
|
<asp:Button ID="BtnCloseBloqueoAcceso" runat="server" CssClass="btn btn-danger" Style="visibility: hidden; display: none;" Text="Cancelar" />
|
||||||
|
|
||||||
|
<!-- ModalPopupExtender -->
|
||||||
|
<cc1:ModalPopupExtender ID="mpeBloque" runat="server" PopupControlID="PanelBloqueoAcceso" TargetControlID="BtnShowBloqueoAcceso"
|
||||||
|
BackgroundCssClass="modalBackground">
|
||||||
|
</cc1:ModalPopupExtender>
|
||||||
|
|
||||||
|
<asp:Panel ID="PanelBloqueoAcceso" runat="server" CssClass="modalPopup" align="center" Style="display: none">
|
||||||
|
<table border="0" width="250px" cellspacing="1" style="background-color: White; padding-left: 10px;">
|
||||||
|
<tr style="background-color: #3598dc; color: #FFFFFF; font-size: 14px; text-align: center">
|
||||||
|
<td colspan="2">
|
||||||
|
<asp:Label runat="server" Text="<i class='fa fa-lock fa-2 icontxt'></i> Acceso Restringido" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="1"> </td>
|
||||||
|
<td colspan="1"> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="1">
|
||||||
|
<asp:Label runat="server" Text="Código de Acceso:" Font-Bold="true" Width="120px" />
|
||||||
|
</td>
|
||||||
|
<td colspan="1" style="text-align: center">
|
||||||
|
<asp:TextBox ID="TxtCodigoAcceso" runat="server" type="password"></asp:TextBox>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVCodigoAcceso" runat="server" ControlToValidate="TxtCodigoAcceso" Display="None" ErrorMessage="<span class='has-error'><span id='username-error' class='help-block'>El campo <b>''Código de Acceso''</b> es necesario.</span></span>" ValidationGroup="GrpValidarCodigo"></asp:RequiredFieldValidator>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2"><span class='has-error'><span id='username-error' class='help-block'>
|
||||||
|
<asp:Literal ID="LtlMensajeBloqueo" runat="server" Text=""></asp:Literal></span></span></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<asp:Button ID="BtnCambiar" runat="server" CssClass="btn btn-success btn-sm" Text="Desbloquear" ValidationGroup="GrpValidarCodigo" OnClick="BtnCambiar_Click" />
|
||||||
|
|
||||||
|
</asp:Panel>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2485,7 +2485,7 @@ Partial Class Ventas
|
|||||||
TxtFechaFRem.Text = NowADS().ToShortDateString
|
TxtFechaFRem.Text = NowADS().ToShortDateString
|
||||||
TxtFechaFPedido.Text = NowADS().ToShortDateString
|
TxtFechaFPedido.Text = NowADS().ToShortDateString
|
||||||
TxtFechaFOC.Text = NowADS().ToShortDateString
|
TxtFechaFOC.Text = NowADS().ToShortDateString
|
||||||
|
ValidaUsuarioAcceso()
|
||||||
|
|
||||||
TrSinExistencia.Visible = UsuarioActual.TienePermisoProceso(276)
|
TrSinExistencia.Visible = UsuarioActual.TienePermisoProceso(276)
|
||||||
|
|
||||||
@@ -3528,7 +3528,135 @@ Partial Class Ventas
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
#Region "Bloqueo Pantalla"
|
||||||
|
Private Sub ValidaUsuarioAcceso()
|
||||||
|
'VERIFICAR SI LA SESION SE ENCUENTRA BLOQUEADA
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(599) = "1" Then
|
||||||
|
Dim DrUsuario As DataRow = GlobalDTUsuarios(CveUsuario:=UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)
|
||||||
|
|
||||||
|
If DrUsuario("CodigoAcceso").ToString() <> "" Then
|
||||||
|
If UsuarioActual.SesionBloqueada Then
|
||||||
|
DivBloqueoacceso.Visible = False
|
||||||
|
Dim strScript As New StringBuilder
|
||||||
|
strScript.Append("window.onload = function MuestraBloqueo() { document.getElementById(""C_BtnShowBloqueoAcceso"").click(); setTimeout(function(){ $('#C_TxtCodigoAcceso').focus(); ")
|
||||||
|
If UsuarioActual.ErrorDesbloqueo Then
|
||||||
|
LtlMensajeBloqueo.Text = UsuarioActual.MsgErrorDesbloqueo
|
||||||
|
'strScript.AppendFormat("alert('{0}');", UsuarioActual.MsgErrorDesbloqueo)
|
||||||
|
End If
|
||||||
|
strScript.Append("}, 500); }")
|
||||||
|
RegistraScript(strScript.ToString())
|
||||||
|
|
||||||
|
UsuarioActual.SesionBloqueada = True
|
||||||
|
UsuarioActual.ErrorDesbloqueo = False
|
||||||
|
UsuarioActual.MsgErrorDesbloqueo = ""
|
||||||
|
|
||||||
|
BtnEmitirImprimir.Visible = False
|
||||||
|
Exit Sub
|
||||||
|
Else
|
||||||
|
DivBloqueoacceso.Visible = True
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
DivBloqueoacceso.Visible = False
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
DivBloqueoacceso.Visible = False
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub BtnCambiar_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
UsuarioActual.ErrorDesbloqueo = False
|
||||||
|
UsuarioActual.MsgErrorDesbloqueo = ""
|
||||||
|
|
||||||
|
If String.IsNullOrEmpty(TxtCodigoAcceso.Text.Trim) Then
|
||||||
|
UsuarioActual.SesionBloqueada = True
|
||||||
|
UsuarioActual.ErrorDesbloqueo = True
|
||||||
|
UsuarioActual.MsgErrorDesbloqueo = "Es necesario un código de acceso"
|
||||||
|
|
||||||
|
Response.Redirect($"~/Ventas/Ventas.aspx")
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim CveUsuarioNuevo As Integer = -1
|
||||||
|
|
||||||
|
Using ObjUsuarios As New ClsSisUsuarios
|
||||||
|
CveUsuarioNuevo = ObjUsuarios.ValidaUsuarioCodigoAcceso(TxtCodigoAcceso.Text.Trim, UsuarioActual.CveEmpresa)
|
||||||
|
End Using
|
||||||
|
|
||||||
|
Dim DrUsuario As DataRow = Nothing
|
||||||
|
|
||||||
|
If CveUsuarioNuevo > 0 Then
|
||||||
|
DrUsuario = GlobalDTUsuarios(CveUsuarioNuevo, UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 1", "", {"CveUsuario", "Usuario", "Nombre", "Contraseña", "CveEmpresa", "Rol"}).Rows(0)
|
||||||
|
End If
|
||||||
|
|
||||||
|
If DrUsuario IsNot Nothing Then
|
||||||
|
|
||||||
|
Dim tUsuario, tContraseña As String
|
||||||
|
Dim tCveEmpresa As Integer
|
||||||
|
tUsuario = DrUsuario("Usuario").ToString
|
||||||
|
tContraseña = DrUsuario("Contraseña").ToString
|
||||||
|
tCveEmpresa = DrUsuario("CveEmpresa").ToString.ToEntero
|
||||||
|
|
||||||
|
Dim ObjUsuario As New ClsSisUsuarios
|
||||||
|
Dim Usuario As Usuario
|
||||||
|
|
||||||
|
Usuario = ObjUsuario.ValidaUsuario(tUsuario, tContraseña, IMEI, tCveEmpresa)
|
||||||
|
|
||||||
|
ObjUsuario.Dispose()
|
||||||
|
|
||||||
|
If Usuario IsNot Nothing Then
|
||||||
|
Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
|
||||||
|
ADSSession.ADSSessionConfig.sessionUser = Usuario
|
||||||
|
ADSSession.ADSSessionConfig.sessionUser.CvePlataforma = 1
|
||||||
|
ADSSession.ADSSessionConfig.sessionDpage = False
|
||||||
|
ADSSession.ADSSessionConfig.sessionUser.ModoSimulacion = False
|
||||||
|
|
||||||
|
If dt IsNot Nothing Then
|
||||||
|
If dt.Rows.Count >= 1 Then
|
||||||
|
If dt.Rows.Count > 1 Then ADSSession.ADSSessionConfig.sessionUser.MultipleEmpresa = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
dt.Dispose()
|
||||||
|
|
||||||
|
Dim ObjEmpresa As New ClsSisEmpresas()
|
||||||
|
If ObjEmpresa.GetEmpresas(tCveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||||
|
If ObjEmpresa.GetEmpresasFuncionalidades(tCveEmpresa) Then
|
||||||
|
Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados
|
||||||
|
|
||||||
|
Dim EmpresasFuncionalidades As New HybridDictionary
|
||||||
|
For Each Row As Data.DataRow In dttmp.Rows
|
||||||
|
EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
|
||||||
|
Next
|
||||||
|
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
UsuarioActual.Empresa = ObjEmpresa.Empresa
|
||||||
|
ADSSession.ADSSessionConfig.sessionUser.CveEmpresa = ObjEmpresa.Empresa.CveEmpresa
|
||||||
|
|
||||||
|
ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.CambiarEmpresa, Nothing, ObjEmpresa.Empresa.CveEmpresa)
|
||||||
|
End If
|
||||||
|
ObjEmpresa.Dispose()
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
Response.Redirect($"~/Ventas/Ventas.aspx")
|
||||||
|
Else
|
||||||
|
UsuarioActual.SesionBloqueada = True
|
||||||
|
UsuarioActual.ErrorDesbloqueo = True
|
||||||
|
UsuarioActual.MsgErrorDesbloqueo = "El código de acceso no es correcto"
|
||||||
|
|
||||||
|
Response.Redirect($"~/Ventas/Ventas.aspx")
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
Protected Sub BtnBloquearAcceso_Click(sender As Object, e As EventArgs)
|
||||||
|
UsuarioActual.SesionBloqueada = True
|
||||||
|
|
||||||
|
Response.Redirect($"~/Ventas/Ventas.aspx")
|
||||||
|
End Sub
|
||||||
|
#End Region
|
||||||
|
|
||||||
Private Sub CargaListasPrecios()
|
Private Sub CargaListasPrecios()
|
||||||
DivPrecioLista.Visible = True
|
DivPrecioLista.Visible = True
|
||||||
|
|||||||
Reference in New Issue
Block a user