This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2024-08-26 01:09:24 -07:00
62 changed files with 65498 additions and 1543 deletions

View File

@@ -4,6 +4,7 @@ Option Strict On
Imports System.Data Imports System.Data
Imports System.Data.SqlClient Imports System.Data.SqlClient
Imports Extensiones Imports Extensiones
Imports StackExchange.Redis
Public Class ClsClientes Public Class ClsClientes
@@ -146,6 +147,7 @@ Public Class ClsClientes
Public Property CargoUsados As Boolean Public Property CargoUsados As Boolean
Public Property BonificacionUsado As Boolean Public Property BonificacionUsado As Boolean
Public Property CveSATEstado As Integer Public Property CveSATEstado As Integer
Public Property Aseguradora As Boolean
Public ReadOnly Property DtResultados() As DataTable Public ReadOnly Property DtResultados() As DataTable
@@ -259,7 +261,7 @@ Public Class ClsClientes
Public Function GetClientes(CveCliente As Integer, Nombre As String, Codigo As String, NombreCorto As String, RFC As String, Telefono As String, Mail As String, CveSubProyecto As Integer, Public Function GetClientes(CveCliente As Integer, Nombre As String, Codigo As String, NombreCorto As String, RFC As String, Telefono As String, Mail As String, CveSubProyecto As Integer,
CveEmpresa As Integer, Optional Estatus As Integer = 1, Optional Notificar As String = "-1", Optional CvePrecioLista As Integer = -1, Optional CveClienteClasificacion As Integer = -1, CveEmpresa As Integer, Optional Estatus As Integer = 1, Optional Notificar As String = "-1", Optional CvePrecioLista As Integer = -1, Optional CveClienteClasificacion As Integer = -1,
Optional TipoCliente As Integer = -1, Optional CveVendedor As Integer = -1, Optional PermiteCreditoFiltro As Integer = -1, Optional TopSelect As Integer = 10000, Optional CveUsuarioConsulta As Integer = -1, Optional TipoCliente As Integer = -1, Optional CveVendedor As Integer = -1, Optional PermiteCreditoFiltro As Integer = -1, Optional TopSelect As Integer = 10000, Optional CveUsuarioConsulta As Integer = -1,
Optional Cuenta As String = "-1") As Boolean Optional Cuenta As String = "-1", Optional EnQuebranto As Integer = -1, Optional EnDemanda As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_ClientesGet") DataAdapter("PA_ClientesGet")
@@ -283,6 +285,8 @@ Public Class ClsClientes
.Add("@PermiteCredito", SqlDbType.Int).Value = PermiteCreditoFiltro .Add("@PermiteCredito", SqlDbType.Int).Value = PermiteCreditoFiltro
.Add("@TopSelect", SqlDbType.Int).Value = TopSelect .Add("@TopSelect", SqlDbType.Int).Value = TopSelect
.Add("@Cuenta", SqlDbType.VarChar).Value = Cuenta .Add("@Cuenta", SqlDbType.VarChar).Value = Cuenta
.Add("@EnQuebranto", SqlDbType.Int).Value = EnQuebranto
.Add("@EnDemanda", SqlDbType.Int).Value = EnDemanda
End With End With
Try Try
@@ -423,6 +427,7 @@ Public Class ClsClientes
_CreditoRegistroFirmas = Data(0)("CreditoRegistroFirmas").ToString _CreditoRegistroFirmas = Data(0)("CreditoRegistroFirmas").ToString
_GastosEnvio = Data(0)("GastosEnvio").ToString.ToDecimal _GastosEnvio = Data(0)("GastosEnvio").ToString.ToDecimal
_EsFilial = CBool(Data(0)("EsFilial")) _EsFilial = CBool(Data(0)("EsFilial"))
_Aseguradora = CBool(Data(0)("Aseguradora"))
End If End If
Retorno = True Retorno = True
Catch ex As Exception Catch ex As Exception
@@ -540,7 +545,7 @@ Public Class ClsClientes
Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0, Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0,
Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1", Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1, Optional CveRegimenFiscal As Integer = 0, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False, Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1", Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1, Optional CveRegimenFiscal As Integer = 0, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False,
Optional RepresentanteLegal As String = "", Optional FechaLimiteCredito As Date = MinFecha, Optional ComExtCalle As String = "-1", Optional ComExtNumExt As String = "-1", Optional ComExtCP As String = "-1", Optional Genero As Boolean = True, Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenConsignacion As Integer = -1, Optional CveAlmacenAlterno As Integer = -1, Optional UsaProductoAlterno As Boolean = False, Optional RepresentanteLegal As String = "", Optional FechaLimiteCredito As Date = MinFecha, Optional ComExtCalle As String = "-1", Optional ComExtNumExt As String = "-1", Optional ComExtCP As String = "-1", Optional Genero As Boolean = True, Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenConsignacion As Integer = -1, Optional CveAlmacenAlterno As Integer = -1, Optional UsaProductoAlterno As Boolean = False,
Optional EnDemanda As Boolean = False, Optional EnQuebranto As Boolean = False, Optional CreditoRegistroFirmas As String = "", Optional GastosEnvio As Decimal = 0, Optional EsFilial As Boolean = False) As Boolean Optional EnDemanda As Boolean = False, Optional EnQuebranto As Boolean = False, Optional CreditoRegistroFirmas As String = "", Optional GastosEnvio As Decimal = 0, Optional EsFilial As Boolean = False, Optional Aseguradora As Boolean = False) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
@@ -677,6 +682,7 @@ Public Class ClsClientes
.Add("@CreditoRegistroFirmas", SqlDbType.VarChar).Value = CreditoRegistroFirmas .Add("@CreditoRegistroFirmas", SqlDbType.VarChar).Value = CreditoRegistroFirmas
.Add("@GastosEnvio", SqlDbType.SmallMoney).Value = GastosEnvio .Add("@GastosEnvio", SqlDbType.SmallMoney).Value = GastosEnvio
.Add("@EsFilial", SqlDbType.VarChar).Value = EsFilial .Add("@EsFilial", SqlDbType.VarChar).Value = EsFilial
.Add("@Aseguradora", SqlDbType.Bit).Value = Aseguradora
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)
@@ -723,7 +729,7 @@ Public Class ClsClientes
Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0, Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1", Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0, Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1",
Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1, Optional NoDesglosaIVA As Boolean = False, Optional CveRegimenFiscal As Integer = 0, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False, Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1, Optional NoDesglosaIVA As Boolean = False, Optional CveRegimenFiscal As Integer = 0, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False,
Optional RepresentanteLegal As String = "", Optional FechaLimiteCredito As Date = MinFecha, Optional ComExtCalle As String = "-1", Optional ComExtNumExt As String = "-1", Optional ComExtCP As String = "-1", Optional Genero As Boolean = True, Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenAlterno As Integer = -1, Optional CveAlmacenConsignacion As Integer = -1, Optional UsaProductoAlterno As Boolean = False, Optional RepresentanteLegal As String = "", Optional FechaLimiteCredito As Date = MinFecha, Optional ComExtCalle As String = "-1", Optional ComExtNumExt As String = "-1", Optional ComExtCP As String = "-1", Optional Genero As Boolean = True, Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenAlterno As Integer = -1, Optional CveAlmacenConsignacion As Integer = -1, Optional UsaProductoAlterno As Boolean = False,
Optional EnDemanda As Boolean = False, Optional EnQuebranto As Boolean = False, Optional CreditoRegistroFirmas As String = "", Optional GastosEnvio As Decimal = 0, Optional EsFilial As Boolean = False) As Boolean Optional EnDemanda As Boolean = False, Optional EnQuebranto As Boolean = False, Optional CreditoRegistroFirmas As String = "", Optional GastosEnvio As Decimal = 0, Optional EsFilial As Boolean = False, Optional Aseguradora As Boolean = False) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
@@ -870,6 +876,7 @@ Public Class ClsClientes
.Add("@CreditoRegistroFirmas", SqlDbType.VarChar).Value = CreditoRegistroFirmas .Add("@CreditoRegistroFirmas", SqlDbType.VarChar).Value = CreditoRegistroFirmas
.Add("@GastosEnvio", SqlDbType.SmallMoney).Value = GastosEnvio .Add("@GastosEnvio", SqlDbType.SmallMoney).Value = GastosEnvio
.Add("@EsFilial", SqlDbType.VarChar).Value = EsFilial .Add("@EsFilial", SqlDbType.VarChar).Value = EsFilial
.Add("@Aseguradora", SqlDbType.Bit).Value = Aseguradora
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -613,13 +613,12 @@ Public Class ClsCompras
Alert(String.Format("No se puede eliminar la compra, porque tiene movimientos de salida de Almacen relacionados."), TipoMensaje.MsgAdvertencia) Alert(String.Format("No se puede eliminar la compra, porque tiene movimientos de salida de Almacen relacionados."), TipoMensaje.MsgAdvertencia)
ElseIf ex.Message.Contains("50015") Then ElseIf ex.Message.Contains("50015") Then
Alert("No se puede eliminar na compra debido a que el perido esta cerrado.", TipoMensaje.MsgAdvertencia) Alert("No se puede eliminar la compra debido a que el periodo esta cerrado.", TipoMensaje.MsgAdvertencia)
Else Else
Me.OnError("Ocurrió un error al eliminar la Compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) Me.OnError("Ocurrió un error al eliminar la Compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If End If
Catch ex As Exception Catch ex As Exception
OnError("Ocurrió un error al eliminar la compra", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) OnError("Ocurrió un error al eliminar la compra", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try End Try
Return Retorno Return Retorno

View File

@@ -3577,7 +3577,7 @@ Public Class ClsContabilidad
Public Function GetMovimientosAuxiliaresCatalogo(CveCuenta As Integer, FechaI As Date, FechaF As Date, CveMoneda As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, TipoReporte As String, OpcionCuentas As Integer) As Boolean Public Function GetMovimientosAuxiliaresCatalogo(CveCuenta As Integer, FechaI As Date, FechaF As Date, CveMoneda As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, TipoReporte As String, OpcionCuentas As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Conta_MovimientosAuxiliaresCatalogoGet") DataAdapter("PA_Conta_MovimientosAuxiliaresCatalogoGetOIC")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@FechaI", SqlDbType.Date).Value = FechaI .Add("@FechaI", SqlDbType.Date).Value = FechaI

View File

@@ -6247,13 +6247,14 @@ Public Class ClsInventarios
Return Retorno Return Retorno
End Function End Function
Public Function UpdatePedidoDetalleCantidad(CveVentaDetalle As Integer, Cantidad As Decimal) As Boolean Public Function UpdatePedidoDetalleCantidad(CveVentaDetalle As Integer, Cantidad As Decimal, Optional Opcion As Integer = 1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasDetalleCantidadUpdate") DataAdapter("PA_Vta_VentasDetalleCantidadUpdate")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVentaDetalle .Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVentaDetalle
.Add("@Cantidad", SqlDbType.Money).Value = Cantidad .Add("@Cantidad", SqlDbType.Money).Value = Cantidad
.Add("@Opcion", SqlDbType.Int).Value = Opcion
End With End With
Try Try

View File

@@ -30,6 +30,7 @@ Public Class ClsOC
Public Property CveOrdenCompra As Integer Public Property CveOrdenCompra As Integer
Public Property CveOrdenCompraDetalle As Integer Public Property CveOrdenCompraDetalle As Integer
Public Property Folio As Integer Public Property Folio As Integer
Public Property SerieFolio As String = ""
Public Property Serie As String = "" Public Property Serie As String = ""
Public Property CveIEAnticipo As Integer Public Property CveIEAnticipo As Integer
Public Property CveProveedorAnticipo As Integer Public Property CveProveedorAnticipo As Integer
@@ -609,6 +610,7 @@ Public Class ClsOC
Dim dr As DataRow = Data.Rows(0) Dim dr As DataRow = Data.Rows(0)
_CveOrdenCompra = dr("CveOrdenCompra").ToString.ToEntero _CveOrdenCompra = dr("CveOrdenCompra").ToString.ToEntero
_Folio = dr("Folio").ToString.ToEntero _Folio = dr("Folio").ToString.ToEntero
_SerieFolio = dr("SerieFolio").ToString
_Serie = dr("Serie").ToString _Serie = dr("Serie").ToString
_CveIEAnticipo = dr("CveIEAnticipo").ToString.ToEntero _CveIEAnticipo = dr("CveIEAnticipo").ToString.ToEntero
_FolioIEAnticipo = dr("FolioIEAnticipo").ToString.ToEntero _FolioIEAnticipo = dr("FolioIEAnticipo").ToString.ToEntero
@@ -1668,7 +1670,8 @@ Public Class ClsOC
FechaFin As Date, CveOrdenCompra As Integer, CveProveedor As Integer, Folio As Integer, CveUsuarioRegistro As Integer, CveUsuario As Integer, FechaFin As Date, CveOrdenCompra As Integer, CveProveedor As Integer, Folio As Integer, CveUsuarioRegistro As Integer, CveUsuario As Integer,
CveEmpresa As Integer, CvePS As Integer, Optional PendientePorSurtir As Boolean = False, Optional CveCliente As Integer = -1, Optional Guia As String = "-1", CveEmpresa As Integer, CvePS As Integer, Optional PendientePorSurtir As Boolean = False, Optional CveCliente As Integer = -1, Optional Guia As String = "-1",
Optional CveActivoFijo As Integer = -1, Optional SoloSubProyectosConPermiso As Boolean = False, Optional CveUsuarioAutorizo As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional SoloSubProyectosConPermiso As Boolean = False, Optional CveUsuarioAutorizo As Integer = -1,
Optional CveUsuarioAsignado As Integer = -1, Optional EntregaDirecta As Integer = -1, Optional TopSelect As Integer = 10000, Optional CveMoneda As Integer = -1, Optional MetodoPago As Integer = -1) As Boolean Optional CveUsuarioAsignado As Integer = -1, Optional EntregaDirecta As Integer = -1, Optional TopSelect As Integer = 10000, Optional CveMoneda As Integer = -1,
Optional MetodoPago As Integer = -1, Optional Serie As String = "-1") As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_OC_OrdenesCompraRep") DataAdapter("PA_OC_OrdenesCompraRep")
@@ -1699,6 +1702,7 @@ Public Class ClsOC
.Add("@TopSelect", SqlDbType.Int).Value = TopSelect .Add("@TopSelect", SqlDbType.Int).Value = TopSelect
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
.Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago .Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago
.Add("@Serie", SqlDbType.VarChar).Value = Serie
End With End With

View File

@@ -1337,7 +1337,7 @@ Public Class ClsOS
Return Retorno Return Retorno
End Function End Function
Public Function UpdateVentaOS(CveVenta As Integer, CveOS As Integer, Optional Paciente As String = "-1", Optional Episodio As String = "-1", Optional FolioAdicional As String = "") As Boolean Public Function UpdateVentaOS(CveVenta As Integer, CveOS As Integer, CveEmpresa As Integer, Optional Paciente As String = "-1", Optional Episodio As String = "-1", Optional FolioAdicional As String = "") As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_OS_UpdateVentaOS") DataAdapter("PA_OS_UpdateVentaOS")
@@ -1345,6 +1345,7 @@ Public Class ClsOS
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@CveOS", SqlDbType.Int).Value = CveOS .Add("@CveOS", SqlDbType.Int).Value = CveOS
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Paciente", SqlDbType.VarChar).Value = Paciente .Add("@Paciente", SqlDbType.VarChar).Value = Paciente
.Add("@Episodio", SqlDbType.VarChar).Value = Episodio .Add("@Episodio", SqlDbType.VarChar).Value = Episodio
.Add("@FolioAdicional", SqlDbType.VarChar).Value = FolioAdicional .Add("@FolioAdicional", SqlDbType.VarChar).Value = FolioAdicional
@@ -1361,6 +1362,28 @@ Public Class ClsOS
Return Retorno Return Retorno
End Function End Function
Public Function LiberarVentaOS(CveVenta As Integer, CveEmpresa As Integer, Optional CveOS As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OS_LiberarVentaOS")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@CveOS", SqlDbType.Int).Value = CveOS
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al guardar la venta en la Orden de Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetOrdenesServicioDevolucionMaterial(CveOS As Integer, CveVenta As Integer, Opcion As Integer, CveEmpresa As Integer) As Boolean Public Function GetOrdenesServicioDevolucionMaterial(CveOS As Integer, CveVenta As Integer, Opcion As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_OS_OrdenesServicioDevolucionMaterialGet") DataAdapter("PA_OS_OrdenesServicioDevolucionMaterialGet")

View File

@@ -1601,7 +1601,7 @@ Public Class ClsPaginas
Public Shared Property GlobalDTSubProyectosUsuarios(CveUsuario As Integer, CveProyecto As Integer, CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEstatus As Integer = -1) As DataTable Public Shared Property GlobalDTSubProyectosUsuarios(CveUsuario As Integer, CveProyecto As Integer, CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEstatus As Integer = -1) As DataTable
Get Get
Dim AppNombre As String = $"GlobalDTSubProyectosUsuarios-{CveEmpresa}" Dim AppNombre As String = $"GlobalDTSubProyectosUsuarios-{CveEmpresa}"
If HttpContext.Current.Application(AppNombre) Is Nothing Then If HttpContext.Current.Application(AppNombre) Is Nothing OrElse DirectCast(HttpContext.Current.Application(AppNombre), DataTable).Rows.Count = 0 Then
Dim ObjSubProyectos As New ClsSubProyectos() Dim ObjSubProyectos As New ClsSubProyectos()
If ObjSubProyectos.GetSubProyectosUsuarios(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjSubProyectos.DtResultados If ObjSubProyectos.GetSubProyectosUsuarios(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjSubProyectos.DtResultados
ObjSubProyectos.Dispose() ObjSubProyectos.Dispose()
@@ -1622,6 +1622,11 @@ Public Class ClsPaginas
Set(ByVal value As DataTable) Set(ByVal value As DataTable)
Dim AppNombre As String = $"GlobalDTSubProyectosUsuarios-{CveEmpresa}" Dim AppNombre As String = $"GlobalDTSubProyectosUsuarios-{CveEmpresa}"
HttpContext.Current.Application(AppNombre) = value HttpContext.Current.Application(AppNombre) = value
If value Is Nothing Then
Dim a As String = "Limpieza de :" & AppNombre & " - CveUsuario: " & CveUsuario & " - CveProyecto: " & CveProyecto & " - CveSubProyecto: " & CveSubProyecto
a.GuardaLog()
End If
End Set End Set
End Property End Property
Public Shared Property GlobalDTProyectosUsuarios(CveUsuario As Integer, CveProyecto As Integer, CveEmpresa As Integer, CveEstatus As Integer) As DataTable Public Shared Property GlobalDTProyectosUsuarios(CveUsuario As Integer, CveProyecto As Integer, CveEmpresa As Integer, CveEstatus As Integer) As DataTable
@@ -9194,7 +9199,7 @@ Public Class ClsPaginas
Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 312, 309) Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 312, 309)
Retorno.CveConceptoComplementario = If(CveTipoProveedorTipoDocto = 1, 206, 310) Retorno.CveConceptoComplementario = If(CveTipoProveedorTipoDocto = 1, 206, 310)
End Select End Select
Case 11 ' anticipos Case 11 ' anticipos proveedores/acreedores
Select Case CveMoneda Select Case CveMoneda
Case 1 'pesos Case 1 'pesos
Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 21, 56) Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 21, 56)
@@ -9202,7 +9207,7 @@ Public Class ClsPaginas
Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 339, 346) Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 339, 346)
Retorno.CveConceptoComplementario = If(CveTipoProveedorTipoDocto = 1, 340, 347) Retorno.CveConceptoComplementario = If(CveTipoProveedorTipoDocto = 1, 340, 347)
End Select End Select
Case 15 ' notas de crédito Case 15 ' notas de crédito proveedores/acreedores
Select Case CveMoneda Select Case CveMoneda
Case 1 'pesos Case 1 'pesos
Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 60, 324) Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 60, 324)
@@ -9234,6 +9239,14 @@ Public Class ClsPaginas
Retorno.CveConcepto = 92 'falta nuevo concepto Retorno.CveConcepto = 92 'falta nuevo concepto
Retorno.CveConceptoComplementario = 332 Retorno.CveConceptoComplementario = 332
End Select End Select
Case 12 ' anticipos de clientes
Select Case CveMoneda
Case 1 'pesos
Retorno.CveConcepto = 11
Case 2 'dólares
Retorno.CveConcepto = 296
Retorno.CveConceptoComplementario = 227
End Select
End Select End Select
Else 'cuando es la provisión Else 'cuando es la provisión
Select Case CveTipoSaldo Select Case CveTipoSaldo
@@ -9245,7 +9258,7 @@ Public Class ClsPaginas
Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 311, 306) Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 311, 306)
Retorno.CveConceptoComplementario = If(CveTipoProveedorTipoDocto = 1, 201, 307) Retorno.CveConceptoComplementario = If(CveTipoProveedorTipoDocto = 1, 201, 307)
End Select End Select
Case 11 ' anticipos Case 11 ' anticipos proveedores/acreedores
Select Case CveMoneda Select Case CveMoneda
Case 1 'pesos Case 1 'pesos
Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 10, 48) Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 10, 48)
@@ -9253,7 +9266,7 @@ Public Class ClsPaginas
Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 338, 345) Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 338, 345)
Retorno.CveConceptoComplementario = If(CveTipoProveedorTipoDocto = 1, 340, 347) Retorno.CveConceptoComplementario = If(CveTipoProveedorTipoDocto = 1, 340, 347)
End Select End Select
Case 15 ' notas de crédito Case 15 ' notas de crédito proveedores/acreedores
Select Case CveMoneda Select Case CveMoneda
Case 1 'pesos Case 1 'pesos
Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 18, 323) Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 18, 323)
@@ -9285,6 +9298,14 @@ Public Class ClsPaginas
Retorno.CveConcepto = 66 'falta nuevo concepto Retorno.CveConcepto = 66 'falta nuevo concepto
Retorno.CveConceptoComplementario = 332 Retorno.CveConceptoComplementario = 332
End Select End Select
Case 12 ' anticipos de clientes
Select Case CveMoneda
Case 1 'pesos
Retorno.CveConcepto = 3
Case 2 'dólares
Retorno.CveConcepto = 295
Retorno.CveConceptoComplementario = 226
End Select
End Select End Select
End If End If
@@ -10151,6 +10172,9 @@ Public Class ClsPaginas
PaginaDict.Add("/Contabilidad/RepEstadoResultadosHorizontal.aspx".ToUpper(), 420) PaginaDict.Add("/Contabilidad/RepEstadoResultadosHorizontal.aspx".ToUpper(), 420)
PaginaDict.Add("/Contabilidad/RepAnexoCatalogoMensualHorizontal.aspx".ToUpper(), -1) PaginaDict.Add("/Contabilidad/RepAnexoCatalogoMensualHorizontal.aspx".ToUpper(), -1)
PaginaDict.Add("/Contabilidad/CatBloqueoDiario.aspx".ToUpper(), 680) PaginaDict.Add("/Contabilidad/CatBloqueoDiario.aspx".ToUpper(), 680)
PaginaDict.Add("/Contabilidad/LibroMayor2.aspx".ToUpper(), -1)
#End Region #End Region
#Region "Contratos" #Region "Contratos"
'--------------------- C O N T R A T O S - P R E S U P U E S T O S --------------------- '--------------------- C O N T R A T O S - P R E S U P U E S T O S ---------------------
@@ -10798,7 +10822,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Ventas/RepComisionesSMS.aspx".ToUpper(), 1347) PaginaDict.Add("/Ventas/RepComisionesSMS.aspx".ToUpper(), 1347)
PaginaDict.Add("/Ventas/RepVencimientosCredito.aspx".ToUpper(), 146) PaginaDict.Add("/Ventas/RepVencimientosCredito.aspx".ToUpper(), 146)
PaginaDict.Add("/Ventas/CatMotivosDevoluciones.aspx".ToUpper(), 786) PaginaDict.Add("/Ventas/CatMotivosDevoluciones.aspx".ToUpper(), 786)
PaginaDict.Add("/Ventas/CatPSSubProyectosVendedores.aspx".ToUpper(), 787)
#End Region #End Region
#Region "Varios" #Region "Varios"

View File

@@ -1,5 +1,9 @@
Imports System.IO Imports System.IO
Imports System.Net
Imports Extensiones Imports Extensiones
Imports MailKit.Net.Smtp
Imports MailKit.Security
Imports MimeKit
Public Class ClsSisMail Public Class ClsSisMail
@@ -50,7 +54,7 @@ Public Class ClsSisMail
For Each ItemMail As ArchivoMail In Archivos For Each ItemMail As ArchivoMail In Archivos
If ItemMail IsNot Nothing Then If ItemMail IsNot Nothing Then
If ItemMail.Ruta <> "" AndAlso IO.File.Exists(ItemMail.Ruta) Then If ItemMail.Ruta <> "" AndAlso System.IO.File.Exists(ItemMail.Ruta) Then
ItemMail.ArchivoBinario = StreamFile(ItemMail.Ruta) ItemMail.ArchivoBinario = StreamFile(ItemMail.Ruta)
If ItemMail.NombreArchivo = "" Then ItemMail.NombreArchivo = Path.GetFileName(ItemMail.Ruta) If ItemMail.NombreArchivo = "" Then ItemMail.NombreArchivo = Path.GetFileName(ItemMail.Ruta)
ObjMail.Archivos.Add(ItemMail) ObjMail.Archivos.Add(ItemMail)
@@ -75,6 +79,104 @@ Public Class ClsSisMail
Return False Return False
End If End If
If ObjMail.ObjEmpresa.Soporte_Mail <> "" Then Return FinalSendOld(ObjMail)
Dim Retorno As Boolean = False
Dim MensajeLOG As New StringBuilder
MensajeLOG.AppendFormat("From:'{0}' - Para:'{1}' - Asunto:'{2}' - CCP: '{3}' - Adjuntos: {4}", ObjMail.ObjEmpresa.SendMail, ObjMail.Para, ObjMail.Asunto, ObjMail.CCP, If(ObjMail.Archivos IsNot Nothing, ObjMail.Archivos.Count, 0))
Try
Dim Correo As New MimeMessage()
Dim Mensaje As String = String.Empty
Dim ArrayPara() As String = ObjMail.Para.Replace(",", ";").Split(";"c)
Dim ArrayCCP() As String = ObjMail.CCP.Replace(",", ";").Split(";"c)
Dim ArrayBCC() As String = ObjMail.CCO.Replace(",", ";").Split(";"c)
If ObjMail.De = String.Empty Then
Correo.From.Add(New MailboxAddress(ObjMail.ObjEmpresa.SendMail, ObjMail.ObjEmpresa.SendMail))
Else
Correo.From.Add(New MailboxAddress(ObjMail.De, ObjMail.ObjEmpresa.SendMail))
End If
If ArrayPara IsNot Nothing AndAlso ArrayPara.Length > 0 Then
For Each CorreoPara As String In ArrayPara.Distinct
If IsMail(CorreoPara.Trim) Then Correo.To.Add(New MailboxAddress(CorreoPara.Trim, CorreoPara.Trim))
Next
End If
If ArrayCCP IsNot Nothing AndAlso ArrayCCP.Length > 0 Then
For Each CorreoCCPPara As String In ArrayCCP.Distinct
If IsMail(CorreoCCPPara.Trim) Then Correo.To.Add(New MailboxAddress(CorreoCCPPara.Trim, CorreoCCPPara.Trim))
Next
End If
If ArrayBCC IsNot Nothing AndAlso ArrayBCC.Length > 0 Then
For Each CorreoCCOPara As String In ArrayBCC.Distinct
If IsMail(CorreoCCOPara.Trim) Then Correo.Bcc.Add(New MailboxAddress(CorreoCCOPara.Trim, CorreoCCOPara.Trim))
Next
End If
Correo.Subject = ObjMail.Asunto
Dim builder As New BodyBuilder()
' Set the html version of the message text
builder.HtmlBody = Mensaje & ObjMail.Body
Correo.Body = New TextPart("html") With {.Text = Mensaje & ObjMail.Body}
'Correo.IsBodyHtml = True
'Correo.Priority = Net.Mail.MailPriority.Normal
If ObjMail.Archivos IsNot Nothing Then
For Each Item As ArchivoMail In ObjMail.Archivos
If Item.ArchivoBinario IsNot Nothing Then
builder.Attachments.Add(Item.NombreArchivo, New MemoryStream(Item.ArchivoBinario))
'Correo.Body.Attachments.Add(New MailKit.Attachment(Item.NombreArchivo, New MemoryStream(Item.ArchivoBinario)))
End If
Next
End If
' Now we just need to set the message body and we're done
Correo.Body = builder.ToMessageBody()
Try
Using SMTP As New SmtpClient()
SMTP.Connect(ObjMail.ObjEmpresa.SendMailServer, ObjMail.ObjEmpresa.SendMailPuerto, SecureSocketOptions.Auto)
SMTP.Authenticate(ObjMail.ObjEmpresa.SendMail, ObjMail.ObjEmpresa.SendMailPassword)
SMTP.Send(Correo)
SMTP.Disconnect(True)
End Using
Retorno = True
Catch ex As Exception
Retorno = False
MensajeLOG.AppendLine(" ")
MensajeLOG.AppendFormat(" - Ocurrió un error al mandar correo.{0}", ex)
End Try
ObjMail = Nothing 'destruyo el contenido
Correo.Dispose()
Catch ex As Exception
Retorno = False
MensajeLOG.AppendLine(" ")
MensajeLOG.AppendFormat(" - Ocurrió Cargar datos Correo.{0}", ex)
End Try
MensajeLOG.ToString().GuardaLogMail()
MensajeLOG.Clear()
Return Retorno
End Function
Private Function FinalSendOld(ObjMail As Mail) As Boolean
If ObjMail.Para = "" Then
Dim Msg As String = $"No se especifico a remitente - {ObjMail.Asunto}"
Msg.GuardaLogMail()
Return False
End If
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
Dim MensajeLOG As New StringBuilder Dim MensajeLOG As New StringBuilder

View File

@@ -454,7 +454,8 @@ Public Class ClsVentas
Optional CorreoNotificacion As String = "", Optional FormaPaqueteria As Integer = 1, Optional FacturarSucursal As Boolean = False, Optional VentaDesglosaIEPS As Boolean = False, Optional ServicioDomicilio As Boolean = False, Optional RFCReceptor As String = "", Optional Adjunto As String = "-1", Optional CorreoNotificacion As String = "", Optional FormaPaqueteria As Integer = 1, Optional FacturarSucursal As Boolean = False, Optional VentaDesglosaIEPS As Boolean = False, Optional ServicioDomicilio As Boolean = False, Optional RFCReceptor As String = "", Optional Adjunto As String = "-1",
Optional DevolucionImportePagado As Decimal = 0, Optional EsGarantia As Boolean = False, Optional CveLineaAdicional As Integer = -1, Optional DescripcionVenta As String = "", Optional DevolucionImportePagado As Decimal = 0, Optional EsGarantia As Boolean = False, Optional CveLineaAdicional As Integer = -1, Optional DescripcionVenta As String = "",
Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveTipoVenta As Integer = -1, Optional RequiereOS As Boolean = False, Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveTipoVenta As Integer = -1, Optional RequiereOS As Boolean = False,
Optional FechaParaSurtir As DateTime = MinFecha, Optional Paciente As String = "-1", Optional Episodio As String = "-1", Optional EsFacturaGlobal As Boolean = False, Optional CveSATPeriodicidad As Integer = -1, Optional CveSATMes As Integer = -1, Optional SATAnio As Integer = -1, Optional CveMotivoDevolucion As Integer = -1) As Boolean Optional FechaParaSurtir As DateTime = MinFecha, Optional Paciente As String = "-1", Optional Episodio As String = "-1", Optional EsFacturaGlobal As Boolean = False, Optional CveSATPeriodicidad As Integer = -1, Optional CveSATMes As Integer = -1, Optional SATAnio As Integer = -1, Optional CveMotivoDevolucion As Integer = -1,
Optional Addenda As String = "") As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_VentasAdd") DataAdapter("PA_VentasAdd")
@@ -569,6 +570,7 @@ Public Class ClsVentas
.Add("@SATAnio", SqlDbType.Int).Value = SATAnio .Add("@SATAnio", SqlDbType.Int).Value = SATAnio
.Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
.Add("@CveMotivoDevolucion", SqlDbType.Int).Value = CveMotivoDevolucion .Add("@CveMotivoDevolucion", SqlDbType.Int).Value = CveMotivoDevolucion
.Add("@Addenda", SqlDbType.VarChar).Value = Addenda
End With End With
'SqlTypes.SqlDateTime.Null 'SqlTypes.SqlDateTime.Null
Try Try
@@ -6322,7 +6324,7 @@ Public Class ClsVentas
End Function End Function
Public Function GetLineasAdicionalesVencimientos(CveCliente As Integer, TipoLinea As Integer, FechaInicio As Date, FechaFin As Date, CveMoneda As Integer, CveEmpresa As Integer) As Boolean Public Function GetLineasAdicionalesVencimientos(CveCliente As Integer, TipoLinea As Integer, FechaInicio As Date, FechaFin As Date, CveMoneda As Integer, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_LineasAdicionalesVencimientosGet") DataAdapter("PA_Vta_LineasAdicionalesVencimientosGet")
@@ -6332,6 +6334,7 @@ Public Class ClsVentas
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
.Add("@TipoLinea", SqlDbType.Int).Value = TipoLinea .Add("@TipoLinea", SqlDbType.Int).Value = TipoLinea
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With End With
Try Try
@@ -7425,6 +7428,60 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
#Region "PRODUCTOS/SERVICIOS, SUBPROYECTOS Y VENDEDORES"
Public Function GetPSSubProyectosVendedores(CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ProductosSubProyectosVendedoresGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los ps, subproyectos y vendedores.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function AddPSSubProyectosVendedores(CvePS As Integer, CveSubProyecto As Integer, CveVendedor As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ProductosSubProyectosVendedoresAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al guardar el ps, subproyecto y vendedor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function RemovePSSubProyectosVendedores(CvePS As Integer, CveSubProyecto As Integer, CveVendedor As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ProductosSubProyectosVendedoresRemove")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al eliminar el ps, subproyecto y vendedor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
#End Region
#Region "IDisposable Support" #Region "IDisposable Support"

View File

@@ -5,6 +5,7 @@ Imports System.Data
Imports System.IO Imports System.IO
Imports System.Net.Http Imports System.Net.Http
Imports System.Xml Imports System.Xml
Imports System.Xml.Serialization
Imports Extensiones Imports Extensiones
Imports Microsoft.Reporting.WebForms Imports Microsoft.Reporting.WebForms
@@ -401,6 +402,25 @@ Namespace Modelos
Public Property TipoFolio As String Public Property TipoFolio As String
Public Property Valido As Boolean Public Property Valido As Boolean
End Class
<Serializable(), System.Xml.Serialization.XmlRoot("REM")>
Public Class M_REM
<System.Xml.Serialization.XmlElement("NOS")>
Public Property NOS As String
<System.Xml.Serialization.XmlElement("OR")>
Public Property _OR As String
<System.Xml.Serialization.XmlElement("CLUES")>
Public Property CLUES As String
<System.Xml.Serialization.XmlElement("CONTRATO")>
Public Property CONTRATO As String
<System.Xml.Serialization.XmlElement("FEEX")>
Public Property FEEX As String
<System.Xml.Serialization.XmlElement("FEEN")>
Public Property FEEN As String
<System.Xml.Serialization.XmlElement("FERE")>
Public Property FERE As String
End Class End Class
Public Enum TipoMensajeRespuesta Public Enum TipoMensajeRespuesta
TextoLimpio = 0 TextoLimpio = 0
@@ -646,7 +666,7 @@ Namespace Modelos
ObjVentas.Dispose() ObjVentas.Dispose()
If Me.RealizarDevolucionAlmacen Then If Me.RealizarDevolucionAlmacen = 1 Then
Me.CveAlmacenDevolucion = Me.CveAlmacenDevolucionVenta Me.CveAlmacenDevolucion = Me.CveAlmacenDevolucionVenta
End If End If
@@ -2353,7 +2373,7 @@ Namespace Modelos
'Si viene de OS, Se guarda CveVenta en OS 'Si viene de OS, Se guarda CveVenta en OS
If CveOS > 0 Then If CveOS > 0 Then
If Not ObjOS.UpdateVentaOS(factura.CveVenta, CveOS) Then If Not ObjOS.UpdateVentaOS(factura.CveVenta, CveOS, UsuarioActual.CveEmpresa) Then
ErrorList.Add("Ocurrió un error al guardar la venta en Ordenes de Servicio") ErrorList.Add("Ocurrió un error al guardar la venta en Ordenes de Servicio")
End If End If
End If End If
@@ -5523,12 +5543,12 @@ Namespace Modelos
''' <param name="RealizarDevolucionAlmacen"></param> ''' <param name="RealizarDevolucionAlmacen"></param>
''' <param name="ListaRemisionesCancelar"></param> ''' <param name="ListaRemisionesCancelar"></param>
''' <returns></returns> ''' <returns></returns>
Public Function CancelarFactura(RealizarDevolucionAlmacen As Boolean, Optional ListaRemisionesCancelar As List(Of Integer) = Nothing, Optional CveMotivoCancelacion As Integer = -1, Optional Motivo As String = "", Optional ValidarSAT As Boolean = True, Optional CveEstadoCancelacion As Integer = 0, Optional CancelarBoletos As Boolean = False, Optional AplicaCancelacionConPagos As Boolean = False, Optional GeneraIxCconPago As Boolean = False) As MCancelacionVentaMensaje Public Function CancelarFactura(RealizarDevolucionAlmacen As Integer, Optional ListaRemisionesCancelar As List(Of Integer) = Nothing, Optional CveMotivoCancelacion As Integer = -1, Optional Motivo As String = "", Optional ValidarSAT As Boolean = True, Optional CveEstadoCancelacion As Integer = 0, Optional CancelarBoletos As Boolean = False, Optional AplicaCancelacionConPagos As Boolean = False, Optional GeneraIxCconPago As Boolean = False) As MCancelacionVentaMensaje
'Comprobante emitido con errores sin relación 'Comprobante emitido con errores sin relación
Return CancelarVenta(Me, Me.UsuarioActual, RealizarDevolucionAlmacen:=RealizarDevolucionAlmacen, ListaRemisionesCancelar:=ListaRemisionesCancelar, CveMotivoCancelacion:=CveMotivoCancelacion, MotivoCancelacion:=Motivo, CveEstadoCancelacion:=CveEstadoCancelacion, CancelarBoletos:=CancelarBoletos, AplicaCancelacionConPagos:=AplicaCancelacionConPagos, GeneraIxCconPago:=GeneraIxCconPago) Return CancelarVenta(Me, Me.UsuarioActual, RealizarDevolucionAlmacen:=RealizarDevolucionAlmacen, ListaRemisionesCancelar:=ListaRemisionesCancelar, CveMotivoCancelacion:=CveMotivoCancelacion, MotivoCancelacion:=Motivo, CveEstadoCancelacion:=CveEstadoCancelacion, CancelarBoletos:=CancelarBoletos, AplicaCancelacionConPagos:=AplicaCancelacionConPagos, GeneraIxCconPago:=GeneraIxCconPago)
End Function End Function
Private Function CancelarVenta(ObjFactura As Modelos.Factura, UsuarioActual As Usuario, Optional EsRefacturacion As Boolean = False, Optional RealizarDevolucionAlmacen As Boolean = False, Private Function CancelarVenta(ObjFactura As Modelos.Factura, UsuarioActual As Usuario, Optional EsRefacturacion As Boolean = False, Optional RealizarDevolucionAlmacen As Integer = 0,
Optional ListaRemisionesCancelar As List(Of Integer) = Nothing, Optional CveEstatusFacturaAsignado As Integer = -1, Optional FechaCancelacion As String = "-1", Optional ListaRemisionesCancelar As List(Of Integer) = Nothing, Optional CveEstatusFacturaAsignado As Integer = -1, Optional FechaCancelacion As String = "-1",
Optional AcuseCancelacion As String = "", Optional CveMotivoCancelacion As Integer = -1, Optional MotivoCancelacion As String = "", Optional AcuseCancelacion As String = "", Optional CveMotivoCancelacion As Integer = -1, Optional MotivoCancelacion As String = "",
Optional FolioSustitucion As String = "", Optional ValidarSAT As Boolean = True, Optional CveEstadoCancelacion As Integer = 0, Optional FolioSustitucion As String = "", Optional ValidarSAT As Boolean = True, Optional CveEstadoCancelacion As Integer = 0,
@@ -5684,7 +5704,7 @@ Namespace Modelos
Dim RevivirRemisiones As Boolean = Not EsRefacturacion AndAlso ((TieneRemisionesRelacionadas AndAlso ListaRemisionesCancelar Is Nothing) OrElse (DtRemisionesRelacionadas.Rows.Count > ListaRemisionesCancelar.Count)) Dim RevivirRemisiones As Boolean = Not EsRefacturacion AndAlso ((TieneRemisionesRelacionadas AndAlso ListaRemisionesCancelar Is Nothing) OrElse (DtRemisionesRelacionadas.Rows.Count > ListaRemisionesCancelar.Count))
'REMISION YA SE DEBE HACER POR EL PROCESO DE DEVOLUCION DE ALMACEN 'REMISION YA SE DEBE HACER POR EL PROCESO DE DEVOLUCION DE ALMACEN
If Not EsRefacturacion AndAlso (ObjFactura.SaldoAlmacen <> 0 AndAlso ObjFactura.EsDevolucionVenta.Contiene(0, 1)) AndAlso Not RealizarDevolucionAlmacen And RevivirRemisiones = False Then If Not EsRefacturacion AndAlso (ObjFactura.SaldoAlmacen <> 0 AndAlso ObjFactura.EsDevolucionVenta.Contiene(0, 1)) AndAlso Not (RealizarDevolucionAlmacen.Contiene(1, 2)) And RevivirRemisiones = False Then
Retorno.Mensaje = "La factura no se puede cancelar debido a que tiene movimientos de inventario." Retorno.Mensaje = "La factura no se puede cancelar debido a que tiene movimientos de inventario."
Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia
@@ -5995,6 +6015,7 @@ Namespace Modelos
Dim ObjEventos As New ClsOIEventos(ObjVentas.IniciaTransacSQL()) Dim ObjEventos As New ClsOIEventos(ObjVentas.IniciaTransacSQL())
Dim ObjAcum As New ClsAcumuladores(ObjVentas.IniciaTransacSQL()) Dim ObjAcum As New ClsAcumuladores(ObjVentas.IniciaTransacSQL())
Dim ObjClientes As New ClsClientes(ObjVentas.IniciaTransacSQL()) Dim ObjClientes As New ClsClientes(ObjVentas.IniciaTransacSQL())
Dim ObjOS As New ClsOS(ObjVentas.IniciaTransacSQL())
Try Try
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
@@ -6128,7 +6149,7 @@ Namespace Modelos
If Not ErrorCancelar AndAlso TieneSalida Then If Not ErrorCancelar AndAlso TieneSalida Then
If Not ErrorCancelar AndAlso RealizarDevolucionAlmacen Then If Not ErrorCancelar AndAlso RealizarDevolucionAlmacen = 1 Then
'REALIZA DEVOLUCION A LAS SALIDAS PENDIENTES 'REALIZA DEVOLUCION A LAS SALIDAS PENDIENTES
If Not ObjFactura.TipoDocto.Contiene("Rem", "Ped") Then If Not ObjFactura.TipoDocto.Contiene("Rem", "Ped") Then
For Each RowMovimiento As DataRow In DtSalidas.Rows For Each RowMovimiento As DataRow In DtSalidas.Rows
@@ -6278,7 +6299,7 @@ Namespace Modelos
End If End If
'AGREGA BITACORA A VENTA 'AGREGA BITACORA A VENTA
If Not ErrorCancelar AndAlso RealizarDevolucionAlmacen AndAlso CveMovimientoDevolucion > 0 Then If Not ErrorCancelar AndAlso RealizarDevolucionAlmacen = 1 AndAlso CveMovimientoDevolucion > 0 Then
Dim MensajeBitacora As String = "Devuelta" Dim MensajeBitacora As String = "Devuelta"
If Not ObjEventos.AddEventoBitacora(String.Format("Venta {2} en Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovimientoDevolucion, Folio, MensajeBitacora), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) Then If Not ObjEventos.AddEventoBitacora(String.Format("Venta {2} en Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovimientoDevolucion, Folio, MensajeBitacora), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) Then
MensajeError = "Ocurrió un error al agregar la bitacora." MensajeError = "Ocurrió un error al agregar la bitacora."
@@ -6443,7 +6464,7 @@ Namespace Modelos
End If End If
'CANCELACION DE MOVIMIENTOS DE REMISION, PEDIDOS 'CANCELACION DE MOVIMIENTOS DE REMISION, PEDIDOS
If Not ErrorCancelar AndAlso ObjFactura.TipoDocto.Contiene("Rem", "Ped") AndAlso RealizarDevolucionAlmacen AndAlso ObjFactura.SaldoAlmacen <> 0 Then If Not ErrorCancelar AndAlso ObjFactura.TipoDocto.Contiene("Rem", "Ped") AndAlso RealizarDevolucionAlmacen = 1 AndAlso ObjFactura.SaldoAlmacen <> 0 Then
Dim CveMovimientoUsado As Integer = -1 Dim CveMovimientoUsado As Integer = -1
Dim CveAlmacenUsado As Integer = 0 Dim CveAlmacenUsado As Integer = 0
Dim CveAlmacenGeneral As Integer = 0 Dim CveAlmacenGeneral As Integer = 0
@@ -6547,7 +6568,7 @@ Namespace Modelos
'EMPRESA HOSPITALARIA - SI ES PEDIDO LA DEVOLUCION SE DEBE HACER DESPUES DE CANCELAR EL PEDIDO 'EMPRESA HOSPITALARIA - SI ES PEDIDO LA DEVOLUCION SE DEBE HACER DESPUES DE CANCELAR EL PEDIDO
If Not ErrorCancelar AndAlso UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso ObjFactura.TipoDocto = "Ped" Then If Not ErrorCancelar AndAlso UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso ObjFactura.TipoDocto = "Ped" Then
If Not RealizarDevolucionAlmacen AndAlso TieneAlmacen Then If Not RealizarDevolucionAlmacen = 1 AndAlso TieneAlmacen Then
If Not ObjInventario.ActualizarEsDevolucionVenta(ObjFactura.CveVenta, 1, AplicaDevolucionCompleta:=True) Then If Not ObjInventario.ActualizarEsDevolucionVenta(ObjFactura.CveVenta, 1, AplicaDevolucionCompleta:=True) Then
ErrorCancelar = True ErrorCancelar = True
MensajeError = "No se pudo actualizar el estatus de almacen del pedido" MensajeError = "No se pudo actualizar el estatus de almacen del pedido"
@@ -6556,6 +6577,8 @@ Namespace Modelos
End If End If
End If End If
'CANCELA CONTRATOS 'CANCELA CONTRATOS
If Not ErrorCancelar Then If Not ErrorCancelar Then
If ObjFactura.CveContrato > 0 AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Ant") Then If ObjFactura.CveContrato > 0 AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Ant") Then
@@ -6613,6 +6636,16 @@ Namespace Modelos
End If End If
End If End If
'EMPRESA HOSPITALARIA - SI SE CANCELA UNA REMISIÓN DEBE DE DESVINCULARSE DE LA OS y retornarle el estatus en proceso
If Not ErrorCancelar AndAlso UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso ObjFactura.TipoDocto = "Rem" Then
If Not ObjOS.LiberarVentaOS(ObjFactura.CveVenta, UsuarioActual.CveEmpresa) Then
ErrorCancelar = True
MensajeError = "No se pudo actualizar el estatus de almacen del pedido"
End If
End If
'POLIZA DE CANCELACION 'POLIZA DE CANCELACION
'If Not ErrorCancelar Then 'If Not ErrorCancelar Then
' If UsuarioActual.Empresa.UsaAC Then ' If UsuarioActual.Empresa.UsaAC Then
@@ -6665,6 +6698,7 @@ Namespace Modelos
If Not ObjVentas.UpdateEstatusOCRelacionada(ObjFactura.CveVenta, CveEstatusCancelacion, ObjFactura.CveEmpresa) Then If Not ObjVentas.UpdateEstatusOCRelacionada(ObjFactura.CveVenta, CveEstatusCancelacion, ObjFactura.CveEmpresa) Then
ErrorCancelar = True ErrorCancelar = True
MensajeError = "Ocurrió un error al cancelar la orden de servicio" MensajeError = "Ocurrió un error al cancelar la orden de servicio"
else
End If End If
End If End If
End If End If
@@ -6673,12 +6707,14 @@ Namespace Modelos
'MARCA LA VENTA PARA REALIZAR LA DEVOLUCION POSTERIORMENTE 'MARCA LA VENTA PARA REALIZAR LA DEVOLUCION POSTERIORMENTE
If Not ErrorCancelar Then If Not ErrorCancelar Then
If RealizarDevolucionAlmacen AndAlso CveAlmacenDevolucion > 0 Then
If Not ObjVentas.UpdateVentaRealizarDevolucion(CveVenta, RealizarDevolucionAlmacen, CveAlmacenDevolucion) Then If RealizarDevolucionAlmacen = 1 AndAlso CveAlmacenDevolucion > 0 Then
If Not ObjVentas.UpdateVentaRealizarDevolucion(CveVenta, True, CveAlmacenDevolucion) Then
ErrorCancelar = True ErrorCancelar = True
MensajeError = "Ocurrió un error al marcar la venta para devolución" MensajeError = "Ocurrió un error al marcar la venta para devolución"
End If End If
End If End If
End If End If
'ACTUALIZA ESTATUS 'ACTUALIZA ESTATUS
@@ -7080,13 +7116,14 @@ Namespace Modelos
Dim CveMovimientoEntradaDevRem As Integer = 0 Dim CveMovimientoEntradaDevRem As Integer = 0
Dim FolioMovimientoEntradaDevRem As Integer = 0 Dim FolioMovimientoEntradaDevRem As Integer = 0
Dim Fecha As DateTime = ClsPaginas.NowADS() Dim Fecha As DateTime = ClsPaginas.NowADS()
Dim tCveOS As Integer = DtMovDetalle.MAX("CveOS").ToEntero
'SALIDA DE (ENTREGA POR ADELANTADO) 'SALIDA DE (ENTREGA POR ADELANTADO)
CveMovimientoSalidaDevRem = ObjInventario.AddMovimiento(CveAlmacen, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveRemision, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveAlmacenDestino:=CveAlmacenDestino, Modulo:="Mod/CancExAR1") CveMovimientoSalidaDevRem = ObjInventario.AddMovimiento(CveAlmacen, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveRemision, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveAlmacenDestino:=CveAlmacenDestino, Modulo:="Mod/CancExAR1", CveOS:=tCveOS)
FolioMovimientoSalidaDevRem = ObjInventario.Folio FolioMovimientoSalidaDevRem = ObjInventario.Folio
'ENTRADA A (ALMACEN GENERAL) 'ENTRADA A (ALMACEN GENERAL)
CveMovimientoEntradaDevRem = ObjInventario.AddMovimiento(CveAlmacenDestino, 9, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveRemision, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalidaDevRem, CveAlmacenDestino:=CveAlmacenDestino, Modulo:="Mod/CancExAR2") CveMovimientoEntradaDevRem = ObjInventario.AddMovimiento(CveAlmacenDestino, 9, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveRemision, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalidaDevRem, CveAlmacenDestino:=CveAlmacenDestino, Modulo:="Mod/CancExAR2", CveOS:=tCveOS)
FolioMovimientoEntradaDevRem = ObjInventario.Folio FolioMovimientoEntradaDevRem = ObjInventario.Folio
If Not (CveMovimientoSalidaDevRem > 0 And CveMovimientoEntradaDevRem > 0) Then If Not (CveMovimientoSalidaDevRem > 0 And CveMovimientoEntradaDevRem > 0) Then
@@ -7628,7 +7665,7 @@ Namespace Modelos
Public Property TipoDocto As String Public Property TipoDocto As String
Public Property TipoComprobante As String Public Property TipoComprobante As String
Public Property RefDocto As String = "" Public Property RefDocto As String = ""
Public Property RealizarDevolucionAlmacen As Boolean Public Property RealizarDevolucionAlmacen As Integer
Public Property CveAlmacenDevolucionVenta As Integer Public Property CveAlmacenDevolucionVenta As Integer
Public Property TipoDocumento As String Public Property TipoDocumento As String
@@ -8020,6 +8057,7 @@ Namespace Modelos
Public Property CveMotivoCancelacion As Integer = -1 Public Property CveMotivoCancelacion As Integer = -1
Public Property MotivoCancelacion As String = "" Public Property MotivoCancelacion As String = ""
Public Property TipoContable As Integer = -1 Public Property TipoContable As Integer = -1
Public Property Addenda As String = ""
#End Region #End Region

View File

@@ -1949,7 +1949,7 @@ Public Class Timbrado
End If End If
Dim nsComp As New System.Xml.Serialization.XmlSerializerNamespaces() Dim nsComp As New System.Xml.Serialization.XmlSerializerNamespaces()
nsComp.Add("cartaporte20", "http://www.sat.gob.mx/CartaPorte20") nsComp.Add("cartaporte31", "http://www.sat.gob.mx/CartaPorte31")
Dim xmlComp As String = Profact.TimbraCFDI.XMLUtilerias.SerializaObjeto(ComCartaPorte, GetType(ProfactCartaPorte.CartaPorte), nsComp) Dim xmlComp As String = Profact.TimbraCFDI.XMLUtilerias.SerializaObjeto(ComCartaPorte, GetType(ProfactCartaPorte.CartaPorte), nsComp)
Dim docComp As New XmlDocument() Dim docComp As New XmlDocument()
docComp.LoadXml(xmlComp) docComp.LoadXml(xmlComp)
@@ -2237,6 +2237,13 @@ Public Class Timbrado
GeneraAddendaFord(RutaCadena, FolioFactura, Ventas.FordASN, Ventas.FordGSDB) GeneraAddendaFord(RutaCadena, FolioFactura, Ventas.FordASN, Ventas.FordGSDB)
End If End If
'Si tiene una addenda personalizada, agregarla al xml
If Not String.IsNullOrEmpty(Ventas.Addenda) Then
Dim RutaCadena As String = String.Format("{0}{1}.xml", RutaArchivo, NombreArchivoXML)
GeneraAddenda(RutaCadena, Ventas.Addenda)
End If
End If End If
End Select End Select
'---------------------- '----------------------
@@ -2554,12 +2561,13 @@ concep.DescripcionesEspecificas.NumeroSerie)
''DATOS GENERALES ''DATOS GENERALES
cfdi.CartaPorte31("", Carta.TranspInternac, Carta.EntradaSalidaMercancia, Carta.PaisOrigenDestino, Carta.ViaEntradaSalida, Carta.TotalDistanciaRecorrida, Carta.RegistroISTMO, Carta.UbicacionPoloOrigen, Carta.UbicacionPoloDestino) cfdi.CartaPorte31("", Carta.TranspInternac, Carta.EntradaSalidaMercancia, Carta.PaisOrigenDestino, Carta.ViaEntradaSalida, Carta.TotalDistanciaRecorrida, Carta.RegistroISTMO, Carta.UbicacionPoloOrigen, Carta.UbicacionPoloDestino)
If Carta.RegimenAduanero <> "" Then cfdi.CartaPorte31RegimenAduaneroCCP(Carta.RegimenAduanero)
'UBICACIONES 'UBICACIONES
If Carta.Ubicaciones IsNot Nothing AndAlso Carta.Ubicaciones.Count > 0 Then If Carta.Ubicaciones IsNot Nothing AndAlso Carta.Ubicaciones.Count > 0 Then
For Each ubica As CFDICartaPorteUbicacion In Carta.Ubicaciones For Each ubica As CFDICartaPorteUbicacion In Carta.Ubicaciones
'origen 'origen
cfdi.CartaPorte31Ubicacion(ubica.TipoUbicacion, ubica.IDUbicacion, ubica.RFCRemitenteDestinatario, ubica.NombreRemitenteDestinatario, ubica.NumRegIdTrib, ubica.ResidenciaFiscal, ubica.NumEstacion, ubica.NombreEstacion, ubica.NavegacionTrafico, ubica.FechaHoraSalidaLlegada, ubica.TipoEstacion, ubica.DistanciaRecorrida) cfdi.CartaPorte31Ubicacion(ubica.TipoUbicacion, ubica.IDUbicacion, ubica.RFCRemitenteDestinatario, ubica.NombreRemitenteDestinatario, ubica.NumRegIdTrib, ubica.ResidenciaFiscal, ubica.NumEstacion, ubica.NombreEstacion, ubica.NavegacionTrafico, ubica.FechaHoraSalidaLlegada, ubica.TipoEstacion, ubica.DistanciaRecorrida)
'cfdi.CartaPorteOrigen(ubica.Origen.IDOrigen, ubica.Origen.RFCRemitente, ubica.Origen.NombreRemitente, ubica.NumRegIdTrib, ubica.Origen.ResidenciaFiscal, ubica.Origen.NumEstacion, ubica.Origen.NombreEstacion, ubica.Origen.NavegacionTrafico, ubica.Origen.FechaHoraSalida)
cfdi.CartaPorte31Domicilio(ubica.Domicilio.Calle, ubica.Domicilio.NumeroExterior, ubica.Domicilio.NumeroInterior, ubica.Domicilio.Colonia, ubica.Domicilio.Localidad, ubica.Domicilio.Referencia, ubica.Domicilio.Municipio, ubica.Domicilio.Estado, ubica.Domicilio.Pais, ubica.Domicilio.CP) cfdi.CartaPorte31Domicilio(ubica.Domicilio.Calle, ubica.Domicilio.NumeroExterior, ubica.Domicilio.NumeroInterior, ubica.Domicilio.Colonia, ubica.Domicilio.Localidad, ubica.Domicilio.Referencia, ubica.Domicilio.Municipio, ubica.Domicilio.Estado, ubica.Domicilio.Pais, ubica.Domicilio.CP)
Next Next
End If End If
@@ -3012,6 +3020,12 @@ concep.DescripcionesEspecificas.NumeroSerie)
End If End If
'Si tiene una addenda personalizada, agregarla al xml
If Not String.IsNullOrEmpty(Ventas.Addenda) Then
Dim RutaCadena As String = String.Format("{0}{1}.xml", RutaArchivo, NombreArchivoXML)
GeneraAddenda(RutaCadena, Ventas.Addenda)
End If
End If End If
End Select End Select
@@ -3287,6 +3301,12 @@ concep.DescripcionesEspecificas.NumeroSerie)
End If End If
'Si tiene una addenda personalizada, agregarla al xml
If Not String.IsNullOrEmpty(Ventas.Addenda) Then
Dim RutaCadena As String = String.Format("{0}{1}.xml", RutaArchivo, NombreArchivoXML)
GeneraAddenda(RutaCadena, Ventas.Addenda)
End If
End If End If
End Select End Select
@@ -3501,7 +3521,7 @@ concep.DescripcionesEspecificas.NumeroSerie)
End Using End Using
End Sub End Sub
Private Sub GeneraAddendaFord(Archivo As String, pFolio As String, LstFordASN As ListBox, FordGSDBM As String) Private Sub GeneraAddenda(Archivo As String, Addenda As String)
Dim cfdi As String = "" Dim cfdi As String = ""
Dim SB As New StringBuilder Dim SB As New StringBuilder
Try Try
@@ -3512,28 +3532,13 @@ concep.DescripcionesEspecificas.NumeroSerie)
End Using End Using
Catch e As Exception Catch e As Exception
Alert("The file could not be read:", TipoMensaje.MsgError) Alert("The file could not be read:", TipoMensaje.MsgError)
End Try End Try
cfdi = cfdi.Replace("</cfdi:Comprobante>", "") cfdi = cfdi.Replace("</cfdi:Comprobante>", "")
SB.Append(cfdi) SB.Append(cfdi)
SB.AppendFormat("{0}", Addenda)
SB.Append("<cfdi:Addenda><fomadd:addenda xmlns:fomadd="" http://www.ford.com.mx/cfdi/addenda"" xsi:schemaLocation=""http://www.ford.com.mx/cfdi/addenda http://www.ford.com.mx/cfdi/addenda/cfdiAddendaFord_1_0.xsd"">") SB.Append("</cfdi:Comprobante>")
SB.AppendFormat("<fomadd:FOMASN version="" 1.0""><fomadd:GSDB>{0}</fomadd:GSDB>", FordGSDBM.Trim.ToUpper)
If pFolio <> "" Then SB.AppendFormat("<fomadd:ASN>{0}</fomadd:ASN>", pFolio)
'If TxtFordASN2.Text.Trim <> "" Then SB.AppendFormat("<fomadd:ASN>{0}</fomadd:ASN>", TxtFordASN2.Text.Trim)
For Each li As ListItem In LstFordASN.Items
SB.AppendFormat("<fomadd:ASN>{0}</fomadd:ASN>", li.Text)
Next
SB.Append("</fomadd:FOMASN></fomadd:addenda></cfdi:Addenda></cfdi:Comprobante>")
Using outfile As New StreamWriter(Archivo) Using outfile As New StreamWriter(Archivo)
outfile.Write(SB.ToString()) outfile.Write(SB.ToString())

View File

@@ -307,7 +307,7 @@ Public Class Timbres
.ClaveUnidad = drr("SATClaveUM").ToString, .ClaveUnidad = drr("SATClaveUM").ToString,
.Unidad = drr("UM").ToString, .Unidad = drr("UM").ToString,
.Dimensiones = drr("Dimensiones").ToString, .Dimensiones = drr("Dimensiones").ToString,
.PesoenKg = drr("PesoKg").ToString.ToDecimal * drr("Cantidad").ToString.ToDecimal, .PesoenKg = (drr("PesoKg").ToString.ToDecimal * drr("Cantidad").ToString.ToDecimal).RoundSQL(3),
.MaterialPeligroso = If(drr("ClaveMaterialPeligroso").ToString <> "", "Sí", ""), .MaterialPeligroso = If(drr("ClaveMaterialPeligroso").ToString <> "", "Sí", ""),
.ClaveMaterialPeligroso = drr("ClaveMaterialPeligroso").ToString, .ClaveMaterialPeligroso = drr("ClaveMaterialPeligroso").ToString,
.Embalaje = drr("ClaveEmbalaje").ToString, .Embalaje = drr("ClaveEmbalaje").ToString,
@@ -337,7 +337,7 @@ Public Class Timbres
.TipoMateriaDescripcion = drr("TipoMateria").ToString .TipoMateriaDescripcion = drr("TipoMateria").ToString
} }
Dim DetalleMercancia As New CFDICartaPorteMercanciaDetalleMercancia With {.PesoNeto = drr("PesoKg").ToString.ToDecimal * drr("Cantidad").ToString.ToDecimal, .NumPiezas = drr("Cantidad").ToString.ToEntero} Dim DetalleMercancia As New CFDICartaPorteMercanciaDetalleMercancia With {.PesoNeto = (drr("PesoKg").ToString.ToDecimal * drr("Cantidad").ToString.ToDecimal).RoundSQL(3), .NumPiezas = drr("Cantidad").ToString.ToEntero}
conceptoCarta.DetalleMercancia = DetalleMercancia conceptoCarta.DetalleMercancia = DetalleMercancia
Dim MercanciaTransporta As New CFDICartaPorteMercanciaTransporta With {.Cantidad = drr("Cantidad").ToString.ToDecimal, .IDOrigen = "OR000001", .IDDestino = "DE000001"} Dim MercanciaTransporta As New CFDICartaPorteMercanciaTransporta With {.Cantidad = drr("Cantidad").ToString.ToDecimal, .IDOrigen = "OR000001", .IDDestino = "DE000001"}

View File

@@ -555,6 +555,7 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
cevent.id = dr("CveContrato").ToString.ToEntero cevent.id = dr("CveContrato").ToString.ToEntero
cevent.title = If(dr("CodigoAF").ToString.Trim.Length > 0, $"#{dr("CodigoAF").ToString}-{dr("DescripcionContrato").ToString}", $"-{dr("DescripcionContrato").ToString}") cevent.title = If(dr("CodigoAF").ToString.Trim.Length > 0, $"#{dr("CodigoAF").ToString}-{dr("DescripcionContrato").ToString}", $"-{dr("DescripcionContrato").ToString}")
cevent.description = dr("DescripcionContrato").ToString
cevent.start = String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime) cevent.start = String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime)
cevent.end = If(tipoVista = "fecha", String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime.AddHours(1)), String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime)) cevent.end = If(tipoVista = "fecha", String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime.AddHours(1)), String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime))
cevent.FechaFinal = String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime) cevent.FechaFinal = String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime)

View File

@@ -811,6 +811,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Dim retorno As String = "" Dim retorno As String = ""
Dim DtRetorno As DataTable = Nothing Dim DtRetorno As DataTable = Nothing
Dim Estatus = IfNull(context.Request("estatus"), "-1").ToString.ToEntero Dim Estatus = IfNull(context.Request("estatus"), "-1").ToString.ToEntero
Dim filtro As String = "" Dim filtro As String = ""
@@ -823,7 +824,6 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
filtro = " Estatus = 'Inactivo' " filtro = " Estatus = 'Inactivo' "
End If End If
Dim usuario As Usuario = UsuarioActual(context) Dim usuario As Usuario = UsuarioActual(context)
Dim CveEmpresa As Integer Dim CveEmpresa As Integer
If IsNothing(usuario) Then If IsNothing(usuario) Then
@@ -998,6 +998,12 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
End If End If
If usuario.Empresa.Funcionalidad(578) = "1" AndAlso DtPSRetorno IsNot Nothing Then
'solo muestar productos con existencia.
DtPSRetorno = DtPSRetorno.FiltraParametros("ExistenciaTotal > 0")
End If
If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Columns("ExistenciaTotal") IsNot Nothing Then DtPSRetorno.Columns.Remove("ExistenciaTotal")
If UsaGlobal Then If UsaGlobal Then
'se recarga el global, y el clspaginas, son los unicos 2 lugares 'se recarga el global, y el clspaginas, son los unicos 2 lugares
'Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa) 'Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)
@@ -1717,7 +1723,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
ObjFacturaCancelacion.CveAlmacenDevolucion = CveAlmacenDevolucion ObjFacturaCancelacion.CveAlmacenDevolucion = CveAlmacenDevolucion
If ObjFacturaCancelacion.TipoDocto = "Rem" Then If ObjFacturaCancelacion.TipoDocto = "Rem" Then
Dim respuesta = ObjFacturaCancelacion.CancelarFactura(True, New List(Of Integer)) Dim respuesta = ObjFacturaCancelacion.CancelarFactura(1, New List(Of Integer))
If respuesta IsNot Nothing Then If respuesta IsNot Nothing Then
retorno = JsonConvert.SerializeObject(respuesta) retorno = JsonConvert.SerializeObject(respuesta)
End If End If

View File

@@ -345,9 +345,6 @@ Partial Class Bancos_PopIEVentas
CargaTipoTransaccion(TipoTransaccion) CargaTipoTransaccion(TipoTransaccion)
CargaCuentas() CargaCuentas()
Dim dia As Integer = If(UsuarioActual.CveEmpresa = 13, NowADS().Day - 1, NowADS().Day) Dim dia As Integer = If(UsuarioActual.CveEmpresa = 13, NowADS().Day - 1, NowADS().Day)
Fecha = (dia.ToString + "/" + NowADS().Month.ToString + "/" + NowADS().Year.ToString).ToDate Fecha = (dia.ToString + "/" + NowADS().Month.ToString + "/" + NowADS().Year.ToString).ToDate
@@ -1231,7 +1228,6 @@ Partial Class Bancos_PopIEVentas
If CveVenta > 0 Then If CveVenta > 0 Then
If VentaActual IsNot Nothing Then If VentaActual IsNot Nothing Then
Dim tipoCambioPago As Decimal = 1
Dim CuentasContablesInvalidas As New StringBuilder Dim CuentasContablesInvalidas As New StringBuilder
Dim tFecha As Date = TxtFechaDocumento.Text.ToDate Dim tFecha As Date = TxtFechaDocumento.Text.ToDate
@@ -1250,7 +1246,7 @@ Partial Class Bancos_PopIEVentas
'Pago.TCPago = 1 / TxtTipoCambio.Text.ToDecimal 'Pago.TCPago = 1 / TxtTipoCambio.Text.ToDecimal
ImportePagadoVenta = (ImportePagado / TxtTipoCambio.Text.ToDecimal).RoundSQL ImportePagadoVenta = (ImportePagado / TxtTipoCambio.Text.ToDecimal).RoundSQL
ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES
Pago.TCPago = TxtTipoCambio.Text.ToDecimal Pago.TCPago = TxtTCDolaresDolares.Text.ToDecimal
ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES
Pago.TCPago = TxtTipoCambio.Text.ToDecimal Pago.TCPago = TxtTipoCambio.Text.ToDecimal
End If End If
@@ -1261,7 +1257,7 @@ Partial Class Bancos_PopIEVentas
Select Case RBLContado.SelectedValue Select Case RBLContado.SelectedValue
Case "1" ' Banco 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, "", CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, Fecha, TxtFolio.Text.Trim, TxtPagueseA.Text.Trim, ImportePagado, CveMoneda, Pago.TCPago, TxtObservaciones.Text.Trim, "",
True, True, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1), CveCuentaDeposito:=CveCuentaDeposito, 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, FechaEmision:=FechaEmision) Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"), CveCorte:=CveCorte, FechaEmision:=FechaEmision)
If CveIE > 0 Then If CveIE > 0 Then

Binary file not shown.

Binary file not shown.

BIN
Bin/MailKit.dll Normal file

Binary file not shown.

62241
Bin/MailKit.xml Normal file

File diff suppressed because it is too large Load Diff

BIN
Bin/MimeKit.dll Normal file

Binary file not shown.

View File

@@ -1266,7 +1266,7 @@
<asp:UpdatePanel ID="UpInv" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpInv" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvInv" runat="server" DataKeyNames="Total,PU,Cantidad,CvePS" AutoGenerateColumns="false" GridLines="None" EmptyDataText="Aun no hay registros." <asp:GridView ID="GvInv" runat="server" DataKeyNames="Total,PU,Cantidad,CvePS,Descuento" AutoGenerateColumns="false" GridLines="None" EmptyDataText="Aun no hay registros."
ShowHeaderWhenEmpty="True" CssClass="table table-striped table-hover Widthall mysmallbtn" Visible="false"> ShowHeaderWhenEmpty="True" CssClass="table table-striped table-hover Widthall mysmallbtn" Visible="false">
<Columns> <Columns>
<asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">

View File

@@ -2290,6 +2290,28 @@ Partial Class Compras_Compras
Alert("El xml no contiene la etiqueta 'método de pago', favor de verificar la emisión con el proveedor.", TipoMensaje.MsgAdvertencia) Alert("El xml no contiene la etiqueta 'método de pago', favor de verificar la emisión con el proveedor.", TipoMensaje.MsgAdvertencia)
BtnGuardar.Visible = False BtnGuardar.Visible = False
End If End If
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
For Each item As DataRow In TmpDT.Rows
Dim EquivalenciaBase = GlobalDTProductosServiciosEquivalencias(item("CvePS").ToString().ToEntero(), -1, UsuarioActual.CveEmpresa).FiltroPrimero("UnidadBase = 1")
If EquivalenciaBase IsNot Nothing Then
If item("CveUM").ToString() <> EquivalenciaBase("CveUM").ToString() Then
Dim EquivalenciaACambiar = GlobalDTProductosServiciosEquivalencias(item("CvePS").ToString().ToEntero(), item("CveUM").ToString().ToEntero(), UsuarioActual.CveEmpresa).FiltroPrimero("")
If EquivalenciaACambiar IsNot Nothing Then
Dim Cantidad As Decimal = Math.Round(item("Cantidad").ToString().ToDecimal() / EquivalenciaACambiar("Cantidad").ToString().ToDecimal(), 6)
Dim PU As Decimal = Math.Round((item("Total").ToString().ToDecimal() + item("Descuento").ToString().ToDecimal()) / Cantidad, 6)
item("Cantidad") = Cantidad
item("PU") = PU
End If
item("CveUM") = EquivalenciaBase("CveUM")
item("UM") = EquivalenciaBase("UM")
End If
End If
Next
GvPS.DataSource = TmpDT
GvPS.DataBind()
UpPS.Update()
End If
End If End If
Else Else
Alert("No se Encontró la Factura", TipoMensaje.MsgAdvertencia) Alert("No se Encontró la Factura", TipoMensaje.MsgAdvertencia)
@@ -6430,7 +6452,8 @@ Partial Class Compras_Compras
For Each gvRowInv As GridViewRow In GvInv.Rows For Each gvRowInv As GridViewRow In GvInv.Rows
Dim gvCantidad As Decimal = gvRowInv.FCTextBox("TbCantidad").Text.ToDecimal Dim gvCantidad As Decimal = gvRowInv.FCTextBox("TbCantidad").Text.ToDecimal
Dim gvPU As Decimal = gvRowInv.DataKey("PU").ToDecimal Dim gvPU As Decimal = gvRowInv.DataKey("PU").ToDecimal
ImpPrepoliza = ImpPrepoliza + (gvCantidad * gvPU) Dim gvDescuento As Decimal = gvRowInv.DataKey("Descuento").ToDecimal
ImpPrepoliza = ImpPrepoliza + ((gvCantidad * gvPU)) - gvDescuento
Next Next
ImpPrepolizaMN = ImpPrepoliza * tipoCambioActual * Multiplicador ImpPrepolizaMN = ImpPrepoliza * tipoCambioActual * Multiplicador
@@ -6704,25 +6727,37 @@ Partial Class Compras_Compras
End If End If
Next Next
Dim importeMNTemp As Decimal = 0
Dim CveCompraAmortizacion As Integer = -1
For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows
If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then
Dim importeMNTemp As Decimal = 0
If Not ObjCompras.ComprasDetalleDevolucionesAdd(Gvr.DataKey("CveCompraDetalle").ToEntero, CveCompra, Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble, UsuarioActual.CveEmpresa) Then If Not ObjCompras.ComprasDetalleDevolucionesAdd(Gvr.DataKey("CveCompraDetalle").ToEntero, CveCompra, Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble, UsuarioActual.CveEmpresa) Then
ErrorMovInv = True ErrorMovInv = True
Exit For Exit For
End If End If
Dim DifTC As Decimal = tipoCambioActual - Gvr.DataKey("TipoCambio").ToDecimal ' Dim DifTC As Decimal = tipoCambioActual - Gvr.DataKey("TipoCambio").ToDecimal
'diferenciaTransito = DifTC * (Gvr.DataKey("IVA").ToDecimal / Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal) 'diferenciaTransito = DifTC * (Gvr.DataKey("IVA").ToDecimal / Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal)
'diferenciaTransito += DifTC * (Gvr.DataKey("IEPSPS").ToDecimal / Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal) 'diferenciaTransito += DifTC * (Gvr.DataKey("IEPSPS").ToDecimal / Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal)
importeMNTemp = (Gvr.FCTextBox("TxtPU").Text.ToDecimal * Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal * tipoCambioActual).RoundSQL importeMNTemp = importeMNTemp + (Gvr.FCTextBox("TxtPU").Text.ToDecimal * Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal * tipoCambioActual).RoundSQL
ImporteTransito += importeMNTemp ImporteTransito += importeMNTemp
CveCompraAmortizacion = Gvr.DataKey("CveCompra").ToEntero
'se registra por cada compra relacionada 'se registra por cada compra relacionada
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMNTemp, importeMNTemp, ConceptoContabilizacionNC, Referencia, Concepto, CveCompra:=CveCompra, CveCompraAmortizacion:=Gvr.DataKey("CveCompra").ToEntero, CveProveedor:=CveProveedorConcepto, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then
End If
Next
If importeMNTemp > 0 Then
'importeMNTemp = importeMNTemp - TxtDescuento.Text.ToDecimal
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMNTemp, importeMNTemp, ConceptoContabilizacionNC, Referencia, Concepto, CveCompra:=CveCompra, CveCompraAmortizacion:=CveCompraAmortizacion, CveProveedor:=CveProveedorConcepto, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
End If End If
Next
'si se marca que no se va a recibir, falta validación 'si se marca que no se va a recibir, falta validación
If Not ErrorMovInv AndAlso Not ObjCompras.UpdateEstatusAlmacen(CveCompra, 1, UsuarioActual.CveUsuario) Then If Not ErrorMovInv AndAlso Not ObjCompras.UpdateEstatusAlmacen(CveCompra, 1, UsuarioActual.CveUsuario) Then
@@ -6778,7 +6813,7 @@ Partial Class Compras_Compras
Dim tTipoMovimiento As Boolean Dim tTipoMovimiento As Boolean
Dim Diferencia As Decimal = 0 Dim Diferencia As Decimal = 0
If CompraActual.TC < TCNC Then If CompraActual.TC > TCNC Then
tConceptoContable = 64 tConceptoContable = 64
tTipoMovimiento = True tTipoMovimiento = True
Else Else
@@ -7686,10 +7721,10 @@ Partial Class Compras_Compras
If Not ErrorPrepoliza AndAlso Not ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=4, AutoConta:=AutoConta) Then If Not ErrorPrepoliza AndAlso Not ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=4, AutoConta:=AutoConta) Then
TieneError = True TieneError = True
'If ObjConta.ValorPolizaDescuadre > 0 Then If ObjConta.ValorPolizaDescuadre > 0 AndAlso UsuarioActual.CveRol = 1 Then
' Alert($"{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia}", TipoMensaje.MsgError) Alert($"{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia}", TipoMensaje.MsgError)
' ErrorPrepolizaDescuadre = True ErrorPrepolizaDescuadre = True
'End If End If
End If End If
@@ -14584,8 +14619,7 @@ Partial Class Compras_Compras
UpGvOC1.Update() UpGvOC1.Update()
TmpDT = TmpDT.FiltraParametros("", "PU") TmpDT = TmpDT.FiltraParametros("", "PU")
GvOC2.DataSource = TmpDT
GvOC2.DataBind()
'PROCESO DE ASIGNACION DE CANTIDAD DEPENDIENDO DEL NoIdentificacion DEL XML Y EL NumeroParte DEL PRODUCTO 'PROCESO DE ASIGNACION DE CANTIDAD DEPENDIENDO DEL NoIdentificacion DEL XML Y EL NumeroParte DEL PRODUCTO
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
@@ -14616,7 +14650,11 @@ Partial Class Compras_Compras
'condicion temporal rmf 'condicion temporal rmf
GvOC1.Columns(6).Visible = False GvOC1.Columns(6).Visible = False
GvOC2.Columns(4).Visible = False GvOC2.Columns(4).Visible = False
GvOC2.DataSource = TmpDT.FiltraParametros("", "CodigoPS")
Else
GvOC2.DataSource = TmpDT
End If End If
GvOC2.DataBind()
UpGvOC2.Update() UpGvOC2.Update()
End Sub End Sub
@@ -14864,7 +14902,7 @@ Partial Class Compras_Compras
AjusteProntoPagoConIVA = (ImporteCompraConIVA - ImporteOCConIVA) AjusteProntoPagoConIVA = (ImporteCompraConIVA - ImporteOCConIVA)
AjusteProntoPagoSinIVA = (ImporteCompraSinIVA - ImporteOCSinIVA) AjusteProntoPagoSinIVA = (ImporteCompraSinIVA - ImporteOCSinIVA)
If ConfirmaVinculacionOCProntoPago() Then If ConfirmaVinculacionOCProntoPago(AjusteProntoPagoPorcentajeIVA) Then
Vinculacion() Vinculacion()
End If End If
@@ -21208,14 +21246,18 @@ Partial Class Compras_Compras
End Set End Set
End Property End Property
Public Function ConfirmaVinculacionOCProntoPago() As Boolean Public Function ConfirmaVinculacionOCProntoPago(AjusteProntoPagoPorcentajeIVA As Decimal) As Boolean
If VincularOcProntoPago Then If VincularOcProntoPago Then
Return True Return True
Else Else
Dim StrMsg As String = $"Existe una diferencia de ${(ImporteRNC + ImporteRNCProntoPago).ToString("###,###,###.00")} entre la compra y la Orden de Compra. <br/> Se generaran Remisiones de Nota de Crédito. <br/> - Descuento de ${ImporteRNC.ToString("###,###,###.00")}.<br/>"
If ImporteRNCProntoPago > 0 Then Dim TmpImporteRNC As Decimal = If(AjusteProntoPagoPorcentajeIVA > 0, (ImporteRNC * AjusteProntoPagoPorcentajeIVA), ImporteRNC)
StrMsg = StrMsg & $"- Pronto pago de ${ImporteRNCProntoPago.ToString("###,###,###.00")}" Dim TmpImporteRNCProntoPago As Decimal = If(AjusteProntoPagoPorcentajeIVA > 0, (TmpImporteRNCProntoPago * AjusteProntoPagoPorcentajeIVA), ImporteRNCProntoPago)
Dim StrMsg As String = $"Existe una diferencia de ${(TmpImporteRNC + TmpImporteRNCProntoPago).ToString("###,###,###.00")} entre la compra y la Orden de Compra. <br/> Se generaran Remisiones de Nota de Crédito. <br/> - Descuento de ${TmpImporteRNC.ToString("###,###,###.00")}.<br/>"
If TmpImporteRNCProntoPago > 0 Then
StrMsg = StrMsg & $"- Pronto pago de ${TmpImporteRNCProntoPago.ToString("###,###,###.00")}"
End If End If
LblModalConfirmaVinculacionProntoPago.Text = StrMsg LblModalConfirmaVinculacionProntoPago.Text = StrMsg

View File

@@ -0,0 +1,246 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="LibroMayor2.aspx.vb" Inherits="Conta_LibroMayor2" EnableEventValidation="false" %>
<asp:Content ContentPlaceHolderID="Css" runat="server">
<style>
.truncate {
width: 300px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
table {
border: none !important;
}
tr {
border: none !important;
}
td {
border: none !important;
}
</style>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-ad-excel"></i> Generar EXCEL</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="Imprimir" runat="server"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">
Movimientos Auxiliares del Catálogo
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" CssClass="btn btn-default" OnClick="BtnConsultar_Click" ValidationGroup="Valida" />
<a href="javascript:;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a><%--class="expand"--%>
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
</div>
<div class="titlefiltros caption ">
<div class="row">
<div class="col-md-1">
Cuenta:
</div>
<div class="col-md-3">
<asp:DropDownList ID="DdlCuentas" runat="server" AppendDataBoundItems="true" DataTextField="CuentaFormatoNombre" DataValueField="CveCuenta" CssClass="form-control input-sm select2me" Enabled="false">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlCuentas" runat="server" InitialValue="-1" ControlToValidate="DdlCuentas" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpConsulta"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="CERFVDdlCuentas" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlCuentas" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-1">
Fecha Inicio:
</div>
<div class="col-md-1" style="min-width: 115px">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpConsulta"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpConsulta"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-1">
Fecha Fin:
</div>
<div class="col-md-1" style="min-width: 115px">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100% !important; padding: 0px;">
<asp:TextBox Width="80px" ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpConsulta"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpConsulta"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
<div class="row">
<div class="col-md-1 truncate">
Tipo Movto
</div>
<div class="col-md-2 truncate">
<asp:DropDownList ID="DdlOpcionCuentas" runat="server" DataTextField="Cuenta" DataValueField="CveCuenta" TabIndex="4" CssClass="form-control input-sm select2me" Width="100%">
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Con movimientos" Value="1"></asp:ListItem>
<asp:ListItem Text="Saldo actual no igual a cero" Value="2"></asp:ListItem>
<asp:ListItem Text="Con movimientos y saldo no igual a cero" Value="3"></asp:ListItem>
<asp:ListItem Text="Con movimientos o saldo no igual a cero" Value="4"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1 truncate" id="tdTipoReporte" visible="false" runat="server">
Tipo
</div>
<div class="col-md-2" id="tdTipoReporte2" visible="false" runat="server">
<asp:DropDownList ID="DdlTipoReporte" CssClass="form-control input-sm select2me" runat="server" Width="100%">
<asp:ListItem Text="Contable" Value="1"></asp:ListItem>
<asp:ListItem Text="Contable y Complementario" Value="3"></asp:ListItem>
<asp:ListItem Text="Complementario" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1" id="divProyecto" runat="server">
<asp:Label ID="LblProyecto" runat="server">Proyecto:</asp:Label>
</div>
<div class="col-md-2">
<asp:DropDownList ID="DdlProyecto" CssClass=" form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Proyecto" DataValueField="CveProyecto" Width="95%">
</asp:DropDownList>
</div>
<asp:Label runat="server" ID="LblSubProyecto" CssClass="col-md-1">SubProyecto:</asp:Label>
<div class="col-md-2">
<asp:DropDownList ID="DdlSubproyecto" CssClass="form-control input-sm select2me" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="95%" AutoPostBack="True">
</asp:DropDownList>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="row" style="margin-right: 10px; margin-top: 8px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" AutoGenerateColumns="False"
EmptyDataText="No se encontrarios movimientos."
DataKeyNames="" OnRowDataBound="GvDatos_RowDataBound">
<Columns>
<asp:TemplateField ControlStyle-CssClass="Widthall">
<HeaderTemplate>
<table width="100%" style="border: none">
<tr>
<td colspan="3"><font size="2">Cuenta</font></td>
<td colspan="1"><font size="2">Nombre</font></td>
<td colspan="4"></td>
<td><font size="2">Saldo Inicial</font></td>
</tr>
<tr>
<td width="60px" align="center">Fecha</td>
<td width="60px" align="center">Tipo</td>
<td width="60px" align="center">Número</td>
<td width="300px" align="left">Concepto</td>
<td width="100px" align="center">Referencia</td>
<td width="100px" align="center">Referencia Movto</td>
<td width="100px" align="center">SubProyecto</td>
<td width="100px" align="center">Cargos</td>
<td width="100px" align="center">Abonos</td>
<td width="100px" align="center">Saldo</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table width="100%" style="border: none">
<tr runat="server" id="tr1">
<td colspan="3" align="left" width="180px">
<asp:Label ID="LbCuenta" runat="server" Text='<%# Eval("Codigo")%>'></asp:Label>
</td>
<td colspan="1" align="left" width="300px">
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</td>
<td colspan="2" width="200px"></td>
<td style="font-weight: normal;" align="right" width="100px">Saldo Inicial:
</td>
<td style="font-weight: normal;" align="right" width="100px">
<asp:Label ID="LbSaldoInicial" runat="server" Text='<%# Eval("SaldoInicial", "{0:N2}")%>'></asp:Label>
</td>
</tr>
<tr runat="server" id="tr2">
<td width="60px" style="border: 0px;" align="center">
<asp:Literal ID="LbFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}")%>'></asp:Literal>
</td>
<td width="60px" style="border: 0px;" align="center">
<asp:Literal ID="LbTipo" runat="server" Text='<%# Eval("TipoPoliza")%>'></asp:Literal>
</td>
<td width="60px" style="border: 0px;" align="center">
<asp:HyperLink ID="HLPoliza" runat="server" Text='<%# Eval("Folio")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</td>
<td width="300px" align="left">
<div class="truncate" style="width: 300px;">
<asp:Label ID="LbConcepto" runat="server" CssClass="truncate" Text='<%# Eval("Concepto")%>' title='<%# Eval("Concepto")%>'></asp:Label>
</div>
</td>
<td width="100px">
<asp:Label ID="LbReferencia" runat="server" Text='<%# Eval("Referencia")%>'></asp:Label>
</td>
<td width="60px" style="border: 0px;" align="center">
<asp:Literal ID="LtlRefMovto" runat="server" Text='<%# Eval("ReferenciaAdmin")%>'></asp:Literal>
</td>
<td width="100px">
<asp:Label ID="LblSubProyecto" runat="server" Text='<%# Eval("SubProyecto")%>'></asp:Label>
</td>
<td width="100px" align="right">
<asp:Label ID="LbCargos" runat="server"></asp:Label>
</td>
<td width="100px" align="right">
<asp:Label ID="LbAbonos" runat="server"></asp:Label>
</td>
<td width="100px" align="right">
<asp:Label ID="LbSaldo" runat="server"></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
<ItemStyle />
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
</script>
</asp:Content>

View File

@@ -0,0 +1,456 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class Conta_LibroMayor2
Inherits ClsPaginas
#Region "PROPIEDADES"
Private Property DtDatos As DataTable
Get
DtDatos = DirectCast(ViewState("DtDatos"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtDatos") = value
End Set
End Property
Private Property DtTotales As DataTable
Get
DtTotales = DirectCast(ViewState("DtTotales"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtTotales") = value
End Set
End Property
Private Property FechaInicio As Date
Get
FechaInicio = ViewState("FechaInicio").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaInicio") = value
End Set
End Property
Private Property FechaFin As Date
Get
FechaFin = ViewState("FechaFin").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaFin") = value
End Set
End Property
Private Property TotalPadre As Boolean
Get
TotalPadre = CBool(ViewState("TotalPadre"))
End Get
Set(value As Boolean)
ViewState("TotalPadre") = value
End Set
End Property
Private Property DTCuentas As DataTable
Get
Return CType(ViewState("DTCuentas"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTCuentas") = value
End Set
End Property
Private Property TipoReporte As String
Get
TipoReporte = ViewState("TP").ToString
End Get
Set(value As String)
ViewState("TP") = value
End Set
End Property
Private Property Cuenta As String
Get
Return ViewState("Cuenta").ToString
End Get
Set(value As String)
ViewState("Cuenta") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
'If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.CveEmpresa <> 119 Then
' Response.Redirect($"/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx")
'End If
Dim ErrorParametros As Boolean = True
CargaTipoCuentas()
'TxtCuenta.Enabled = False
txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString
txtFechaF.Text = NowADS().LastDayOfMonth.ToShortDateString
If Request("CveCuenta") IsNot Nothing AndAlso IsNumeric(Request("CveCuenta")) AndAlso Request("CveCuenta").ToEntero > 0 Then
If Request("FF") IsNot Nothing AndAlso Request("FF").ToString.Length = 10 AndAlso Request("FF").ToDate > "01/01/1000".ToDate Then
FechaFin = Request("FF").ToDate
txtFechaF.Text = FechaFin.ToShortDateString
DdlCuentas.SelectedValueExist(Request("CveCuenta").ToEntero)
If Request("FI") IsNot Nothing AndAlso Request("FI").ToString.Length = 10 AndAlso Request("FI").ToDate > "01/01/1000".ToDate Then
FechaInicio = Request("FI").ToDate
txtFechaI.Text = FechaInicio.ToShortDateString
Else
FechaInicio = DateSerial(Year(FechaFin), Month(FechaFin), 1)
TxtFechaF.Text = FechaInicio.ToShortDateString
End If
If Request("CveProyecto") IsNot Nothing AndAlso IsNumeric(Request("CveProyecto")) Then
DdlProyecto.SelectedValueExist(Request("CveProyecto"))
DdlProyecto_SelectedIndexChanged(Nothing, Nothing)
End If
If Request("CveSubProyecto") IsNot Nothing AndAlso IsNumeric(Request("CveSubProyecto")) Then
DdlSubproyecto.SelectedValueExist(Request("CveSubProyecto"))
End If
ErrorParametros = False
If Request("TP") IsNot Nothing AndAlso IsNumeric(Request("TP")) AndAlso Request("TP").ToEntero > 0 Then
TipoReporte = Request("TP").ToString
' DdlTipoReporte.SelectedValue = TipoReporte.ToString
End If
''If DdlTipoCuentas.Items.FindByValue(IdCuenta.ToString) IsNot Nothing Then
'' DdlTipoCuentas.SelectedValue = IdCuenta.ToString
''Else
'' DdlTipoCuentas.SelectedValue = "-2"
'' TxtCuenta.Enabled = True
'' If DTCuentas.FiltraParametros(String.Format("Cvecuenta = {0}", IdCuenta)).Rows.Count > 0 Then
'' TxtCuenta.Text = DTCuentas.FiltraParametros(String.Format("CveCuenta = {0}", IdCuenta)).Rows(0)("Codigo").ToString
'' End If
''End If
End If
End If
If Not ErrorParametros Then
TotalPadre = True
TipoReporte = "1"
CargaDatos()
End If
End If
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
If DdlCuentas.SelectedValue.ToEntero = -2 Then
Alert("El campo Cuenta es obligatorio.", TipoMensaje.MsgError)
Else
FechaInicio = If(txtFechaI.Text = "" Or txtFechaI.Text = "__/__/____", NowADS(), txtFechaI.Text.ToDate)
FechaFin = If(txtFechaF.Text = "" Or txtFechaF.Text = "__/__/____", NowADS(), txtFechaF.Text.ToDate)
CargaDatos()
End If
' Imprimir_click(sender, e)
'RegistraScript("Enable();")
End Sub
#Region "C A R G A - D A T O S"
Public Function WSCuentas() As String
Dim Str As New StringBuilder
Dim i As Integer = 0
Dim dt As DataTable = DTCuentas
For Each dr As DataRow In dt.Rows
i += 1
Str.AppendFormat("{{value:""{0}"",label:""{1}""}}{2}", dr("CveCuenta"), dr("Codigo").ToString.Replace("""", ""), If(i < dt.Rows.Count, ",", ""))
Next
Return Str.ToString
End Function
Private Sub CargaTipoCuentas()
Dim ObjTipoCuenta As New ClsContabilidad
DdlCuentas.Enabled = True
If ObjTipoCuenta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then
DTCuentas = ObjTipoCuenta.DtResultados
DdlCuentas.DataSource = ObjTipoCuenta.DtResultados.FiltraParametros("Codigo NOT IN ('_ACTIVO', '_PASIVO', '_CAPITAL', '_CUADRE', '_ESTADISTICAS', '_ORDEN', '_RACREEDOR', '_RDEUDOR', '_UTILIDAD')")
End If
ObjTipoCuenta.Dispose()
DdlCuentas.DataBind()
CargarCentrosDeCosto(DdlProyecto, DdlSubproyecto, LblProyecto, LblSubProyecto, divProyecto:=divProyecto)
End Sub
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProyecto.SelectedIndexChanged
CargarSubProyecto(DdlSubproyecto, DdlProyecto.SelectedValue, "Todos")
End Sub
Private Sub CargaDatos()
Dim CveProyecto As Integer = DdlProyecto.SelectedValue.ToEntero
Dim CveSubProyecto As Integer = DdlSubproyecto.SelectedValue.ToEntero
TipoReporte = DdlTipoReporte.SelectedValue.ToString
'If TipoReporte = "1" And DdlCuentas.SelectedValue.ToEntero < 0 Then
' Alert("No ha seleccionado cuenta, Favor de especificar una", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
Cuenta = DdlCuentas.SelectedItem.ToString
Dim ObjConta As New ClsContabilidad
If ObjConta.GetMovimientosAuxiliaresCatalogo(DdlCuentas.SelectedValue.ToEntero, FechaInicio, FechaFin, -1, CveProyecto, CveSubProyecto, UsuarioActual.CveEmpresa, TipoReporte, DdlOpcionCuentas.SelectedValue.ToEntero) Then
DtDatos = ObjConta.DtResultados
DtTotales = DtDatos.Clone
CargaGrid()
Else
DtDatos = Nothing
End If
ObjConta.Dispose()
End Sub
#End Region
Private Sub InsertaTotales()
Dim i As Integer = 0
Dim Aumento As Integer = 0
Dim Row As DataRow
Dim Row2 As DataRow
'Llena DtTotales
For Each dr As DataRow In DtDatos.Rows
If dr("Concepto").ToString = "" Then
Row = DtTotales.NewRow
Row("CveCuenta") = -1
Row("CargosMovto") = If("1" = "1", dr("Cargos"), dr("CargosME"))
Row("AbonosMovto") = If("1" = "1", dr("Abonos"), dr("AbonosME"))
Row("Saldo") = dr("SaldoActual")
Row("CtaMayor") = dr("CtaMayor")
Row("Concepto") = String.Format("Total {0}:", dr("Nombre"))
Row("Nombre") = dr("Nombre")
DtTotales.Rows.Add(Row)
Row("Clasificacion") = i
End If
i += 1
Next
'Inserta Totales en DtDatos
For Each dr As DataRow In DtTotales.Rows
i = 0
If dr("CtaMayor").ToString = "1" Then
DtDatos.ImportRow(dr)
End If
If dr("CtaMayor").ToString = "2" Then
For index As Integer = dr("Clasificacion").ToString.ToEntero + Aumento To DtDatos.Rows.Count
If DtDatos.Rows(index)("Nombre").ToString <> dr("Nombre").ToString Then
i = index
Exit For
End If
Next
Row2 = DtDatos.NewRow
Row2.ItemArray = dr.ItemArray
DtDatos.Rows.InsertAt(Row2, i + Aumento)
Aumento += 1
End If
Next
End Sub
#Region "G R I D - GV DATOS"
Private Sub CargaGrid()
GvDatos.DataSource = DtDatos
'GvDatos.Dispose()
GvDatos.DataBind()
UpDatos.Update()
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Concepto") = "" Then
e.Row.ControlStyle.Font.Bold = True
e.Row.ControlStyle.Height = 35
'Cuando es Titulo
If e.Row.DBCampo("SaldoActual") = "" Then
CType(e.Row.FindControl("tr2"), HtmlTableRow).Visible = False
'Cuando Es Total
Else
CType(e.Row.FindControl("tr1"), HtmlTableRow).Visible = False
'Anterior para TotalPadre
'If e.Row.DBCampo("CtaMayor").ToString = "2" And (e.Row.DBCampo("Nivel3").ToString <> "" Xor e.Row.DBCampo("Orden").ToString.Length = 18) Then
' e.Row.FCLabel("LbReferencia").Text = "Total:"
'Else
' e.Row.FCLabel("LbConcepto").Text = String.Format("Total {0}:", e.Row.DBCampo("Nombre").ToString)
'End If
If TotalPadre Then
CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(3).Width = "1px"
'CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells.Remove(CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(3))
CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(3).Align = "Right"
CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(3).Width = "400px"
If e.Row.RowIndex + 1 = DtDatos.Rows.Count Then
CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(4).Attributes.Add("style", "border-top: 1px solid black;")
CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(5).Attributes.Add("style", "border-top: 1px solid black;")
CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(6).Attributes.Add("style", "border-top: 1px solid black;")
End If
e.Row.FCLabel("LbReferencia").Text = String.Format("Total {0}:", e.Row.DBCampo("Nombre").ToString)
Else
TotalPadre = True
e.Row.FCLabel("LbReferencia").Font.Bold = False
e.Row.FCLabel("LbReferencia").Text = "Total:"
CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(4).Align = "Right"
End If
'e.Row.FCLabel("LbReferencia").Text = String.Format("Total {0}:", If(e.Row.DBCampo("CtaMayor").ToString = "2", "", e.Row.DBCampo("Nombre").ToString))
e.Row.FCLabel("LbCargos").Text = e.Row.DBCampo("Cargos").ToString.FormatoNumero(If("1" = "1", 2, 4))
e.Row.FCLabel("LbAbonos").Text = e.Row.DBCampo("Abonos").ToString.FormatoNumero(If("1" = "1", 2, 4))
e.Row.FCLabel("LbSaldo").Text = e.Row.DBCampo("SaldoActual").ToString.FormatoNumero(If("1" = "1", 2, 4))
End If
Else
TotalPadre = False
e.Row.ControlStyle.Font.Bold = False
CType(e.Row.FindControl("tr1"), HtmlTableRow).Visible = False
e.Row.FCHyperLink("HLPoliza").NavigateUrl = String.Format("/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}", e.Row.DBCampo("CvePoliza"))
If e.Row.DBCampo("CargosMovto").ToDouble <> 0 Then e.Row.FCLabel("LbCargos").Text = e.Row.DBCampo("CargosMovto").ToString.FormatoNumero(If("1" = "1", 2, 4))
If e.Row.DBCampo("AbonosMovto").ToDouble <> 0 Then e.Row.FCLabel("LbAbonos").Text = e.Row.DBCampo("AbonosMovto").ToString.FormatoNumero(If("1" = "1", 2, 4))
If e.Row.DBCampo("Saldo").ToDouble <> 0 Then e.Row.FCLabel("LbSaldo").Text = e.Row.DBCampo("Saldo").ToString.FormatoNumero(If("1" = "1", 2, 4))
End If
'COLOREA NEGATIVOS
If e.Row.FCLabel("LbCargos").Text.ToDouble < 0 Then
e.Row.FCLabel("LbCargos").ForeColor = Drawing.Color.Red
Else
e.Row.FCLabel("LbCargos").ForeColor = Drawing.Color.Black
End If
If e.Row.FCLabel("LbAbonos").Text.ToDouble < 0 Then
e.Row.FCLabel("LbAbonos").ForeColor = Drawing.Color.Red
Else
e.Row.FCLabel("LbAbonos").ForeColor = Drawing.Color.Black
End If
If e.Row.FCLabel("LbSaldo").Text.ToDouble < 0 Then
e.Row.FCLabel("LbSaldo").ForeColor = Drawing.Color.Red
Else
e.Row.FCLabel("LbSaldo").ForeColor = Drawing.Color.Black
End If
If e.Row.FCLabel("LbSaldoInicial").Text.ToDouble < 0 Then
e.Row.FCLabel("LbSaldoInicial").ForeColor = Drawing.Color.Red
Else
e.Row.FCLabel("LbSaldoInicial").ForeColor = Drawing.Color.Black
End If
End If
End Sub
#End Region
Protected Sub Imprimir_click(sender As Object, e As EventArgs) Handles Imprimir.Click
If DdlCuentas.SelectedValue.ToEntero = -1 Then
Alert("El campo Cuenta es obligatorio.", TipoMensaje.MsgError)
Else
FechaInicio = If(txtFechaI.Text = "" Or txtFechaI.Text = "__/__/____", NowADS(), txtFechaI.Text.ToDate)
FechaFin = If(txtFechaF.Text = "" Or txtFechaF.Text = "__/__/____", NowADS(), txtFechaF.Text.ToDate)
DtDatos = DtDatos
ImprimirReporte()
End If
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
ImprimirReporte("Excel")
'Dim htmlTabe As New HtmlTable
'Dim RutaLogo As String = $"{UsuarioActual.Empresa.Ruta}Logo.png"
'Dim strinLiteral As String = ""
'Dim EncabezadoLiteral As New LiteralControl
'If System.IO.File.Exists(RutaLogo) Then
' RutaLogo = $"http://{Request.Url.Host }/Empresas/{UsuarioActual.CveEmpresa}/Logo.png"
' strinLiteral = $"<table style='width:{ GvDatos.Width }px'><tr>
' <td colspan='3' style='width:15%;height:150px; text-align:center; vertical-align:middle;font-weight: bold;'><img width='200px' height='150px' style='max-height:150px!important;max-width:200px!important' src='{RutaLogo}' /> </td>
' <td colspan='3' style='width:70%;height:150px; text-align:center; vertical-align:middle;font-weight: bold; display: block;'><p><span>{UsuarioActual.Empresa.Empresa} </span><br><span> Movimientos Auxiliares del Catálogo<p></td>
' <td colspan='3' style='width:15%;height:150px; text-align:center; vertical-align:middle;font-weight: bold;'> Fecha:{NowADS().ToString("dd/MM/yyyy")}</td>
' </tr>
' <tr>
' <td style='text-align:left;' colspan='6'>
' <b>Filtros Cuenta:</b> {DdlCuentas.SelectedItem.Text} <b>Fecha inicio: </b>{ TxtFechaDel.Text} <b>Fecha Fin:</b> {TxtFechaAl.Text}
' <td>
' </tr>
' </table>"
'Else
' strinLiteral = $"<table style='width:{ GvDatos.Width }px'><tr>
' <td colspan='3' style='width:15%;height:150px; text-align:center; vertical-align:middle;font-weight: bold;'> </td>
' <td colspan='3' style='width:70%;height:150px; text-align:center; vertical-align:middle;font-weight: bold; display: block;'><p><span>{UsuarioActual.Empresa.Empresa} </span><br><span> Movimientos Auxiliares del Catálogo<p></td>
' <td colspan='3' style='width:15%;height:150px; text-align:center; vertical-align:middle;font-weight: bold;'> Fecha:{NowADS().ToString("dd/MM/yyyy")}</td>
' </tr>
' <tr>
' <td style='text-align:left;' colspan='9'>
' <b>Filtros Cuenta:</b> {DdlCuentas.SelectedItem.Text} <b>Fecha inicio: </b>{ TxtFechaDel.Text} <b>Fecha Fin:</b> {TxtFechaAl.Text}
' <td>
' <tr>
' </table>"
'End If
'EncabezadoLiteral.Text = strinLiteral
'GvDatos.ExportToExcel($"MovimientosAuxiliares_{NowADS().ToString("yyyyMMddmmss")}", Encabezado2:=EncabezadoLiteral)
End Sub
Private Sub ImprimirReporte(Optional Formato As String = "PDF")
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
params.Add(New ReportParameter("pImg", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
params.Add(New ReportParameter("pFechaFin", FechaFin.ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("pFechaInicio", FechaInicio.ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("CveMoneda", "1"))
params.Add(New ReportParameter("Cuenta", Cuenta))
ImprimirPDF("Empresas/Grales/Formatos/RepMovimientosAuxiliaresCatalogo.rdlc", DtDatos, params, "MovimientosAuxiliares", Formato)
End Sub
Public Overrides Sub VerifyRenderingInServerForm(control As Control)
End Sub
End Class

View File

@@ -30,93 +30,28 @@
'BANDERA PARA VALIDACION DE CFDI 'BANDERA PARA VALIDACION DE CFDI
Application("GlobalValidarCFDI") = True Application("GlobalValidarCFDI") = True
'-------------------------------------------------------------------------------------------------------------------------
'A M O R T I Z A C I O N - C O N T A B L E
'GuardaLogAsax(String.Format("Globalasax 5:{0}", DateTime.Now))
'Using ObjAC As New ClsAC
' If ObjAC.GetFuenteFinanciamientoCONAC() Then Application("GlobalDTAC_FuentesFinanciamientoCONAC") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamientoCONAC") = Nothing
' If ObjAC.GetProgramaCONAC() Then Application("GlobalDTAC_ProgramasCONAC") = ObjAC.DtResultados Else Application("GlobalDTAC_ProgramasCONAC") = Nothing
' If ObjAC.GetPD_Programas() Then Application("GlobalDTAC_PD_Programas") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_Programas") = Nothing
' If ObjAC.GetPD_Estrategias() Then Application("GlobalDTAC_PD_Estrategias") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_Estrategias") = Nothing
' If ObjAC.GetPD_LineasAccion() Then Application("GlobalDTAC_PD_LineasAccion") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_LineasAccion") = Nothing
' If ObjAC.GetPD_Metas() Then Application("GlobalDTAC_PD_Metas") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_Metas") = Nothing
' If ObjAC.GetTipoGasto() Then Application("GlobalDTAC_TipoGasto") = ObjAC.DtResultados Else Application("GlobalDTAC_TipoGasto") = Nothing
' If ObjAC.GetRubrosIngreso() Then Application("GlobalDTAC_RubrosIngreso") = ObjAC.DtResultados Else Application("GlobalDTAC_RubrosIngreso") = Nothing
' If ObjAC.GetMatrizID Then Application("GlobalDTAC_MatrizIngresos") = ObjAC.DtResultados Else Application("GlobalDTAC_MatrizIngresos") = Nothing
' If ObjAC.GetMatrizGD Then Application("GlobalDTAC_MatrizEgresos") = ObjAC.DtResultados Else Application("GlobalDTAC_MatrizEgresos") = Nothing
'End Using
'GuardaLogAsax(String.Format("Globalasax 6:{0}", DateTime.Now))
'Using Finan As New ClsFinanzas
' If Finan.GetRazonesFinancieras(-1) Then Application("GlobalDTFinan_RazonesFinancieras") = Finan.DtResultados
'End Using
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'------------------------------------------------------------------------------S I S T E M A ---------------------------------------------------------------------------------- '------------------------------------------------------------------------------S I S T E M A ----------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'P A R A M E T R O S
'Using ObjParametros As New ClsSisParametros
' If ObjParametros.GetParametros Then Application("GlobalDTParametros") = ObjParametros.DtResultados Else Application("GlobalDTParametros") = Nothing
'End Using
GuardaLogAsax(String.Format("Globalasax 35:{0}", DateTime.Now)) GuardaLogAsax(String.Format("Globalasax 35:{0}", DateTime.Now))
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'G L O B A L E S A P L I C A C I Ó N
'GuardaLogAsax(String.Format("Globalasax 41:{0}", DateTime.Now))
BundleConfig.RegistrarBundles(BundleTable.Bundles) BundleConfig.RegistrarBundles(BundleTable.Bundles)
BundleTable.EnableOptimizations = True BundleTable.EnableOptimizations = True
' System.Web.UI.ValidationSettings.UnobtrusiveValidationMode = UnobtrusiveValidationMode.None ' System.Web.UI.ValidationSettings.UnobtrusiveValidationMode = UnobtrusiveValidationMode.None
Dim EmpresaNotificaciones As New Empresa With {.SendMail = "signotificaciones@adssistemas.mx", .SendMailPassword = "sig123987", .SendMailServer = "mail.adssistemas.mx", .SendMailPuerto = 587} Dim EmpresaNotificaciones As New Empresa With {.SendMail = "signotificaciones@adssistemas.mx", .SendMailPassword = "SigNot..98$", .SendMailSSL = True, .SendMailServer = "adssistemas.mx", .SendMailPuerto = 465}
ClsPaginas.EmpresaNotificaciones = EmpresaNotificaciones ClsPaginas.EmpresaNotificaciones = EmpresaNotificaciones
Dim EmpresaNotificacionesGPS As New Empresa With {.SendMail = "ALERTAS@SIGNALSGPS.com", .SendMailPassword = "STJ180705IV42021ad", .SendMailServer = "mail.signalsgps.com", .SendMailPuerto = 587} Dim EmpresaNotificacionesGPS As New Empresa With {.SendMail = "ALERTAS@SIGNALSGPS.com", .SendMailPassword = "STJ180705IV42021ad", .SendMailServer = "mail.signalsgps.com", .SendMailPuerto = 587}
ClsPaginas.EmpresaNotificacionesGPS = EmpresaNotificacionesGPS ClsPaginas.EmpresaNotificacionesGPS = EmpresaNotificacionesGPS
''------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'' R A S T R E O
'Using ObjGPS As New ClsGPS
' If ObjGPS.DispositivosGet(-1, -1, -1, -1) Then
' If ObjGPS.DtResultados.Rows.Count > 0 Then
' Application("GlobalDTDispositivos") = ObjGPS.DtResultados
' Else
' Application("GlobalDTDispositivos") = Nothing
' End If
' End If
' If ObjGPS.DispositivosUsuariosGet(-1, -1, -1, -1, -1) Then
' If ObjGPS.DtResultados.Rows.Count > 0 Then
' Application("GlobalDTDispositivosUsuarios") = ObjGPS.DtResultados
' Else
' Application("GlobalDTDispositivosUsuarios") = Nothing
' End If
' End If
'End Using
'GuardaLogAsax(String.Format("Globalasax 42:{0}", DateTime.Now))
'If EsProduccion = "1" Then
' RegisterNotification()
'End If
'-----------------
GlobalConfiguration.Configure(AddressOf WebApiConfig.Register) GlobalConfiguration.Configure(AddressOf WebApiConfig.Register)
GlobalConfiguration.Configuration.EnsureInitialized() GlobalConfiguration.Configuration.EnsureInitialized()
End Sub End Sub
Sub Application_End(sender As Object, e As EventArgs) Sub Application_End(sender As Object, e As EventArgs)
'If EsProduccion = "1" Then
' SqlDependency.Stop(ConfigurationManager.ConnectionStrings("Conexion").ConnectionString)
'End If
' Code that runs on application shutdown ' Code that runs on application shutdown
End Sub End Sub

View File

@@ -4588,6 +4588,39 @@ Partial Class Inventarios_EntregaAlmacen
Dim ObjInventario As New ClsInventarios(TransaccionSql) Dim ObjInventario As New ClsInventarios(TransaccionSql)
If ObjInventario.GetMovimientosDetalle(CveMovimientoGenerado, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosDetalle(CveMovimientoGenerado, UsuarioActual.CveEmpresa) Then
If Not cancelarPeido Then If Not cancelarPeido Then
'Dim DT_Ventas_Detalles As DataTable = DTSolicitudDev.FiltraParametros("", "", {"CantidadPedido", "CvePS", "CveVentaDetalle"})
'DT_Ventas_Detalles.Columns.Add("CantidadUsada", GetType(Decimal))
'DT_Ventas_Detalles.AcceptChanges()
'For Each dRow As DataRow In DT_Ventas_Detalles.Rows
' For Each gvRow As GridViewRow In GvMU.Rows
' Dim CantidadUsada As Decimal = gvRow.FCTextBox("TxtUtilizado").Text.ToDecimal
' If dRow("CvePS").ToString.ToDecimal = gvRow.DataKey("CvePS").ToDecimal AndAlso CantidadUsada > 0 Then
' dRow("CantidadUsada") = dRow("CantidadUsada").ToString.ToDecimal + CantidadUsada
' End If
' Next
'Next
'For Each dRow As DataRow In DT_Ventas_Detalles.Rows
' Dim CantidadUsada As Decimal = dRow("CantidadUsada").ToString.ToDecimal
' If dRow("CantidadUsada").ToString.ToDecimal < dRow("CantidadPedido").ToString.ToDecimal Then
' If Not ObjInventario.UpdatePedidoDetalleCantidad(dRow("CveVentaDetalle").ToString.ToEntero, CantidadUsada, 2) Then
' ProcesoOK = False
' Exit For
' End If
' End If
'Next
For Each Dr As DataRow In ObjInventario.DtResultados.Rows For Each Dr As DataRow In ObjInventario.DtResultados.Rows
Dim CveVentaDetalle As Integer = Dr("CveVentaDetalle").ToString().ToEntero() Dim CveVentaDetalle As Integer = Dr("CveVentaDetalle").ToString().ToEntero()
@@ -4603,8 +4636,10 @@ Partial Class Inventarios_EntregaAlmacen
End If End If
Next Next
End If
End If
End If End If
End If End If

View File

@@ -136,7 +136,7 @@
<asp:LinkButton ID="LnkCaducidad" Visible="false" runat="server"><i class="fa fa-list"></i>Caducidad de producto</asp:LinkButton> <asp:LinkButton ID="LnkCaducidad" Visible="false" runat="server"><i class="fa fa-list"></i>Caducidad de producto</asp:LinkButton>
</li> </li>
<li> <li>
<asp:LinkButton ID="LnkExistenciasPorCapas" Visible="false" runat="server"><i class="fa fa-list"></i>Existecias por capas</asp:LinkButton> <asp:LinkButton ID="LnkExistenciasPorCapas" Visible="false" runat="server"><i class="fa fa-list"></i>Existencias por capas</asp:LinkButton>
</li> </li>
<li> <li>
<asp:HyperLink runat="server" ID="HlAyuda" NavigateUrl="/Documentacion/DocumentacionInventarios.aspx#Kardex"><i class="fa fa-question-circle"></i>Ayuda</asp:HyperLink> <asp:HyperLink runat="server" ID="HlAyuda" NavigateUrl="/Documentacion/DocumentacionInventarios.aspx#Kardex"><i class="fa fa-question-circle"></i>Ayuda</asp:HyperLink>
@@ -498,6 +498,11 @@
Text='<%# Eval("ValorInventario", "{0:N2}")%>'></asp:Label> Text='<%# Eval("ValorInventario", "{0:N2}")%>'></asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center" HeaderText="OdeC">
<ItemTemplate>
<asp:Label ID="LbOC" runat="server" Text='<%# Eval("NoOrden")%>' data-toggle="tooltip" title='<%# Eval("CveOrdendeCorte")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns> </Columns>
<RowStyle CssClass="Texto" /> <RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" /> <AlternatingRowStyle CssClass="TextoAlterno" />
@@ -646,12 +651,12 @@
<asp:HyperLink ID="hlFolio" runat="server" Text='<%# Eval("Folio")%>' CssClass="Texto" NavigateUrl='<%# Eval("CveMovimiento", "/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}")%>' Target="_blank" /> <asp:HyperLink ID="hlFolio" runat="server" Text='<%# Eval("Folio")%>' CssClass="Texto" NavigateUrl='<%# Eval("CveMovimiento", "/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}")%>' Target="_blank" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField HeaderText="Folio" DataField="Folio" ItemStyle-Width="10%" /> <asp:BoundField HeaderText="Orden de corte" DataField="NoOrden" ItemStyle-Width="10%" />
<asp:BoundField HeaderText="Concepto" DataField="Concepto" ItemStyle-Width="15%" />
<asp:BoundField HeaderText="Fecha" DataField="FechaMovto" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="10%" /> <asp:BoundField HeaderText="Fecha" DataField="FechaMovto" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="10%" />
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-Width="20%" />
<asp:BoundField HeaderText="Almacen" DataField="Almacen" ItemStyle-Width="15%" /> <asp:BoundField HeaderText="Almacen" DataField="Almacen" ItemStyle-Width="15%" />
<asp:BoundField HeaderText="Entrada" DataField="Entrada" DataFormatString="{0:#,###.##}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Entrada" DataField="Entrada" DataFormatString="{0:#,###.##}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Salida" DataField="Salida" DataFormatString="{0:#,###.##}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" /> <%-- <asp:BoundField HeaderText="Salida" DataField="Salida" DataFormatString="{0:#,###.##}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />--%>
<asp:BoundField HeaderText="Disponible" DataField="Disponible" DataFormatString="{0:#,###.##}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Disponible" DataField="Disponible" DataFormatString="{0:#,###.##}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />
</Columns> </Columns>
</asp:GridView> </asp:GridView>

View File

@@ -82,6 +82,8 @@ Partial Class Inventarios_Kardex
GvM.Columns(15).Visible = TienePermisoImportes ' importe GvM.Columns(15).Visible = TienePermisoImportes ' importe
GvM.Columns(17).Visible = TienePermisoImportes ' valor GvM.Columns(17).Visible = TienePermisoImportes ' valor
GvM.Columns(18).Visible = UsuarioActual.CveEmpresa = 172 AndAlso UsuarioActual.CveRol = 1
If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 Then If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 Then
DVFiltroCodigo.Visible = True DVFiltroCodigo.Visible = True
End If End If
@@ -282,7 +284,7 @@ Partial Class Inventarios_Kardex
LnkSeries.Visible = AuxAplicaSerie LnkSeries.Visible = AuxAplicaSerie
LnkCaducidad.Visible = AuxAplicaCad LnkCaducidad.Visible = AuxAplicaCad
If UsuarioActual.CveEmpresa = 172 Then If UsuarioActual.CveEmpresa = 172 AndAlso UsuarioActual.CveRol = 1 Then
LnkExistenciasPorCapas.Visible = True LnkExistenciasPorCapas.Visible = True
End If End If
'CARGA INDICADORES 'CARGA INDICADORES
@@ -586,8 +588,13 @@ Partial Class Inventarios_Kardex
Dim FechaI As DateTime = If(TxtFechaI.Text <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text.ToDateTime(), MinFecha) Dim FechaI As DateTime = If(TxtFechaI.Text <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text.ToDateTime(), MinFecha)
Dim FechaF As DateTime = If(TxtFechaF.Text <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text.ToDateTime(), MaxFecha) Dim FechaF As DateTime = If(TxtFechaF.Text <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text.ToDateTime(), MaxFecha)
Dim almacenes = ddlAlmacen.GetSelectedValues()
If String.IsNullOrEmpty(almacenes) Then
almacenes = "-1"
End If
Using ObjInv As New ClsInventarios Using ObjInv As New ClsInventarios
If ObjInv.GetInvExistenciasCapas(ddlProducto2.SelectedValue.ToEntero(), FechaI, FechaF, UsuarioActual.CveEmpresa, ddlAlmacen.GetSelectedValues()) Then If ObjInv.GetInvExistenciasCapas(ddlProducto2.SelectedValue.ToEntero(), FechaI, FechaF, UsuarioActual.CveEmpresa, almacenes) Then
GvExistenciasCapas.DataSource = ObjInv.DtResultados GvExistenciasCapas.DataSource = ObjInv.DtResultados
End If End If
End Using End Using

View File

@@ -170,23 +170,30 @@
DataKeyNames="EsDevolucionVenta" DataKeyNames="EsDevolucionVenta"
data-sort="true" EmptyDataText="No se encontraron resultados." AutoGenerateColumns="False" > data-sort="true" EmptyDataText="No se encontraron resultados." AutoGenerateColumns="False" >
<Columns> <Columns>
<%--0--%>
<asp:BoundField HeaderText="Tipo Docto" DataField="TipoDocto" ItemStyle-Width="55px" /> <asp:BoundField HeaderText="Tipo Docto" DataField="TipoDocto" ItemStyle-Width="55px" />
<%--1--%>
<asp:HyperLinkField DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="~/Ventas/Ventas.aspx?CveVenta={0}" Target="_blank" ItemStyle-Width="80px" HeaderText="SerieFolio" ControlStyle-CssClass="Texto" DataTextField="SerieFolio" /> <asp:HyperLinkField DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="~/Ventas/Ventas.aspx?CveVenta={0}" Target="_blank" ItemStyle-Width="80px" HeaderText="SerieFolio" ControlStyle-CssClass="Texto" DataTextField="SerieFolio" />
<%-- <asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Center" />--%>
<asp:TemplateField HeaderText="Fecha" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="Fecha" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Center">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="LtlFechaFactura" runat="server" ></asp:Label> <asp:Label ID="LtlFechaFactura" runat="server" ></asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%--2--%>
<asp:HyperLinkField DataNavigateUrlFields="CveCliente" DataNavigateUrlFormatString="~/Ventas/Clientes.aspx?CveCliente={0}" Target="_blank" HeaderText="Cliente" ControlStyle-CssClass="Texto" ItemStyle-HorizontalAlign="Left" DataTextField="Nombre" /> <asp:HyperLinkField DataNavigateUrlFields="CveCliente" DataNavigateUrlFormatString="~/Ventas/Clientes.aspx?CveCliente={0}" Target="_blank" HeaderText="Cliente" ControlStyle-CssClass="Texto" ItemStyle-HorizontalAlign="Left" DataTextField="Nombre" />
<%--3--%>
<asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:n2}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:n2}" ItemStyle-HorizontalAlign="Right" />
<%--4--%>
<asp:BoundField HeaderText="Sucursal" DataField="SubProyecto" ItemStyle-Width="100px" /> <asp:BoundField HeaderText="Sucursal" DataField="SubProyecto" ItemStyle-Width="100px" />
<%--5--%>
<asp:BoundField HeaderText="Tipo Venta" DataField="TipoVenta" Visible="false" /> <asp:BoundField HeaderText="Tipo Venta" DataField="TipoVenta" Visible="false" />
<%--6--%>
<asp:BoundField HeaderText="Médico" DataField="Medico" Visible="false" /> <asp:BoundField HeaderText="Médico" DataField="Medico" Visible="false" />
<%--7--%>
<asp:BoundField HeaderText="Procedimiento" DataField="Procedimiento" Visible="false" /> <asp:BoundField HeaderText="Procedimiento" DataField="Procedimiento" Visible="false" />
<%--8--%>
<asp:BoundField HeaderText="Surtido" DataField="Surtido" DataFormatString="{0:n2}" ItemStyle-HorizontalAlign="Right" />
<%--9--%>
<asp:TemplateField ItemStyle-Width="70px" HeaderText="Acción" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField ItemStyle-Width="70px" HeaderText="Acción" ItemStyle-HorizontalAlign="Center">
<ItemTemplate> <ItemTemplate>

View File

@@ -88,6 +88,7 @@ Partial Class RepNotasSinAlmacen
GvVentas.Columns(6).Visible = True GvVentas.Columns(6).Visible = True
GvVentas.Columns(7).Visible = True GvVentas.Columns(7).Visible = True
GvVentas.Columns(8).Visible = True GvVentas.Columns(8).Visible = True
GvVentas.Columns(9).Visible = True
TxtFechaF.Text = NowADS.AddDays(3).ToShortDateString TxtFechaF.Text = NowADS.AddDays(3).ToShortDateString
GvVentas.Columns(4).Visible = False GvVentas.Columns(4).Visible = False

View File

@@ -1126,7 +1126,7 @@ Partial Class OI_EventoDetalle
'UsuarioPara = DdlUsuarioPara.SelectedItem.Text 'UsuarioPara = DdlUsuarioPara.SelectedItem.Text
Dim dru As DataRow = GlobalDTUsuarios(CveUsuarioPara, UsuarioActual.CveEmpresa).FiltroPrimero("") Dim dru As DataRow = GlobalDTUsuarios(CveUsuarioPara, CveEmpresa).FiltroPrimero("")
If dru IsNot Nothing Then CorreoPara = dru("Correo").ToString If dru IsNot Nothing Then CorreoPara = dru("Correo").ToString
Dim RutaGuardar = "" Dim RutaGuardar = ""
RutaGuardar = String.Format("{0}OI\", UsuarioActual.Empresa.Ruta) RutaGuardar = String.Format("{0}OI\", UsuarioActual.Empresa.Ruta)

View File

@@ -179,6 +179,7 @@
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel runat="server" ID="uppBtns" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="uppBtns" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:Button ID="btnCargaCotizaciones" OnClick="btnCargaCotizaciones_Click" runat="server" ClientIDMode="Static" Style="display: none;" /> <asp:Button ID="btnCargaCotizaciones" OnClick="btnCargaCotizaciones_Click" runat="server" ClientIDMode="Static" Style="display: none;" />
@@ -221,7 +222,8 @@
<asp:ListItem Text="Media" Value="2"></asp:ListItem> <asp:ListItem Text="Media" Value="2"></asp:ListItem>
<asp:ListItem Text="Baja" Value="3"></asp:ListItem> <asp:ListItem Text="Baja" Value="3"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
<asp:DropDownList ID="DdlSubProyectoGral" Visible="false" CssClass="form-control select2me" runat="server" Width="85%" DataTextField="SubProyecto" DataValueField="CveSubProyecto" OnSelectedIndexChanged ="DdlSubProyectoGral_SelectedIndexChanged" AutoPostBack="true"> <asp:DropDownList ID="DdlSubProyectoGral" Visible="false" CssClass="form-control select2me" runat="server" Width="85%" DataTextField="SubProyecto" DataValueField="CveSubProyecto"
OnSelectedIndexChanged ="DdlSubProyectoGral_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Selected="True" Text="-" Value="-1"></asp:ListItem> <asp:ListItem Selected="True" Text="-" Value="-1"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
@@ -480,15 +482,15 @@
<tr id="TrDescuentoEscalonado" runat="server" visible="false"> <tr id="TrDescuentoEscalonado" runat="server" visible="false">
<td><b>Descuento:</b></td> <td><b>Descuento:</b></td>
<td> <td>
<asp:TextBox ID="TxtDescuentoEscalonado" runat="server" Width="100px" Height="28px"></asp:TextBox> <asp:TextBox ID="TxtDescuentoEscalonado" runat="server" Width="80px" Height="28px"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtDescuentoEscalonado" ValidChars="1234567890+" /> <ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtDescuentoEscalonado" ValidChars="1234567890+" />
<asp:Button runat="server" ID="BtnDescuenEscalonado" Text="Aplicar" CssClass="btn btn-primary" OnClick="BtnDescuenEscalonado_Click" /> <asp:Button runat="server" ID="BtnDescuenEscalonado" Text="Aplicar" CssClass="btn btn-primary" OnClick="BtnDescuenEscalonado_Click" />
</td> </td>
</tr> </tr>
<tr id="TrDescuentoProntoPago" runat="server" visible="false"> <tr id="TrDescuentoProntoPago" runat="server" visible="false">
<td><b>Descuento Pronto Pago:</b></td> <td><b>%Desc. Pronto Pago:</b></td>
<td> <td>
<asp:TextBox ID="TxtPorcentajeProntoPago" CssClass="form-control " runat="server" MaxLength="50" Width="100px" Height="28px"></asp:TextBox> <asp:TextBox ID="TxtPorcentajeProntoPago" CssClass="form-control " runat="server" MaxLength="50" Width="80px" Height="28px"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtPorcentajeProntoPago" ValidChars="1234567890." /> <ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtPorcentajeProntoPago" ValidChars="1234567890." />
</td> </td>
</tr> </tr>
@@ -496,6 +498,7 @@
</table> </table>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
@@ -694,7 +697,7 @@
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
</div> </div>
<div id="DVSeccionGVD"></div>
<asp:UpdatePanel ID="UPPTab" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UPPTab" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%"> <ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%">
@@ -802,7 +805,7 @@
Producto o Servicio(<asp:HyperLink ID="HplPS" NavigateUrl="/Ventas/CatPS.aspx" runat="server">+</asp:HyperLink>)</th> Producto o Servicio(<asp:HyperLink ID="HplPS" NavigateUrl="/Ventas/CatPS.aspx" runat="server">+</asp:HyperLink>)</th>
<th scope="col">Unidad</th> <th scope="col">Unidad</th>
<th scope="col">Observación</th> <th scope="col">Observación</th>
<th scope="col"> <th scope="col" runat="server" id="TdProyectoSubPrpyecto">
<asp:Label ID="TtituloProyecto" Text="" runat="server" /> <asp:Label ID="TtituloProyecto" Text="" runat="server" />
<asp:Label ID="TituloSubProyecto" Text="" runat="server" /> <asp:Label ID="TituloSubProyecto" Text="" runat="server" />
</th> </th>
@@ -848,7 +851,7 @@
</td> </td>
<td> <td>
<asp:TextBox ID="TxtObsPS" CssClass=" form-control input-sm txtobs" runat="server" Rows="2" TextMode="MultiLine" MaxLength="750"></asp:TextBox></td> <asp:TextBox ID="TxtObsPS" CssClass=" form-control input-sm txtobs" runat="server" Rows="2" TextMode="MultiLine" MaxLength="750"></asp:TextBox></td>
<td> <td runat="server" id="TdProyectoSubPrpyectoDdl">
<asp:DropDownList ID="DdlProyecto" CssClass=" form-control input-sm select2me" runat="server" AppendDataBoundItems="true" Style="width: 100%; max-width: 600px;" AutoPostBack="true" DataTextField="Proyecto" DataValueField="CveProyecto"> <asp:DropDownList ID="DdlProyecto" CssClass=" form-control input-sm select2me" runat="server" AppendDataBoundItems="true" Style="width: 100%; max-width: 600px;" AutoPostBack="true" DataTextField="Proyecto" DataValueField="CveProyecto">
</asp:DropDownList> </asp:DropDownList>
<asp:DropDownList ID="DdlSubProyecto" CssClass=" form-control input-sm select2me" runat="server" OnSelectedIndexChanged="DdlSubProyecto_SelectedIndexChanged" DataTextField="SubProyecto" Style="width: 100%; max-width: 600px;" DataValueField="CveSubProyecto" ValidationGroup="GrpDetalleGuardar"> <asp:DropDownList ID="DdlSubProyecto" CssClass=" form-control input-sm select2me" runat="server" OnSelectedIndexChanged="DdlSubProyecto_SelectedIndexChanged" DataTextField="SubProyecto" Style="width: 100%; max-width: 600px;" DataValueField="CveSubProyecto" ValidationGroup="GrpDetalleGuardar">
@@ -963,6 +966,7 @@
</EditItemTemplate> </EditItemTemplate>
<ItemTemplate> <ItemTemplate>
<asp:Label ID="LtlCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:#,###.######}")%>' Style="width: 100%"></asp:Label> <asp:Label ID="LtlCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:#,###.######}")%>' Style="width: 100%"></asp:Label>
<asp:TextBox ID="TxtEMCantEdit" runat="server" Text='<%# Eval("Cantidad", "{0:#,###.######}")%>' Width="45px" Height="24px" Visible="false" ></asp:TextBox>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%-- 1 --%> <%-- 1 --%>
@@ -1005,6 +1009,7 @@
<asp:TemplateField> <asp:TemplateField>
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlObsPS" runat="server" Text='<%# Eval("Observacion")%>'></asp:Literal> <asp:Literal ID="LtlObsPS" runat="server" Text='<%# Eval("Observacion")%>'></asp:Literal>
<asp:TextBox ID="TxtEMObsPS" CssClass="txtobs" runat="server" Rows="2" Text='<%# Eval("Observacion") %>' TextMode="MultiLine" MaxLength="750" Style="" Visible="false"></asp:TextBox>
</ItemTemplate> </ItemTemplate>
<EditItemTemplate> <EditItemTemplate>
<asp:TextBox ID="TxtObsPS" CssClass="txtobs" runat="server" Rows="2" Text='<%# Eval("Observacion") %>' TextMode="MultiLine" MaxLength="750" Style=""></asp:TextBox> <asp:TextBox ID="TxtObsPS" CssClass="txtobs" runat="server" Rows="2" Text='<%# Eval("Observacion") %>' TextMode="MultiLine" MaxLength="750" Style=""></asp:TextBox>
@@ -1060,6 +1065,7 @@
<asp:TemplateField> <asp:TemplateField>
<ItemTemplate> <ItemTemplate>
<asp:Label ToolTip='<%# If(Not IsDBNull(Eval("Importe")) AndAlso CDbl(Eval("Importe").ToString) <> -1, Eval("Importe"), "")%>' ID="LtlImporte" runat="server" Text='<%# If(Not IsDBNull(Eval("Importe")) AndAlso CDbl(Eval("Importe").ToString) <> -1, Eval("Importe", "{0:#,##0.00####}"), "")%>'></asp:Label> <asp:Label ToolTip='<%# If(Not IsDBNull(Eval("Importe")) AndAlso CDbl(Eval("Importe").ToString) <> -1, Eval("Importe"), "")%>' ID="LtlImporte" runat="server" Text='<%# If(Not IsDBNull(Eval("Importe")) AndAlso CDbl(Eval("Importe").ToString) <> -1, Eval("Importe", "{0:#,##0.00####}"), "")%>'></asp:Label>
<asp:TextBox ID="TxtEMImporteEdit" runat="server" CausesValidation="true" ClientIDMode="Static" MaxLength="12" Text='<%# If(Not IsDBNull(Eval("Importe")) AndAlso CDbl(Eval("Importe").ToString) <> -1, Eval("Importe", "{0:#,##0.00####}"), "")%>' ValidationGroup="grpEditar" Width="55px" Height="24px" Visible="false" ></asp:TextBox>
</ItemTemplate> </ItemTemplate>
<EditItemTemplate> <EditItemTemplate>
<asp:Literal ID="LtlImporte" runat="server" Text='<%# If(Not IsDBNull(Eval("Importe")) AndAlso CDbl(Eval("Importe").ToString) <> -1, Eval("Importe", "{0:#,##0.00####}"), "")%>' Visible="false"></asp:Literal> <asp:Literal ID="LtlImporte" runat="server" Text='<%# If(Not IsDBNull(Eval("Importe")) AndAlso CDbl(Eval("Importe").ToString) <> -1, Eval("Importe", "{0:#,##0.00####}"), "")%>' Visible="false"></asp:Literal>
@@ -1075,6 +1081,7 @@
<asp:TemplateField Visible="false"> <asp:TemplateField Visible="false">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlDescuento" runat="server" Text='<%# Eval("Descuento", "{0:N2}")%>'></asp:Literal> <asp:Literal ID="LtlDescuento" runat="server" Text='<%# Eval("Descuento", "{0:N2}")%>'></asp:Literal>
<asp:TextBox ID="TxtEMDescuentoEdit" runat="server" onkeyup="ValidaDescuentoDetalle(this);" CausesValidation="true" MaxLength="12" Text='<%# Eval("Descuento", "{0:#,##0.00####}")%>' ValidationGroup="grpEditar" Width="55px" Height="24px" Visible="false" ></asp:TextBox>
</ItemTemplate> </ItemTemplate>
<EditItemTemplate> <EditItemTemplate>
<asp:TextBox ID="TxtDescuentoEdit" runat="server" onkeyup="ValidaDescuentoDetalle(this);" CausesValidation="true" MaxLength="12" Text='<%# Eval("Descuento", "{0:#,##0.00####}")%>' ValidationGroup="grpEditar" Width="55px" Height="24px"></asp:TextBox> <asp:TextBox ID="TxtDescuentoEdit" runat="server" onkeyup="ValidaDescuentoDetalle(this);" CausesValidation="true" MaxLength="12" Text='<%# Eval("Descuento", "{0:#,##0.00####}")%>' ValidationGroup="grpEditar" Width="55px" Height="24px"></asp:TextBox>
@@ -1696,6 +1703,11 @@
<asp:UpdatePanel runat="server" ID="uppOpciones" class="portlet-body form" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="uppOpciones" class="portlet-body form" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<table> <table>
<tr>
<td style="text-align: center;">
<asp:Button runat="server" ID="BtnEdicionMasiva" Text="Edición Masiva" CssClass="btn btn-success" OnClick="BtnEdicionMasiva_Click" Width="170px" Visible="false" />
</td>
</tr>
<tr> <tr>
<td style="text-align: center;"> <td style="text-align: center;">
<asp:Panel runat="server" ID="PnlUsuarioAsignado" Visible="False"> <asp:Panel runat="server" ID="PnlUsuarioAsignado" Visible="False">

View File

@@ -39,6 +39,10 @@ Partial Class OC_OC
End Property End Property
Private Property TipoOC As String Private Property TipoOC As String
Get Get
If ViewState("TipoOC") Is Nothing Then
ViewState("TipoOC") = ""
End If
TipoOC = ViewState("TipoOC").ToString TipoOC = ViewState("TipoOC").ToString
End Get End Get
Set(value As String) Set(value As String)
@@ -606,6 +610,23 @@ Partial Class OC_OC
End Property End Property
Private Property EstaEnmodiEdicionMasiva As Boolean
Get
If ViewState("EstaEnmodiEdicionMasiva") Is Nothing Then
ViewState("EstaEnmodiEdicionMasiva") = False
End If
Return Boolean.Parse(ViewState("EstaEnmodiEdicionMasiva").ToString)
End Get
Set(value As Boolean)
ViewState("EstaEnmodiEdicionMasiva") = value
End Set
End Property
#End Region #End Region
@@ -639,6 +660,23 @@ Partial Class OC_OC
CargarCentrosDeCosto(Nothing, DdlSubProyectoEntrega, Nothing, Nothing, "Seleccione") CargarCentrosDeCosto(Nothing, DdlSubProyectoEntrega, Nothing, Nothing, "Seleccione")
If UsuarioActual.CveEmpresa = 189 Then
DdlSubProyectoGral.DataSource = GlobalDTOCEstatusUsuarios(CveEmpresaActual, UsuarioActual.CveUsuario, TipoOC).FiltraParametros("", "SubProyecto", DistinctColumns:={"CveSubProyecto", "SubProyecto"})
DdlSubProyectoGral.DataBind()
DdlSubProyectoGral.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
DdlSubProyectoGral.SelectedValueExist(UsuarioActual.CveSubProyecto)
TdProyectoSubPrpyectoDdl.Visible = False
TdProyectoSubPrpyecto.Visible = False
GvD.Columns(4).Visible = False
UPPDetalle.Update()
End If
'CARGA YA REGISTRADO 'CARGA YA REGISTRADO
If Request("OC") IsNot Nothing AndAlso IsNumeric(Request("OC")) AndAlso Request("OC").ToEntero > 0 Then If Request("OC") IsNot Nothing AndAlso IsNumeric(Request("OC")) AndAlso Request("OC").ToEntero > 0 Then
@@ -727,12 +765,21 @@ Partial Class OC_OC
End If End If
'temporal 'temporal
If UsuarioActual.CveEmpresa = 189 Then
'GlobalDTOCEstatusUsuarios(CveEmpresaActual, UsuarioActual.CveUsuario, TipoOC) 'If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
DdlSubProyectoGral.DataSource = GlobalDTOCEstatusUsuarios(CveEmpresaActual, UsuarioActual.CveUsuario, TipoOC).FiltraParametros("", "SubProyecto", DistinctColumns:={"CveSubProyecto", "SubProyecto"})
DdlSubProyectoGral.DataBind() 'If UsuarioActual.CveEmpresa = 189 Then
DdlSubProyectoGral.SelectedValueExist(UsuarioActual.CveSubProyecto) ' 'GlobalDTOCEstatusUsuarios(CveEmpresaActual, UsuarioActual.CveUsuario, TipoOC)
End If ' DdlSubProyectoGral.DataSource = GlobalDTOCEstatusUsuarios(CveEmpresaActual, UsuarioActual.CveUsuario, TipoOC).FiltraParametros("", "SubProyecto", DistinctColumns:={"CveSubProyecto", "SubProyecto"})
' DdlSubProyectoGral.DataBind()
' DdlSubProyectoGral.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
' DdlSubProyectoGral.SelectedValueExist(UsuarioActual.CveSubProyecto)
' TdProyectoSubPrpyectoDdl.Visible = False
' TdProyectoSubPrpyecto.Visible = False
' GvD.Columns(4).Visible = False
' UPPDetalle.Update()
'End If
BtnGeneraContrato.Visible = True : CargaClientesContrato() BtnGeneraContrato.Visible = True : CargaClientesContrato()
@@ -970,6 +1017,10 @@ Partial Class OC_OC
TrDescuentoProntoPago.Visible = True TrDescuentoProntoPago.Visible = True
End If End If
If UsuarioActual.Empresa.CveEmpresa = 189 AndAlso CveOrdenCompra <> Nothing AndAlso CveOrdenCompra > 0 Then
BtnEdicionMasiva.Visible = True
End If
End If End If
MostrarUsuarioAsignado() MostrarUsuarioAsignado()
@@ -1529,6 +1580,25 @@ Partial Class OC_OC
TxtPorcentajeProntoPago.Text = (100 * objOC.PorcentajeProntoPago).ToString("###.00") TxtPorcentajeProntoPago.Text = (100 * objOC.PorcentajeProntoPago).ToString("###.00")
If UsuarioActual.CveEmpresa = 189 Then
Dim existeCvesubproyecto As Boolean = False
If objOC.DtResultados.Rows(0)("CveSubProyectoGral").ToString.ToEntero > 0 Then
For Each tmpItem As ListItem In DdlSubProyectoGral.Items
If tmpItem.Value.ToEntero = objOC.DtResultados.Rows(0)("CveSubProyectoGral").ToString.ToEntero Then
existeCvesubproyecto = True
Exit For
End If
Next
End If
If Not existeCvesubproyecto Then
Dim tmpSubProyecto As String = GlobalDTSubProyectos(UsuarioActual.CveEmpresa, objOC.DtResultados.Rows(0)("CveSubProyectoGral").ToString.ToEntero, -1).FiltroPrimeroValor("SubProyecto")
DdlSubProyectoGral.Items.Add(New ListItem(tmpSubProyecto, objOC.DtResultados.Rows(0)("CveSubProyectoGral").ToString))
End If
DdlSubProyectoGral.SelectedValueExist(objOC.DtResultados.Rows(0)("CveSubProyectoGral").ToString)
End If
If Not IsNothing(objOC.Tipo) Then If Not IsNothing(objOC.Tipo) Then
Select Case objOC.Tipo.ToUpper Select Case objOC.Tipo.ToUpper
@@ -1558,7 +1628,7 @@ Partial Class OC_OC
HLGenerarVenta.Visible = True HLGenerarVenta.Visible = True
HLGenerarVenta.NavigateUrl = $"/Ventas/Ventas.aspx?CveOC={pCveOrdenCompra}" HLGenerarVenta.NavigateUrl = $"/Ventas/Ventas.aspx?CveOC={pCveOrdenCompra}"
lblFolio.Text = String.Format("OC {0}", objOC.Folio) lblFolio.Text = String.Format("OC {0}", objOC.SerieFolio)
lblTipoPadreHijo.Text = "REQ" lblTipoPadreHijo.Text = "REQ"
ChkCotizacion.Visible = False ChkCotizacion.Visible = False
@@ -1621,7 +1691,7 @@ Partial Class OC_OC
Case "REQ" Case "REQ"
ViewState("TipoOC") = objOC.Tipo ViewState("TipoOC") = objOC.Tipo
ViewState("TipoLargo") = "Requisición" ViewState("TipoLargo") = "Requisición"
lblFolio.Text = "REQ " + objOC.Folio.ToString lblFolio.Text = "REQ " + objOC.SerieFolio.ToString
lblTipoPadreHijo.Text = "OC" lblTipoPadreHijo.Text = "OC"
ChkCotizacion.Visible = True ChkCotizacion.Visible = True
DdlProveedores.SelectedValue = objOC.CveProveedor.ToString DdlProveedores.SelectedValue = objOC.CveProveedor.ToString
@@ -1643,7 +1713,7 @@ Partial Class OC_OC
Case "OS" Case "OS"
ViewState("TipoOC") = "REQ" ViewState("TipoOC") = "REQ"
ViewState("TipoLargo") = "Orden de Servicio" ViewState("TipoLargo") = "Orden de Servicio"
lblFolio.Text = "OS " + objOC.Folio.ToString lblFolio.Text = "OS " + objOC.SerieFolio.ToString
'lblTipoPadreHijo.Text = "OC" 'lblTipoPadreHijo.Text = "OC"
ChkCotizacion.Visible = True ChkCotizacion.Visible = True
TipoOS = True TipoOS = True
@@ -2245,12 +2315,24 @@ Partial Class OC_OC
#Region " AGREGAR " #Region " AGREGAR "
Protected Sub LbAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click Protected Sub LbAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click
'VALIDA CVEPS 'VALIDA CVEPS
If DdlP2.SelectedValue().ToEntero <= 0 Then If DdlP2.SelectedValue().ToEntero <= 0 Then
Alert("El campo <b>'Producto/Servicio'</b> es necesario, por favor seleccione uno.", TipoMensaje.MsgAdvertencia) Alert("El campo <b>'Producto/Servicio'</b> es necesario, por favor seleccione uno.", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
'VALIDA
If TxtDescuento.Text.ToDecimal > 0 AndAlso ((TxtCant.Text.ToDecimal * txtPrecioUnitario.Text.ToDecimal) <= TxtDescuentoAdd.Text.ToDecimal) Then
Alert($"El campo <b>'Descuento'</b> no debe ser mayor o igual al total({(TxtCant.Text.ToDecimal * txtPrecioUnitario.Text.ToDecimal).ToString("###,###,###.00")}).", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'Valida cantidad en contrato 'Valida cantidad en contrato
Dim TieneError As Boolean = False Dim TieneError As Boolean = False
Dim dttemp As New DataTable ' GlobalDTContratos().FiltraParametros(String.Format("CveSubProyecto = {0}", DdlSubProyecto.SelectedValue.ToString)) Dim dttemp As New DataTable ' GlobalDTContratos().FiltraParametros(String.Format("CveSubProyecto = {0}", DdlSubProyecto.SelectedValue.ToString))
@@ -3595,7 +3677,7 @@ Partial Class OC_OC
End If End If
If UsuarioActual.Empresa.Funcionalidad(532).Contiene("1", "2") Then If UsuarioActual.Empresa.Funcionalidad(532).Contiene("2") Then
If Not GeneraPrePolizaPresupuesto(objOrdenCompra.CveOrdenCompra, objOrdenCompra.IniciaTransacSQL) Then If Not GeneraPrePolizaPresupuesto(objOrdenCompra.CveOrdenCompra, objOrdenCompra.IniciaTransacSQL) Then
HuboError = True HuboError = True
@@ -3759,7 +3841,7 @@ Partial Class OC_OC
TieneError = True TieneError = True
End If End If
If (UsuarioActual.Empresa.Funcionalidad(532).Contiene("1", "2")) Then If (UsuarioActual.Empresa.Funcionalidad(532).Contiene("2")) Then
GeneraPrePolizaPresupuesto(CveOrdenCompra, objOrdenCompra.IniciaTransacSQL, EsCancelacion:=True) GeneraPrePolizaPresupuesto(CveOrdenCompra, objOrdenCompra.IniciaTransacSQL, EsCancelacion:=True)
End If End If
@@ -4129,6 +4211,7 @@ Partial Class OC_OC
DtDetalle.AcceptChanges() DtDetalle.AcceptChanges()
CargaDatosDetalles() CargaDatosDetalles()
ModoEdicionMasiva()
End Sub End Sub
@@ -4172,6 +4255,14 @@ Partial Class OC_OC
CveClasificacion = gvr.FCDropDownList("DdlClasificacion").SelectedValue.ToEntero CveClasificacion = gvr.FCDropDownList("DdlClasificacion").SelectedValue.ToEntero
Clasificacion = gvr.FCDropDownList("DdlClasificacion").SelectedItem.Text Clasificacion = gvr.FCDropDownList("DdlClasificacion").SelectedItem.Text
'VALIDA
If Descuento > 0 AndAlso ((Cantidad * Importe) <= Descuento) Then
Alert($"El campo <b>'Descuento'</b> no debe ser mayor o igual al total({(Cantidad * Importe).ToString("###,###,###.00")}).", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'SE TOMAN VALORES EN CASO DE QUE LA CvePS SEA DIFERENTE DE LA ANTERIOR 'SE TOMAN VALORES EN CASO DE QUE LA CvePS SEA DIFERENTE DE LA ANTERIOR
Dim CvePSAnterior As Integer = gvr.DataKey("CvePS").ToEntero Dim CvePSAnterior As Integer = gvr.DataKey("CvePS").ToEntero
PS = gvr.DataKey("PS").ToString PS = gvr.DataKey("PS").ToString
@@ -4257,13 +4348,13 @@ Partial Class OC_OC
End If End If
ObjCon.Dispose() ObjCon.Dispose()
If CvePresupuesto > 0 And Autorizado > 0 Then 'If CvePresupuesto > 0 And Autorizado > 0 Then
Dim Diferencia As Decimal = (Ejercido + Total) - Autorizado ' Dim Diferencia As Decimal = (Ejercido + Total) - Autorizado
If Diferencia > 0 Then ' If Diferencia > 0 Then
Alert($"No hay presupuesto disponible:<br/> - Subproyecto <b>{SubProyecto}</b> <br/> - Clasificación <b>{Clasificacion}</b> <br/> se excede por <b>{Diferencia.FormatoNumero}</b>", TipoMensaje.MsgAdvertencia) ' Alert($"No hay presupuesto disponible en el subproyecto <b>{SubProyecto}</b> y la clasificación <b>{Clasificacion}</b> se excede por <b>{Diferencia.FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
Exit Sub ' Exit Sub
End If ' End If
End If 'End If
End If End If
'Agarra el nuevo AF si se modifico o deja el pasado 'Agarra el nuevo AF si se modifico o deja el pasado
@@ -9241,7 +9332,7 @@ Partial Class OC_OC
Dim Respuesta As Boolean = True Dim Respuesta As Boolean = True
If UsuarioActual.Empresa.Funcionalidad(532).Contiene("1", "2") Then If UsuarioActual.Empresa.Funcionalidad(532).Contiene("2") Then
Dim CveMonedaPresupuesto As Integer = DdlMoneda.SelectedValue.ToEntero Dim CveMonedaPresupuesto As Integer = DdlMoneda.SelectedValue.ToEntero
Dim TC As Decimal = If(CveMonedaPresupuesto = 1, 1, GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal) Dim TC As Decimal = If(CveMonedaPresupuesto = 1, 1, GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal)
@@ -9330,6 +9421,7 @@ Partial Class OC_OC
Dim TotalTemp As Decimal = (PU * Cantidad) Dim TotalTemp As Decimal = (PU * Cantidad)
Dim Descuento As Decimal = 0 Dim Descuento As Decimal = 0
If descuentoParts.Length = 0 Then If descuentoParts.Length = 0 Then
Descuento = 0 Descuento = 0
Else Else
@@ -9348,7 +9440,10 @@ Partial Class OC_OC
Dim Total As Decimal = If(PU > 0, (PU * Cantidad) - Descuento, 0) Dim Total As Decimal = If(PU > 0, (PU * Cantidad) - Descuento, 0)
dRow("Descuento") = Descuento dRow("Descuento") = Descuento
If dRow("Total").ToString.ToDecimal <> Total Then
dRow("Total") = Total dRow("Total") = Total
dRow("IEPSPS") = Math.Round(IEPSPSPorcentaje * Total, 2) dRow("IEPSPS") = Math.Round(IEPSPSPorcentaje * Total, 2)
dRow("IEPSPSIVA") = Math.Round(IEPSPSIVAPorcentaje * Total, 2) dRow("IEPSPSIVA") = Math.Round(IEPSPSIVAPorcentaje * Total, 2)
@@ -9356,6 +9451,13 @@ Partial Class OC_OC
dRow("RetIVA") = (RetIVAPorcentaje * Total).RoundSQL(2) dRow("RetIVA") = (RetIVAPorcentaje * Total).RoundSQL(2)
dRow("RetISR") = (RetISRPorcentaje * Total).RoundSQL(2) dRow("RetISR") = (RetISRPorcentaje * Total).RoundSQL(2)
dRow("TipoDato") = 1
End If
Next Next
@@ -9372,5 +9474,160 @@ Partial Class OC_OC
End Sub End Sub
Protected Sub BtnEdicionMasiva_Click(sender As Object, e As EventArgs)
If BtnEdicionMasiva.Text = "Edición Masiva" Then
EstaEnmodiEdicionMasiva = True
Else
If GvD_RecalculaEdicionMasiva() Then
EstaEnmodiEdicionMasiva = False
End If
End If
ModoEdicionMasiva()
End Sub
Private Sub ModoEdicionMasiva()
If EstaEnmodiEdicionMasiva Then
BtnEdicionMasiva.Text = "Aplicar Edición Masiva"
For Each GvRow As GridViewRow In GvD.Rows
GvRow.FCTextBox("TxtEMObsPS").Visible = True
GvRow.FCTextBox("TxtEMCantEdit").Visible = True
GvRow.FCTextBox("TxtEMDescuentoEdit").Visible = True
GvRow.FCTextBox("TxtEMImporteEdit").Visible = True
GvRow.FCLabel("LtlCantidad").Visible = False
GvRow.FCLiteral("LtlObsPS").Visible = False
GvRow.FCLiteral("LtlDescuento").Visible = False
GvRow.FCLabel("LtlImporte").Visible = False
GvRow.FCLinkButton("imgE").Visible = False
'observación, PU, descuento, cantidad
Next
Else
'GvD_RecalculaEdicionMasiva()
BtnEdicionMasiva.Text = "Edición Masiva"
For Each GvRow As GridViewRow In GvD.Rows
GvRow.FCTextBox("TxtEMObsPS").Visible = False
GvRow.FCTextBox("TxtEMCantEdit").Visible = False
GvRow.FCTextBox("TxtEMDescuentoEdit").Visible = False
GvRow.FCTextBox("TxtEMImporteEdit").Visible = False
GvRow.FCLabel("LtlCantidad").Visible = True
GvRow.FCLiteral("LtlObsPS").Visible = True
GvRow.FCLiteral("LtlDescuento").Visible = True
GvRow.FCLabel("LtlImporte").Visible = True
GvRow.FCLinkButton("imgE").Visible = True
Next
End If
RegistraScript("$(document).ready(function() {setTimeout(function() {document.getElementById('DVSeccionGVD').scrollIntoView({ behavior: 'smooth' }); }, 250);});", "100")
UPPDetalle.Update()
uppOpciones.Update()
End Sub
Private Function GvD_RecalculaEdicionMasiva() As Boolean
For Each gvr As GridViewRow In GvD.Rows
Dim Cantidad, Importe, Descuento As Decimal
Cantidad = gvr.FCTextBox("TxtEMCantEdit").Text.Trim.ToDecimal
Importe = gvr.FCTextBox("TxtEMImporteEdit").Text.Trim.ToDecimal
Descuento = gvr.FCTextBox("TxtEMDescuentoEdit").Text.Trim.ToDecimal
Dim PS As String = gvr.DataKey("PS").ToString
Dim Total As Decimal = Importe * Cantidad - Descuento
'VALIDA
If Descuento > 0 AndAlso ((Cantidad * Importe) <= Descuento) Then
Alert($"El producto {PS}, cantidad {Cantidad}, el campo <b>'Descuento'</b> no debe ser mayor o igual al total({(Cantidad * Importe).ToString("###,###,###.00")}).", TipoMensaje.MsgAdvertencia)
Return False
End If
Next
For Each gvr As GridViewRow In GvD.Rows
Dim Cantidad, Importe, Descuento As Decimal
Dim CveUnidad, CveClasificacion, CvePS, CveSubProyecto, CveProyecto, CveCultivoCuadroDetalle As Integer
Dim Obs, UM, Clasificacion, PS, SubProyecto, Proyecto, Cuadro As String
Cantidad = gvr.FCTextBox("TxtEMCantEdit").Text.Trim.ToDecimal
Importe = gvr.FCTextBox("TxtEMImporteEdit").Text.Trim.ToDecimal
Descuento = gvr.FCTextBox("TxtEMDescuentoEdit").Text.Trim.ToDecimal
Obs = gvr.FCTextBox("TxtEMObsPS").Text.Trim
'
CveUnidad = gvr.DataKey("CveUnidadMedida").ToEntero
UM = gvr.FCLiteral("LA").Text
CveClasificacion = gvr.DataKey("CveClasificacion").ToEntero
Clasificacion = gvr.FCLabel("LblClasificacion").Text
'SE TOMAN VALORES EN CASO DE QUE LA CvePS SEA DIFERENTE DE LA ANTERIOR
Dim CvePSAnterior As Integer = gvr.DataKey("CvePS").ToEntero
PS = gvr.DataKey("PS").ToString
Dim RetISR As Decimal = gvr.DataKey("RetISRPorcentaje").ToDecimal
Dim RetIVA As Decimal = gvr.DataKey("RetIVAPorcentaje").ToDecimal
'Dim IvaPS = gvr.DataKey("IVAPorcentaje").ToDecimal
Dim IEPSPS As Decimal = gvr.DataKey("IEPSPSPorcentaje").ToDecimal
Dim IEPSPSIVA As Decimal = gvr.DataKey("IEPSPSIVAPorcentaje").ToDecimal
Dim Total As Decimal = Importe * Cantidad - Descuento
Dim dr As DataRow() = DtDetalle.Select("CveOrdenCompraDetalle = " & gvr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero)
dr(0)("Cantidad") = Cantidad
dr(0)("Observacion") = Obs
dr(0)("Importe") = Importe
dr(0)("Descuento") = Descuento
dr(0)("Total") = Total
dr(0)("IEPSPS") = IEPSPS * Total
dr(0)("IEPSPSPorcentaje") = IEPSPS
dr(0)("IEPSPSIVA") = IEPSPSIVA * Total
dr(0)("IEPSPSIVAPorcentaje") = IEPSPSIVA
Dim TotalGravado As Decimal = Total
If IEPSPSIVA > 0 Then TotalGravado = Total * (1 + IEPSPSIVA) 'grava para iva, el importe del IEPS
dr(0)("IVA") = Math.Round(dr(0)("IVAPorcentaje").ToString.ToDecimal * TotalGravado, 2)
dr(0)("RetIVA") = (RetIVA * Total).RoundSQL(6)
dr(0)("RetIVAPorcentaje") = RetIVA
dr(0)("RetISR") = (RetISR * Total).RoundSQL(6)
dr(0)("RetISRPorcentaje") = RetISR
'si el tipodato viene de la BD, entonces sufrió una actualización
If dr(0)("TipoDato").ToString.ToEntero = 2 Then dr(0)("TipoDato") = 1
DtDetalle.AcceptChanges()
Next
CargaDatosDetalles()
Return True
End Function
End Class End Class

View File

@@ -141,8 +141,8 @@
<Columns> <Columns>
<asp:TemplateField HeaderText="Folio" ItemStyle-Width="5%"> <asp:TemplateField HeaderText="Folio" ItemStyle-Width="5%">
<ItemTemplate> <ItemTemplate>
<asp:Label Text='<%# Eval("Folio") %>' ID="LbFolio" runat="server" Style="width: 70px!important" /> <asp:Label Text='<%# Eval("SerieFolio") %>' ID="LbFolio" runat="server" Style="width: 70px!important" />
<asp:HyperLink Text='<%# Eval("Folio") %>' ID="HLFolio" Visible="false" CssClass="Texto" Style="text-align: center" runat="server" Width="70px" /> <asp:HyperLink Text='<%# Eval("SerieFolio") %>' ID="HLFolio" Visible="false" CssClass="Texto" Style="text-align: center" runat="server" Width="70px" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>

View File

@@ -176,13 +176,38 @@ Partial Class OC_PopUpBuscarReq
Dim guia As String = If(TxtGuia.Text.Trim = "", "-1", TxtGuia.Text) Dim guia As String = If(TxtGuia.Text.Trim = "", "-1", TxtGuia.Text)
'Cargar Datos 'Cargar Datos
Dim Serie As String = "-1"
Dim Folio As Integer = -1
If TxtFolio.Text.Trim.Length = 0 Then
Serie = "-1"
Folio = -1
Else
Dim Array() As String = TxtFolio.Text.Trim.Split(CChar("-"))
If Array.Length >= 2 Then
If Array.Length = 2 Then
Serie = Array(0)
Folio = Array(1).ToEntero
End If
If Array.Length = 3 Then
Serie = Array(0) + "-" + Array(1)
Folio = Array(2).ToEntero
End If
Else
Serie = "-1"
Folio = TxtFolio.Text.Trim.ToEntero
End If
End If
If ValidarFiltrosSeleccionado() Then If ValidarFiltrosSeleccionado() Then
Dim CveProveedor As Integer = If(DdlProveedor.SelectedValue.ToEntero > 0, DdlProveedor.SelectedValue.ToEntero, -1) Dim CveProveedor As Integer = If(DdlProveedor.SelectedValue.ToEntero > 0, DdlProveedor.SelectedValue.ToEntero, -1)
Dim ObjOC As New ClsOC Dim ObjOC As New ClsOC
ObjOC.GetOrdenesCompraRep(DdlTipo.SelectedValue, CveProyecto, CveSubProyecto, -1, DdlEstatus.SelectedValue.ToEntero, FI, MaxFecha, -1, CveProveedor, ObjOC.GetOrdenesCompraRep(DdlTipo.SelectedValue, CveProyecto, CveSubProyecto, -1, DdlEstatus.SelectedValue.ToEntero, FI, MaxFecha, -1, CveProveedor,
If(TxtFolio.Text.ToEntero <= 0, -1, TxtFolio.Text.ToEntero), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Guia:=guia, Folio, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Guia:=guia,
SoloSubProyectosConPermiso:=If(UsuarioActual.Empresa.Funcionalidad(530) = "1", True, False), TopSelect:=100) SoloSubProyectosConPermiso:=If(UsuarioActual.Empresa.Funcionalidad(530) = "1", True, False), TopSelect:=100, Serie:=Serie)
Dim DtOC As Data.DataTable = ObjOC.DtResultados ' tipotermino, esattus inicial Dim DtOC As Data.DataTable = ObjOC.DtResultados ' tipotermino, esattus inicial
ObjOC.Dispose() ObjOC.Dispose()
@@ -262,7 +287,7 @@ Partial Class OC_PopUpBuscarReq
If DdlTipo.SelectedValue = "REQ" OrElse DdlTipo.SelectedValue = "OC" Then Return True If DdlTipo.SelectedValue = "REQ" OrElse DdlTipo.SelectedValue = "OC" Then Return True
If DdlEstatus.SelectedValue.ToEntero > 0 Then Return True If DdlEstatus.SelectedValue.ToEntero > 0 Then Return True
If DdlProveedor.SelectedValue.ToEntero > 0 Then Return True If DdlProveedor.SelectedValue.ToEntero > 0 Then Return True
If TxtFolio.Text.ToEntero > 0 Then Return True If TxtFolio.Text.Trim.Length > 0 Then Return True
If DdlSubProyectos.SelectedValue.ToEntero > 0 Then Return True If DdlSubProyectos.SelectedValue.ToEntero > 0 Then Return True
If DdlProyectos.SelectedValue.ToEntero > 0 Then Return True If DdlProyectos.SelectedValue.ToEntero > 0 Then Return True
Return False Return False

View File

@@ -285,7 +285,7 @@ Partial Class RepOC
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
'<asp:HyperLinkField DataNavigateUrlFields="CveOrdenCompra" ControlStyle-CssClass="Texto" DataNavigateUrlFormatString="/OC/OC.aspx?OC={0}" DataTextField="Folio" HeaderText="#"> '<asp:HyperLinkField DataNavigateUrlFields="CveOrdenCompra" ControlStyle-CssClass="Texto" DataNavigateUrlFormatString="/OC/OC.aspx?OC={0}" DataTextField="Folio" HeaderText="#">
e.Row.FCLiteral("LtlLiga").Text = String.Format("<a class=""Texto"" href=""/OC/OC.aspx?OC={0}"">{1}</a>", e.Row.DBCampo("CveOrdenCompra"), e.Row.DBCampo("Folio")) e.Row.FCLiteral("LtlLiga").Text = String.Format("<a class=""Texto"" href=""/OC/OC.aspx?OC={0}"">{1}</a>", e.Row.DBCampo("CveOrdenCompra"), e.Row.DBCampo("SerieFolio"))
e.Row.Cells(8).Attributes.Add("data-order", e.Row.DBCampo("Fecha").ToDate.Ticks.ToString) e.Row.Cells(8).Attributes.Add("data-order", e.Row.DBCampo("Fecha").ToDate.Ticks.ToString)
e.Row.Cells(15).Attributes.Add("data-order", e.Row.DBCampo("Total").ToDecimal.ToString) e.Row.Cells(15).Attributes.Add("data-order", e.Row.DBCampo("Total").ToDecimal.ToString)
@@ -301,7 +301,7 @@ Partial Class RepOC
End Select End Select
If e.Row.DBCampo("Tipo") = "OC" Then If e.Row.DBCampo("Tipo") = "OC" Then
e.Row.FCLiteral("LtlLigaReq").Text = String.Format("<a class=""Texto"" href=""/OC/OC.aspx?OC={0}"">{1}</a>", e.Row.DBCampo("CveREQ"), e.Row.DBCampo("FolioREQ")) e.Row.FCLiteral("LtlLigaReq").Text = String.Format("<a class=""Texto"" href=""/OC/OC.aspx?OC={0}"">{1}</a>", e.Row.DBCampo("CveREQ"), e.Row.DBCampo("SerieFolioREQ"))
Else Else
e.Row.FCLiteral("LtlLigaReq").Text = "" e.Row.FCLiteral("LtlLigaReq").Text = ""
End If End If
@@ -327,7 +327,7 @@ Partial Class RepOC
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
'<asp:HyperLinkField DataNavigateUrlFields="CveOrdenCompra" ControlStyle-CssClass="Texto" DataNavigateUrlFormatString="/OC/OC.aspx?OC={0}" DataTextField="Folio" HeaderText="#"> '<asp:HyperLinkField DataNavigateUrlFields="CveOrdenCompra" ControlStyle-CssClass="Texto" DataNavigateUrlFormatString="/OC/OC.aspx?OC={0}" DataTextField="Folio" HeaderText="#">
e.Row.FCLiteral("LtlLiga").Text = String.Format(" <a class=""Texto"" href=""/OC/OC.aspx?OC={0}"">{1}</a>", e.Row.DBCampo("CveOrdenCompra"), e.Row.DBCampo("Folio")) e.Row.FCLiteral("LtlLiga").Text = String.Format(" <a class=""Texto"" href=""/OC/OC.aspx?OC={0}"">{1}</a>", e.Row.DBCampo("CveOrdenCompra"), e.Row.DBCampo("SerieFolio"))
e.Row.Cells(8).Attributes.Add("data-order", e.Row.DBCampo("Fecha").ToDate.Ticks.ToString) e.Row.Cells(8).Attributes.Add("data-order", e.Row.DBCampo("Fecha").ToDate.Ticks.ToString)
e.Row.Cells(15).Attributes.Add("data-order", e.Row.DBCampo("Total").ToDecimal.ToString) e.Row.Cells(15).Attributes.Add("data-order", e.Row.DBCampo("Total").ToDecimal.ToString)
@@ -343,7 +343,7 @@ Partial Class RepOC
End Select End Select
If e.Row.DBCampo("Tipo") = "OC" Then If e.Row.DBCampo("Tipo") = "OC" Then
e.Row.FCLiteral("LtlLigaReq").Text = String.Format("<a class=""Texto"" href=""/OC/OC.aspx?OC={0}"">{1}</a>", e.Row.DBCampo("CveREQ"), e.Row.DBCampo("FolioREQ")) e.Row.FCLiteral("LtlLigaReq").Text = String.Format("<a class=""Texto"" href=""/OC/OC.aspx?OC={0}"">{1}</a>", e.Row.DBCampo("CveREQ"), e.Row.DBCampo("SerieFolioREQ"))
Else Else
e.Row.FCLiteral("LtlLigaReq").Text = "" e.Row.FCLiteral("LtlLigaReq").Text = ""
End If End If
@@ -445,7 +445,7 @@ Partial Class RepOC
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
'<asp:HyperLinkField DataNavigateUrlFields="CveOrdenCompra" ControlStyle-CssClass="Texto" DataNavigateUrlFormatString="/OC/OC.aspx?OC={0}" DataTextField="Folio" HeaderText="#"> '<asp:HyperLinkField DataNavigateUrlFields="CveOrdenCompra" ControlStyle-CssClass="Texto" DataNavigateUrlFormatString="/OC/OC.aspx?OC={0}" DataTextField="Folio" HeaderText="#">
e.Row.FCLiteral("LtlLiga").Text = String.Format("<a Class=""Texto"" href=""/OC/OC.aspx?OC={0}"">{1}</a>", e.Row.DBCampo("CveOrdenCompra"), e.Row.DBCampo("Folio")) e.Row.FCLiteral("LtlLiga").Text = String.Format("<a Class=""Texto"" href=""/OC/OC.aspx?OC={0}"">{1}</a>", e.Row.DBCampo("CveOrdenCompra"), e.Row.DBCampo("SerieFolio"))
e.Row.Cells(8).Attributes.Add("data-order", e.Row.DBCampo("Fecha").ToDate.Ticks.ToString) e.Row.Cells(8).Attributes.Add("data-order", e.Row.DBCampo("Fecha").ToDate.Ticks.ToString)
e.Row.Cells(15).Attributes.Add("data-order", e.Row.DBCampo("Total").ToDecimal.ToString) e.Row.Cells(15).Attributes.Add("data-order", e.Row.DBCampo("Total").ToDecimal.ToString)
@@ -461,7 +461,7 @@ Partial Class RepOC
End Select End Select
If e.Row.DBCampo("Tipo") = "OC" Then If e.Row.DBCampo("Tipo") = "OC" Then
e.Row.FCLiteral("LtlLigaReq").Text = String.Format("<a class=""Texto"" href=""/OC/OC.aspx?OC={0}"">{1}</a>", e.Row.DBCampo("CveREQ"), e.Row.DBCampo("FolioREQ")) e.Row.FCLiteral("LtlLigaReq").Text = String.Format("<a class=""Texto"" href=""/OC/OC.aspx?OC={0}"">{1}</a>", e.Row.DBCampo("CveREQ"), e.Row.DBCampo("SerieFolioREQ"))
Else Else
e.Row.FCLiteral("LtlLigaReq").Text = "" e.Row.FCLiteral("LtlLigaReq").Text = ""
End If End If

View File

@@ -2,6 +2,7 @@
Option Strict On Option Strict On
Imports System.Data Imports System.Data
Imports DocumentFormat.OpenXml.Spreadsheet
Imports Extensiones Imports Extensiones
Imports Microsoft.Reporting.WebForms Imports Microsoft.Reporting.WebForms
Imports MKB.TimePicker Imports MKB.TimePicker
@@ -140,9 +141,16 @@ Partial Class OS_Asignaciones
End If End If
GvNA.DataBind() GvNA.DataBind()
ObjOS.Dispose() ObjOS.Dispose()
UpOS.Update() UpOS.Update()
CargarTecnico() CargarTecnico()
End Sub End Sub
Private Sub CargaOrdenesServiciosAsignadas() Private Sub CargaOrdenesServiciosAsignadas()
Dim ObjOS As New ClsOS Dim ObjOS As New ClsOS
@@ -240,7 +248,7 @@ Partial Class OS_Asignaciones
Dim picker As MKB.TimePicker.TimeSelector = DirectCast(row.FindControl("TimeSelector"), MKB.TimePicker.TimeSelector) Dim picker As MKB.TimePicker.TimeSelector = DirectCast(row.FindControl("TimeSelector"), MKB.TimePicker.TimeSelector)
If row.FCCheckBox("ChbxAsignar").Checked Then If row.FCCheckBox("ChbxAsignar").Checked Then
time = DateTime.Parse(String.Format("{0} {1}:{2} {3}", row.FCTextBox("FechaOS").Text, picker.Hour, picker.Minute, picker.AmPm)) time = DateTime.Parse(String.Format("{0} {1}:{2} {3}", row.FCTextBox("FechaOS").Text, picker.Hour, picker.Minute, If(picker.Hour < 12, TimeSelector.AmPmSpec.AM, TimeSelector.AmPmSpec.PM)))
contadorOrdenesAsignadas += 1 contadorOrdenesAsignadas += 1
If ObjOS.GetSubProyectosEstatusInicial(DdlTecnico.SelectedValue.ToEntero, 3, UsuarioActual.CveEmpresa) Then If ObjOS.GetSubProyectosEstatusInicial(DdlTecnico.SelectedValue.ToEntero, 3, UsuarioActual.CveEmpresa) Then
@@ -557,6 +565,12 @@ Partial Class OS_Asignaciones
Dim TMSelector = DirectCast(e.Row.FindControl("TimeSelector"), TimeSelector) Dim TMSelector = DirectCast(e.Row.FindControl("TimeSelector"), TimeSelector)
TMSelector.Date = FechaCita TMSelector.Date = FechaCita
'If TMSelector.Hour = 0 And TMSelector.AmPm = TimeSelector.AmPmSpec.AM Or e.Row.DataKey("CveOS").ToEntero = 9004 Then
If FechaCita.Hour = 0 Then
Dim scripttxth As String = " $(document).ready(function() {setTimeout(function() { document.getElementById('" + TMSelector.UniqueID + "_txtHour').value = '00'; }, 100);}); "
RegistraScript(scripttxth)
End If
e.Row.Cells(10).Attributes.Add("data-order", e.Row.DBCampo("FechaCitaOS").ToDate.Ticks.ToString) e.Row.Cells(10).Attributes.Add("data-order", e.Row.DBCampo("FechaCitaOS").ToDate.Ticks.ToString)
e.Row.Cells(11).Attributes.Add("data-order", e.Row.DBCampo("FechaCitaOS").ToDate.ToString("HHmm")) e.Row.Cells(11).Attributes.Add("data-order", e.Row.DBCampo("FechaCitaOS").ToDate.ToString("HHmm"))

View File

@@ -529,7 +529,9 @@
<asp:Button ID="BtnGuardar" runat="server" Text="Guardar" ValidationGroup="GrpGuardar" CssClass="btn btn-primary" /> <asp:Button ID="BtnGuardar" runat="server" Text="Guardar" ValidationGroup="GrpGuardar" CssClass="btn btn-primary" />
<asp:Button ID="BtnGarantia" runat="server" Text="Ingresar como Garantia" Visible="false" /> <asp:Button ID="BtnGarantia" runat="server" Text="Ingresar como Garantia" Visible="false" />
<asp:Button ID="BtnEliminar" runat="server" Text="Eliminar" Visible="false" /> <asp:Button ID="BtnEliminar" runat="server" Text="Eliminar" Visible="false" />
<asp:Button ID="BtnCancelar" runat="server" Text="Cancelar" Visible="False" OnClientClick="javascript:window.location.href='/OS/CatOrdenesServicios.aspx';return false" />
<asp:Button ID="BtnCancelar" runat="server" Text="Cancelar" CssClass="btn btn-danger" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" OnClick="BtnCancelar_Click" Visible="false" />
<asp:ValidationSummary ID="VS" runat="server" DisplayMode="BulletList" ShowSummary="true" ValidationGroup="GrpGuardar" /> <asp:ValidationSummary ID="VS" runat="server" DisplayMode="BulletList" ShowSummary="true" ValidationGroup="GrpGuardar" />
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>

View File

@@ -5,6 +5,14 @@ Imports Extensiones
Imports System.IO Imports System.IO
Imports System.Data Imports System.Data
Imports System.Data.SqlClient Imports System.Data.SqlClient
Imports System.Diagnostics
Imports System.ServiceModel.Security
Imports RVCFDI.RVLTimbrado
Imports Microsoft.Owin.Security.Provider
Imports Telerik.Web.UI
Imports ADSNetLibrary.SIGAPI.Services.SAT.DescargaCFDI
Partial Class OS_OrdenesServicios Partial Class OS_OrdenesServicios
Inherits ClsPaginas Inherits ClsPaginas
@@ -470,6 +478,13 @@ Partial Class OS_OrdenesServicios
DVUsuarioAtendio3.Visible = True DVUsuarioAtendio3.Visible = True
End If End If
End If End If
If TipoEstatus.Contiene(1, 2, 3, 4) And CveVenta <= 0 And (UsuarioActual.TienePermisoProceso(370) Or UsuarioActual.TienePermisoProceso(382)) Then
BtnCancelar.Visible = True
Else
BtnGuardar.Visible = False
End If
End If End If
End Sub End Sub
@@ -911,7 +926,13 @@ Partial Class OS_OrdenesServicios
End Sub End Sub
Private Sub CargaEstatusOS() Private Sub CargaEstatusOS()
DdlEstatusOS.Items.Clear() DdlEstatusOS.Items.Clear()
If TipoEstatus = 5 Then
DdlEstatusOS.DataSource = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa) DdlEstatusOS.DataSource = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa)
DdlEstatusOS.Enabled = False
Else
DdlEstatusOS.DataSource = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltraParametros(" TipoEstatus <> 5 ")
End If
DdlEstatusOS.DataBind() DdlEstatusOS.DataBind()
'DdlEstatusOS.SelectedValue = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 1", "Orden ASC") 'DdlEstatusOS.SelectedValue = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 1", "Orden ASC")
End Sub End Sub
@@ -2565,7 +2586,7 @@ Partial Class OS_OrdenesServicios
'VALIDA LA EXISTENCIA DEL ALMACEN DE ORIGEN 'VALIDA LA EXISTENCIA DEL ALMACEN DE ORIGEN
Dim Existencia As Double Dim Existencia As Double
TextoExistencia.Append("Los siguiente productos se ajustaron por falta de exitencia:<br/>") TextoExistencia.Append("Los siguiente productos se ajustaron por falta de existencia:<br/>")
For Each dr As DataRow In TmpDTMaterialesDetalle.Rows For Each dr As DataRow In TmpDTMaterialesDetalle.Rows
Existencia = ObjInventario.GetExistenciasPS(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59")) Existencia = ObjInventario.GetExistenciasPS(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"))
@@ -3124,6 +3145,37 @@ Partial Class OS_OrdenesServicios
ProcesoOK = False ProcesoOK = False
End If End If
Dim DT_Ventas_Detalles As DataTable = DTSolicitudDev.FiltraParametros("", "", {"CantidadPedido", "CvePS", "CveVentaDetalle"})
DT_Ventas_Detalles.Columns.Add("CantidadUsada", GetType(Decimal))
DT_Ventas_Detalles.AcceptChanges()
For Each dRow As DataRow In DT_Ventas_Detalles.Rows
For Each gvRow As GridViewRow In GvMU.Rows
Dim CantidadUsada As Decimal = gvRow.FCTextBox("TxtUtilizado").Text.ToDecimal
If dRow("CvePS").ToString.ToDecimal = gvRow.DataKey("CvePS").ToDecimal AndAlso CantidadUsada > 0 Then
dRow("CantidadUsada") = dRow("CantidadUsada").ToString.ToDecimal + CantidadUsada
End If
Next
Next
For Each dRow As DataRow In DT_Ventas_Detalles.Rows
Dim CantidadUsada As Decimal = dRow("CantidadUsada").ToString.ToDecimal
If dRow("CantidadUsada").ToString.ToDecimal < dRow("CantidadPedido").ToString.ToDecimal Then
If Not ObjInventario.UpdatePedidoDetalleCantidad(dRow("CveVentaDetalle").ToString.ToEntero, CantidadUsada, 2) Then
ProcesoOK = False
Exit For
End If
End If
Next
Else Else
If ProcesoOK Then If ProcesoOK Then
Dim AplicaDevolucion As Boolean = False Dim AplicaDevolucion As Boolean = False
@@ -3151,6 +3203,9 @@ Partial Class OS_OrdenesServicios
End If End If
End If End If
End If End If
'ProcesoOK = False
Dim Respuesta As New RespuestaFacturacion() Dim Respuesta As New RespuestaFacturacion()
Dim DtVentaDetalle As New DataTable Dim DtVentaDetalle As New DataTable
Dim CveMovimientoSalida, CveMovimientoEntrada As Integer Dim CveMovimientoSalida, CveMovimientoEntrada As Integer
@@ -3287,7 +3342,7 @@ Partial Class OS_OrdenesServicios
ProcesoOK = False ProcesoOK = False
End If End If
If ProcesoOK Then If ProcesoOK Then
If Not ObjOS.UpdateVentaOS(Respuesta.CveVenta, CveOS, TxtPacienteModal.Text.Trim, TxtEpisodioModal.Text.Trim, FolioAdicional:=TxtFolioRemisionModal.Text.Trim) Then If Not ObjOS.UpdateVentaOS(Respuesta.CveVenta, CveOS, UsuarioActual.CveEmpresa, TxtPacienteModal.Text.Trim, TxtEpisodioModal.Text.Trim, FolioAdicional:=TxtFolioRemisionModal.Text.Trim) Then
ProcesoOK = False ProcesoOK = False
End If End If
End If End If
@@ -3301,7 +3356,7 @@ Partial Class OS_OrdenesServicios
If ProcesoOK Then If ProcesoOK Then
If Not ObjOS.UpdateVentaOS(-1, CveOS, TxtPacienteModal.Text.Trim, TxtEpisodioModal.Text.Trim) Then If Not ObjOS.UpdateVentaOS(-1, CveOS, UsuarioActual.CveEmpresa, TxtPacienteModal.Text.Trim, TxtEpisodioModal.Text.Trim) Then
ProcesoOK = False ProcesoOK = False
End If End If
End If End If
@@ -3407,11 +3462,51 @@ Partial Class OS_OrdenesServicios
Dim ProcesoOK As Boolean = True Dim ProcesoOK As Boolean = True
Dim CveSubProyectoPedido As Integer = -1 Dim CveSubProyectoPedido As Integer = -1
Dim CveMoneda As Integer = -1 Dim CveMoneda As Integer = -1
Dim tCveVendedor As Integer = -1
Dim CountDetalles As Integer = 0
Dim PuEnCero As Boolean = False
For Each GvRow As GridViewRow In GvMU.Rows
Dim CantidadRegistro As Decimal = GvRow.FCTextBox("TxtUtilizado").Text.ToDecimal
Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal
Dim CodigoPS As String = GvRow.DataKey("CodigoPS")
If CantidadRegistro > 0 Then
If PU > 0 Then
CountDetalles = CountDetalles + 1
Else
Alert($"Prodcuto {CodigoPS} con precio unitario en cero.", TipoMensaje.MsgAdvertencia)
PuEnCero = True
End If
End If
Next
If PuEnCero Then
Respuesta.CveVenta = -1
Respuesta.SerieFolio = ""
Respuesta.dtdetalle = New DataTable
Return Respuesta
End If
If CountDetalles = 0 Then
Respuesta.CveVenta = -1
Respuesta.SerieFolio = ""
Respuesta.dtdetalle = New DataTable
Alert("Remision sin detalles.", TipoMensaje.MsgAdvertencia)
Return Respuesta
End If
If ObjVentas.GetVenta(CvePedido, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then If ObjVentas.GetVenta(CvePedido, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then
Dim DbRowVenta As DataRow = ObjVentas.DtResultados.Copy().Rows(0) Dim DbRowVenta As DataRow = ObjVentas.DtResultados.Copy().Rows(0)
CveMoneda = DbRowVenta("CveMoneda").ToString.ToEntero CveMoneda = DbRowVenta("CveMoneda").ToString.ToEntero
CveSubProyectoPedido = DbRowVenta("CveSubProyecto").ToString().ToEntero() CveSubProyectoPedido = DbRowVenta("CveSubProyecto").ToString().ToEntero()
tCveVendedor = DbRowVenta("CveVendedor").ToString.ToEntero
End If End If
Dim ObjFactura As Modelos.Factura = Modelos.Factura.CrearVentaNueva(UsuarioActual, CveSubProyectoPedido, CveCliente, CveMoneda, "Rem") Dim ObjFactura As Modelos.Factura = Modelos.Factura.CrearVentaNueva(UsuarioActual, CveSubProyectoPedido, CveCliente, CveMoneda, "Rem")
@@ -3427,6 +3522,7 @@ Partial Class OS_OrdenesServicios
ObjFactura.Paciente = TxtPacienteModal.Text.Trim ObjFactura.Paciente = TxtPacienteModal.Text.Trim
ObjFactura.Episodio = TxtEpisodioModal.Text.Trim ObjFactura.Episodio = TxtEpisodioModal.Text.Trim
ObjFactura.Alfa1 = TxtFolioRemisionModal.Text.Trim ObjFactura.Alfa1 = TxtFolioRemisionModal.Text.Trim
ObjFactura.CveVendedor = tCveVendedor
Dim TmpDTMat As New DataTable Dim TmpDTMat As New DataTable
TmpDTMat.Columns.Add("Consec", GetType(Integer)) TmpDTMat.Columns.Add("Consec", GetType(Integer))
@@ -3576,4 +3672,58 @@ Partial Class OS_OrdenesServicios
End If End If
End If End If
End Sub End Sub
Protected Sub BtnCancelar_Click(sender As Object, e As EventArgs)
Dim CveEstatusOrdenServicioCancelacion As Integer = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", " TipoEstatus = 5 ").ToEntero
Dim CveAlmacenDevolucion As Integer
Dim CveMotivoCancelacion As Integer = GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMotivoCancelacion", "CveSATMotivoCancelacion IN (3)").ToEntero
If Not CveEstatusOrdenServicioCancelacion > 0 Then
Alert("No se encontro el esatus de cancelacion", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If Not CveMotivoCancelacion > 0 Then
Alert("No se encontro la clave el motivo de cancelacion", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim ObjFacturaCancelacion As New Modelos.Factura(UsuarioActual, CvePedido, UsuarioActual.CveEmpresa, EsCancelacion:=True, VerificaAlmacen:=True)
Try
Dim resp As Modelos.Factura.MCancelacionVentaMensaje = Nothing
If ObjFacturaCancelacion IsNot Nothing AndAlso ObjFacturaCancelacion.CveVenta > 0 Then
Dim SWatch As New Stopwatch
SWatch.Start()
Dim DevAlm As Boolean = True
ObjFacturaCancelacion.CveAlmacenDevolucion = CveAlmacenDevolucion
resp = ObjFacturaCancelacion.CancelarFactura(2, New List(Of Integer), CveMotivoCancelacion:=CveMotivoCancelacion, Motivo:="Cancelacion de Orden de servicio")
If resp.HuboError Then
Alert($"Se presento un error al cancelar la orden de servicio, {resp.Mensaje}".ToString(), TipoMensaje.MsgError)
Else
Alert($"la orden de servicio se cancelada correctamente, {resp.Mensaje}", resp.TipoMensaje, " location.reload(true); ")
Dim objGeneral As New ClsGenerales
objGeneral.AddHistorialBitacora(256, -1, -1, -1, CveOS, -1, -1, -1, "Cancelada", DdlEstatusOS.SelectedItem.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, "", "", "")
objGeneral.Dispose()
End If
End If
Catch ex As Exception
Alert("Se presento un error al cancelar la orden de servicio")
End Try
End Sub
End Class End Class

View File

@@ -1741,7 +1741,7 @@ Partial Class Ventas_PortalCliente
If GvRow.DataKey("CveVenta").ToEntero() > 0 Then If GvRow.DataKey("CveVenta").ToEntero() > 0 Then
Dim ObjFactura As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa) Dim ObjFactura As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa)
If ObjFactura IsNot Nothing Then If ObjFactura IsNot Nothing Then
Dim Resp = ObjFactura.CancelarFactura(RealizarDevolucionAlmacen:=False, ListaRemisionesCancelar:=New List(Of Integer)) Dim Resp = ObjFactura.CancelarFactura(0, ListaRemisionesCancelar:=New List(Of Integer))
Alert(Resp.Mensaje, If(Resp.HuboError, TipoMensaje.MsgError, TipoMensaje.MsgInformacion)) Alert(Resp.Mensaje, If(Resp.HuboError, TipoMensaje.MsgError, TipoMensaje.MsgInformacion))
End If End If
Else Else

View File

@@ -462,7 +462,7 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField Visible="false"> <asp:TemplateField Visible="false">
<HeaderTemplate>MetodoPago</HeaderTemplate> <HeaderTemplate>Metodo de Pago</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
&nbsp;<asp:Literal ID="LtlMetodoPago" runat="server" Text='<%# Eval("MetodoPago", "{0}") %>'></asp:Literal> &nbsp;<asp:Literal ID="LtlMetodoPago" runat="server" Text='<%# Eval("MetodoPago", "{0}") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
@@ -544,7 +544,7 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField Visible="false"> <asp:TemplateField Visible="false">
<HeaderTemplate>Ubicacion</HeaderTemplate> <HeaderTemplate>Ubicación</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlUbicacion" runat="server" Text='<%# Eval("Ubicacion") %>'></asp:Literal> <asp:Literal ID="LtlUbicacion" runat="server" Text='<%# Eval("Ubicacion") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
@@ -562,7 +562,7 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField Visible="false"> <asp:TemplateField Visible="false">
<HeaderTemplate>Direccion</HeaderTemplate> <HeaderTemplate>Dirección</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlDireccion" runat="server" Text='<%# Eval("Direccion") %>'></asp:Literal> <asp:Literal ID="LtlDireccion" runat="server" Text='<%# Eval("Direccion") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
@@ -669,6 +669,12 @@
<asp:Literal ID="LtlCLABE" runat="server" Text='<%# Eval("CLABE") %>'></asp:Literal> <asp:Literal ID="LtlCLABE" runat="server" Text='<%# Eval("CLABE") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Left" Visible="false">
<HeaderTemplate>Correo Personal</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCorreo" runat="server" Text='<%# Eval("Correo") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns> </Columns>
<RowStyle CssClass="Texto" /> <RowStyle CssClass="Texto" />
@@ -803,7 +809,7 @@
<asp:CheckBox ID="ChkPorPrimaVacacional" runat="server" Text="Por Prima Vacacional" /> <asp:CheckBox ID="ChkPorPrimaVacacional" runat="server" Text="Por Prima Vacacional" />
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<asp:CheckBox ID="ChkUbicacion" runat="server" Text="Ubicacion" /> <asp:CheckBox ID="ChkUbicacion" runat="server" Text="Ubicación" />
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<asp:CheckBox ID="ChkFechaNacimiento" runat="server" Text="Fecha Nacimiento" /> <asp:CheckBox ID="ChkFechaNacimiento" runat="server" Text="Fecha Nacimiento" />
@@ -814,7 +820,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-3"> <div class="col-md-3">
<asp:CheckBox ID="ChkDireccion" runat="server" Text="Direccion" /> <asp:CheckBox ID="ChkDireccion" runat="server" Text="Dirección" />
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<asp:CheckBox ID="ChkCP" runat="server" Text="CP" /> <asp:CheckBox ID="ChkCP" runat="server" Text="CP" />
@@ -850,6 +856,9 @@
<div class="col-md-3"> <div class="col-md-3">
<asp:CheckBox ID="ChkTipodeSalario" runat="server" Text="Tipo de salario" /> <asp:CheckBox ID="ChkTipodeSalario" runat="server" Text="Tipo de salario" />
</div> </div>
<div class="col-md-3">
<asp:CheckBox ID="ChkCorreo" runat="server" Text="Correo Personal" />
</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-3"> <div class="col-md-3">

View File

@@ -349,272 +349,55 @@ Partial Class RH_CatPersonal
#Region "P E R Z O N A L I Z A R" #Region "P E R Z O N A L I Z A R"
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click
GvDatos.Columns(0).Visible = ChkCodigo.Checked
If ChkCodigo.Checked Then GvDatos.Columns(1).Visible = ChkNombre.Checked
GvDatos.Columns(0).Visible = True GvDatos.Columns(2).Visible = ChkNSS.Checked
Else GvDatos.Columns(3).Visible = ChlRFC.Checked
GvDatos.Columns(0).Visible = False GvDatos.Columns(4).Visible = ChkTurno.Checked
End If GvDatos.Columns(5).Visible = ChkPuesto.Checked
GvDatos.Columns(6).Visible = ChkDepartamento.Checked
If ChkNombre.Checked Then GvDatos.Columns(7).Visible = ChkRuta.Checked
GvDatos.Columns(1).Visible = True GvDatos.Columns(8).Visible = ChkEscolaridad.Checked
Else GvDatos.Columns(9).Visible = ChkEstadoCivil.Checked
GvDatos.Columns(1).Visible = False GvDatos.Columns(10).Visible = ChkGenero.Checked
End If GvDatos.Columns(11).Visible = ChkEstatusPersonal.Checked
GvDatos.Columns(12).Visible = ChkSubProyecto.Checked
If ChkNSS.Checked Then GvDatos.Columns(13).Visible = ChkSupervisor.Checked
GvDatos.Columns(2).Visible = True GvDatos.Columns(14).Visible = ChkTipoPeriodo.Checked
Else GvDatos.Columns(15).Visible = ChkMetodoPago.Checked
GvDatos.Columns(2).Visible = False GvDatos.Columns(16).Visible = ChkTipoContrato.Checked
End If GvDatos.Columns(17).Visible = ChkMotivoBaja.Checked
GvDatos.Columns(18).Visible = ChkProyecto.Checked
If ChlRFC.Checked Then GvDatos.Columns(19).Visible = ChkFechaIngreso.Checked
GvDatos.Columns(3).Visible = True GvDatos.Columns(20).Visible = ChkSeInscribioSS.Checked
Else GvDatos.Columns(21).Visible = ChkSalarioDiarioPago.Checked
GvDatos.Columns(3).Visible = False GvDatos.Columns(22).Visible = ChkSalarioDiario.Checked
End If GvDatos.Columns(23).Visible = ChkSDI.Checked
GvDatos.Columns(24).Visible = ChkSalarioDiarioSS.Checked
If ChkTurno.Checked Then GvDatos.Columns(25).Visible = ChkBono.Checked
GvDatos.Columns(4).Visible = True GvDatos.Columns(26).Visible = ChkNumDiasAguinaldo.Checked
Else GvDatos.Columns(27).Visible = ChkPorPrimaVacacional.Checked
GvDatos.Columns(4).Visible = False GvDatos.Columns(28).Visible = ChkUbicacion.Checked
End If GvDatos.Columns(29).Visible = ChkFechaNacimiento.Checked
GvDatos.Columns(30).Visible = ChkLugarNacimiento.Checked
If ChkPuesto.Checked Then GvDatos.Columns(31).Visible = ChkDireccion.Checked
GvDatos.Columns(5).Visible = True GvDatos.Columns(32).Visible = ChkCP.Checked
Else GvDatos.Columns(33).Visible = ChkCiudad.Checked
GvDatos.Columns(5).Visible = False GvDatos.Columns(34).Visible = ChkEstado.Checked
End If GvDatos.Columns(35).Visible = ChkTelefono.Checked
GvDatos.Columns(36).Visible = ChkCelular.Checked
If ChkDepartamento.Checked Then GvDatos.Columns(37).Visible = ChkCURP.Checked
GvDatos.Columns(6).Visible = True GvDatos.Columns(38).Visible = ChkNombrePadre.Checked
Else GvDatos.Columns(39).Visible = ChkNombreMadre.Checked
GvDatos.Columns(6).Visible = False GvDatos.Columns(40).Visible = ChkClienteAsignado.Checked
End If GvDatos.Columns(42).Visible = ChkUsuario.Checked
GvDatos.Columns(43).Visible = ChkRiesgoPuesto.Checked
If ChkRuta.Checked Then GvDatos.Columns(44).Visible = ChkRegistroPatronal.Checked
GvDatos.Columns(7).Visible = True GvDatos.Columns(45).Visible = ChkTipodeSalario.Checked
Else
GvDatos.Columns(7).Visible = False
End If
If ChkEscolaridad.Checked Then
GvDatos.Columns(8).Visible = True
Else
GvDatos.Columns(8).Visible = False
End If
If ChkEstadoCivil.Checked Then
GvDatos.Columns(9).Visible = True
Else
GvDatos.Columns(9).Visible = False
End If
If ChkGenero.Checked Then
GvDatos.Columns(10).Visible = True
Else
GvDatos.Columns(10).Visible = False
End If
If ChkEstatusPersonal.Checked Then
GvDatos.Columns(11).Visible = True
Else
GvDatos.Columns(11).Visible = False
End If
If ChkSubProyecto.Checked Then
GvDatos.Columns(12).Visible = True
Else
GvDatos.Columns(12).Visible = False
End If
If ChkSupervisor.Checked Then
GvDatos.Columns(13).Visible = True
Else
GvDatos.Columns(13).Visible = False
End If
If ChkTipoPeriodo.Checked Then
GvDatos.Columns(14).Visible = True
Else
GvDatos.Columns(14).Visible = False
End If
If ChkMetodoPago.Checked Then
GvDatos.Columns(15).Visible = True
Else
GvDatos.Columns(15).Visible = False
End If
If ChkTipoContrato.Checked Then
GvDatos.Columns(16).Visible = True
Else
GvDatos.Columns(16).Visible = False
End If
If ChkMotivoBaja.Checked Then
GvDatos.Columns(17).Visible = True
Else
GvDatos.Columns(17).Visible = False
End If
If ChkProyecto.Checked Then
GvDatos.Columns(18).Visible = True
Else
GvDatos.Columns(18).Visible = False
End If
If ChkFechaIngreso.Checked Then
GvDatos.Columns(19).Visible = True
Else
GvDatos.Columns(19).Visible = False
End If
If ChkSeInscribioSS.Checked Then
GvDatos.Columns(20).Visible = True
Else
GvDatos.Columns(20).Visible = False
End If
If ChkSalarioDiarioPago.Checked Then
GvDatos.Columns(21).Visible = True
Else
GvDatos.Columns(21).Visible = False
End If
If ChkSalarioDiario.Checked Then
GvDatos.Columns(22).Visible = True
Else
GvDatos.Columns(22).Visible = False
End If
If ChkSDI.Checked Then
GvDatos.Columns(23).Visible = True
Else
GvDatos.Columns(23).Visible = False
End If
If ChkSalarioDiarioSS.Checked Then
GvDatos.Columns(24).Visible = True
Else
GvDatos.Columns(24).Visible = False
End If
If ChkBono.Checked Then
GvDatos.Columns(25).Visible = True
Else
GvDatos.Columns(25).Visible = False
End If
If ChkNumDiasAguinaldo.Checked Then
GvDatos.Columns(26).Visible = True
Else
GvDatos.Columns(26).Visible = False
End If
If ChkPorPrimaVacacional.Checked Then
GvDatos.Columns(27).Visible = True
Else
GvDatos.Columns(27).Visible = False
End If
If ChkUbicacion.Checked Then
GvDatos.Columns(28).Visible = True
Else
GvDatos.Columns(28).Visible = False
End If
If ChkFechaNacimiento.Checked Then
GvDatos.Columns(29).Visible = True
Else
GvDatos.Columns(29).Visible = False
End If
If ChkLugarNacimiento.Checked Then
GvDatos.Columns(30).Visible = True
Else
GvDatos.Columns(30).Visible = False
End If
If ChkDireccion.Checked Then
GvDatos.Columns(31).Visible = True
Else
GvDatos.Columns(31).Visible = False
End If
If ChkCP.Checked Then
GvDatos.Columns(32).Visible = True
Else
GvDatos.Columns(32).Visible = False
End If
If ChkCiudad.Checked Then
GvDatos.Columns(33).Visible = True
Else
GvDatos.Columns(33).Visible = False
End If
If ChkEstado.Checked Then
GvDatos.Columns(34).Visible = True
Else
GvDatos.Columns(34).Visible = False
End If
If ChkTelefono.Checked Then
GvDatos.Columns(35).Visible = True
Else
GvDatos.Columns(35).Visible = False
End If
If ChkCelular.Checked Then
GvDatos.Columns(36).Visible = True
Else
GvDatos.Columns(36).Visible = False
End If
If ChkCURP.Checked Then
GvDatos.Columns(37).Visible = True
Else
GvDatos.Columns(37).Visible = False
End If
If ChkNombrePadre.Checked Then
GvDatos.Columns(38).Visible = True
Else
GvDatos.Columns(38).Visible = False
End If
If ChkNombreMadre.Checked Then
GvDatos.Columns(39).Visible = True
Else
GvDatos.Columns(39).Visible = False
End If
If ChkClienteAsignado.Checked Then
GvDatos.Columns(40).Visible = True
Else
GvDatos.Columns(40).Visible = False
End If
If ChkUsuario.Checked Then
GvDatos.Columns(42).Visible = True
Else
GvDatos.Columns(42).Visible = False
End If
If ChkRiesgoPuesto.Checked Then
GvDatos.Columns(43).Visible = True
Else
GvDatos.Columns(43).Visible = False
End If
If ChkRegistroPatronal.Checked Then
GvDatos.Columns(44).Visible = True
Else
GvDatos.Columns(44).Visible = False
End If
If ChkTipodeSalario.Checked Then
GvDatos.Columns(45).Visible = True
Else
GvDatos.Columns(45).Visible = False
End If
GvDatos.Columns(46).Visible = ChkBanco.Checked GvDatos.Columns(46).Visible = ChkBanco.Checked
GvDatos.Columns(47).Visible = ChkCuentaBancaria.Checked GvDatos.Columns(47).Visible = ChkCuentaBancaria.Checked
GvDatos.Columns(48).Visible = ChkClaBE.Checked GvDatos.Columns(48).Visible = ChkCLABE.Checked
GvDatos.Columns(49).Visible = ChkCorreo.Checked
If (GvDatos.Rows.Count > 0) Then If (GvDatos.Rows.Count > 0) Then
GvDatos.UseAccessibleHeader = True GvDatos.UseAccessibleHeader = True

View File

@@ -434,20 +434,21 @@ Partial Class Sistemas_CatSesiones
Private Sub CargaSubProyectos() Private Sub CargaSubProyectos()
'Carga SubProyectos 'Carga SubProyectos
GlobalDTSubProyectos(UsuarioActual.CveEmpresa) = Nothing GlobalDTSubProyectos(UsuarioActual.CveEmpresa) = Nothing
Dim ObjSubProyectos As New ClsSubProyectos GlobalDTSubProyectosUsuarios(-1, -1, UsuarioActual.CveEmpresa) = Nothing
'Dim ObjSubProyectos As New ClsSubProyectos
'If ObjSubProyectos.GetSubProyectos Then 'If ObjSubProyectos.GetSubProyectos Then
' Application("GlobalDTSubProyectos") = ObjSubProyectos.DtResultados ' Application("GlobalDTSubProyectos") = ObjSubProyectos.DtResultados
'Else 'Else
' Application("GlobalDTSubProyectos") = Nothing ' Application("GlobalDTSubProyectos") = Nothing
'End If 'End If
If ObjSubProyectos.GetSubProyectosUsuarios Then 'If ObjSubProyectos.GetSubProyectosUsuarios Then
Application("GlobalDTProyectosUsuarios") = ObjSubProyectos.DtResultados.FiltraParametros("", "", {"Proyecto", "CveProyecto", "CveUsuario", "CveEmpresa", "CveEstatusProyecto"}) ' Application("GlobalDTProyectosUsuarios") = ObjSubProyectos.DtResultados.FiltraParametros("", "", {"Proyecto", "CveProyecto", "CveUsuario", "CveEmpresa", "CveEstatusProyecto"})
Application("GlobalDTSubProyectosUsuarios") = ObjSubProyectos.DtResultados ' Application("GlobalDTSubProyectosUsuarios") = ObjSubProyectos.DtResultados
Else 'Else
Application("GlobalDTProyectosUsuarios") = Nothing ' Application("GlobalDTProyectosUsuarios") = Nothing
Application("GlobalDTSubProyectosUsuarios") = Nothing ' Application("GlobalDTSubProyectosUsuarios") = Nothing
End If 'End If
ObjSubProyectos.Dispose() 'ObjSubProyectos.Dispose()
'Fin Carga Proyectos 'Fin Carga Proyectos
End Sub End Sub
@@ -591,7 +592,7 @@ Partial Class Sistemas_CatSesiones
Case "" Case ""
dt = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) dt = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
Case Else Case Else
dt = DirectCast(HttpContext.Current.Application(DdlVariable.SelectedValue & "-" & UsuarioActual.CveEmpresa), DataTable) dt = DirectCast(Application(DdlVariable.SelectedValue & "-" & UsuarioActual.CveEmpresa), DataTable)
End Select End Select
Gv.DataSource = dt Gv.DataSource = dt

View File

@@ -25,7 +25,13 @@ Partial Class Sistemas_PopUpCambiaUsuario
RegistraScript("window.close();") RegistraScript("window.close();")
End If End If
Dim DtEmp As DataTable = GlobalDTEmpresas(CveEmpresa:=-1).Copy Dim DtEmp As DataTable = Nothing '= GlobalDTEmpresas(CveEmpresa:=-1, tUsrActual:=UsuarioActual).Copy
Using ObjEmpresas As New ClsSisEmpresas()
If ObjEmpresas.GetEmpresas(-1, "-1", "-1", "-1", "-1") Then
DtEmp = ObjEmpresas.DtResultados
End If
End Using
Dim NombreEmp As String = UsuarioActual.Empresa.Empresa Dim NombreEmp As String = UsuarioActual.Empresa.Empresa
''condición para ocultar los nombres de las empresas y ponerles "mi empresa de venta (xxx)" ''condición para ocultar los nombres de las empresas y ponerles "mi empresa de venta (xxx)"
''If UsuarioActual.CveUsuario = 100 Then ''If UsuarioActual.CveUsuario = 100 Then

View File

@@ -78,7 +78,7 @@ Partial Class ListadoBoletos
If ObjRem.DtDetalle.Rows.Count > 0 Then If ObjRem.DtDetalle.Rows.Count > 0 Then
'SI SOLO TIENE UNA PARTIDA CANCELAR LA REMISION 'SI SOLO TIENE UNA PARTIDA CANCELAR LA REMISION
If ObjRem.DtDetalle.Rows.Count = 1 OrElse BoletosVigentes <= 1 Then If ObjRem.DtDetalle.Rows.Count = 1 OrElse BoletosVigentes <= 1 Then
Dim RespCancelacion = ObjRem.CancelarFactura(False, ValidarSAT:=False, CancelarBoletos:=True, ListaRemisionesCancelar:=New List(Of Integer)) Dim RespCancelacion = ObjRem.CancelarFactura(0, ValidarSAT:=False, CancelarBoletos:=True, ListaRemisionesCancelar:=New List(Of Integer))
If RespCancelacion IsNot Nothing Then If RespCancelacion IsNot Nothing Then
TieneError = RespCancelacion.HuboError TieneError = RespCancelacion.HuboError
Else Else

View File

@@ -117,7 +117,7 @@
<div class="portlet-body rowpadding"> <div class="portlet-body rowpadding">
<div class="row my-1"> <div class="row my-1">
<label class="col-md-4 bold text-primary">Folio</label> <label class="col-md-4 bold text-primary">Folio</label>
<asp:Label class="col-md-2" runat="server" ID="LbFolio" Text=""></asp:Label> <asp:TextBox class="col-md-2" runat="server" ID="TxtFolio" Text="" MaxLength="50" style="margin-left:15px" Width="120px" Height="34px"></asp:TextBox>
<div class="col-md-2"> <div class="col-md-2">
<asp:HyperLink runat="server" Text="" Target="_blank" id="HypRemision" CssClass="Texto"></asp:HyperLink> <asp:HyperLink runat="server" Text="" Target="_blank" id="HypRemision" CssClass="Texto"></asp:HyperLink>
</div> </div>

View File

@@ -148,7 +148,7 @@ Partial Class RepContratoDetalle
CveContratoTipo = Contrato.Rows(0)("CveContratoTipo").ToString.ToEntero CveContratoTipo = Contrato.Rows(0)("CveContratoTipo").ToString.ToEntero
SubProyecto = Contrato.Rows(0)("SubProyecto").ToString SubProyecto = Contrato.Rows(0)("SubProyecto").ToString
CveMasivo = Contrato.Rows(0)("CveMasivo").ToString.ToEntero CveMasivo = Contrato.Rows(0)("CveMasivo").ToString.ToEntero
LbFolio.Text = Contrato.Rows(0)("NumeroContrato").ToString TxtFolio.Text = Contrato.Rows(0)("NumeroContrato").ToString
DdlClientes.SelectedText = Contrato.Rows(0)("NombreComercial").ToString DdlClientes.SelectedText = Contrato.Rows(0)("NombreComercial").ToString
DdlClientes.SelectedValue = Contrato.Rows(0)("CveCliente").ToString DdlClientes.SelectedValue = Contrato.Rows(0)("CveCliente").ToString
@@ -267,7 +267,7 @@ Partial Class RepContratoDetalle
Response.Clear() Response.Clear()
Response.ClearHeaders() Response.ClearHeaders()
Response.ClearContent() Response.ClearContent()
Response.AddHeader("Content-Disposition", "attachment; filename=" & LbFolio.Text & $"{File.Extension}") Response.AddHeader("Content-Disposition", "attachment; filename=" & TxtFolio.Text & $"{File.Extension}")
Response.AddHeader("Content-Length", File.Length.ToString()) Response.AddHeader("Content-Length", File.Length.ToString())
'Response.ContentType = "text/plain" 'Response.ContentType = "text/plain"
Response.ContentType = "application/octet-stream" Response.ContentType = "application/octet-stream"
@@ -297,7 +297,7 @@ Partial Class RepContratoDetalle
Dim ObjContratos As New ClsContratos Dim ObjContratos As New ClsContratos
ObjContratos.IniciaTransacSQL() ObjContratos.IniciaTransacSQL()
Try Try
If ObjContratos.UpdateContratos(CveContrato, LbFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", If ObjContratos.UpdateContratos(CveContrato, TxtFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "",
DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, -1, ArchivoUpdate, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, -1, TxtImporte.Text.ToDecimal, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, -1, ArchivoUpdate, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, -1, TxtImporte.Text.ToDecimal,
DdlMoneda.SelectedValue.ToEntero, 0, CveContratoTipo:=CveContratoTipo, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveContratosEstatus:=CveContratoEstatus, Observaciones:=TxtObservaciones.Text) Then DdlMoneda.SelectedValue.ToEntero, 0, CveContratoTipo:=CveContratoTipo, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveContratosEstatus:=CveContratoEstatus, Observaciones:=TxtObservaciones.Text) Then
Alert("Contrato actualizado correctamente") Alert("Contrato actualizado correctamente")
@@ -345,7 +345,7 @@ Partial Class RepContratoDetalle
Dim dtResult As New DataTable() Dim dtResult As New DataTable()
Dim params As New List(Of ReportParameter) From { Dim params As New List(Of ReportParameter) From {
New ReportParameter("Folio", LbFolio.Text), New ReportParameter("Folio", TxtFolio.Text),
New ReportParameter("Cliente", DdlClientes.SelectedText), New ReportParameter("Cliente", DdlClientes.SelectedText),
New ReportParameter("Servicio", TxtDescripcion.Text), New ReportParameter("Servicio", TxtDescripcion.Text),
New ReportParameter("Observaciones", TxtObservaciones.Text), New ReportParameter("Observaciones", TxtObservaciones.Text),
@@ -364,7 +364,7 @@ Partial Class RepContratoDetalle
New ReportParameter("Usuario", UsuarioActual.Nombre) New ReportParameter("Usuario", UsuarioActual.Nombre)
} }
ImprimirPDFStimul($"{UsuarioActual.Empresa.Ruta}Formatos\Contrato.mrt", dtResult, params, NombreArchivo:=LbFolio.Text) ImprimirPDFStimul($"{UsuarioActual.Empresa.Ruta}Formatos\Contrato.mrt", dtResult, params, NombreArchivo:=TxtFolio.Text)
End Sub End Sub
Protected Sub AgregarABitacora(Descripcion As String) Protected Sub AgregarABitacora(Descripcion As String)
Dim ObjEventoBitacora As New ClsOIEventos Dim ObjEventoBitacora As New ClsOIEventos

View File

@@ -21,10 +21,10 @@ Partial Class ListadoContratos
#End Region #End Region
#Region "Carga Página" #Region "Carga Página"
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
txtFechaI.Text = DateTime.Now.AddMonths(-1).ToShortDateString
txtFechaF.Text = DateTime.Now.AddDays(7).ToShortDateString
If Not IsPostBack Then If Not IsPostBack Then
txtFechaI.Text = DateTime.Now.AddMonths(-1).ToShortDateString
txtFechaF.Text = DateTime.Now.AddDays(7).ToShortDateString
InicializaCombos() InicializaCombos()
CargaDatos() CargaDatos()
End If End If

View File

@@ -786,7 +786,7 @@
$('#<%=TxtCantidadPasajeros.ClientID%>').val(event.CantidadPasajeros); $('#<%=TxtCantidadPasajeros.ClientID%>').val(event.CantidadPasajeros);
$('#<%=TxtFolio.ClientID%>').val(event.NumeroContrato); $('#<%=TxtFolio.ClientID%>').val(event.NumeroContrato);
$('#<%=TxtObservaciones.ClientID%>').val(event.Observaciones); $('#<%=TxtObservaciones.ClientID%>').val(event.Observaciones);
$('#<%=TxtDescripcion.ClientID%>').val(event.title); $('#<%=TxtDescripcion.ClientID%>').val(event.description);
$('#<%=TxtUbicacion.ClientID%>').val(event.NombreAcercamiento); $('#<%=TxtUbicacion.ClientID%>').val(event.NombreAcercamiento);
if (esCalendario) { if (esCalendario) {

View File

@@ -110,14 +110,27 @@
</asp:DropDownList> </asp:DropDownList>
</div> </div>
</div> </div>
<div class="row" id="divfiltro2" runat="server" visible="false">
<div class="col-md-1 truncate" >En Demanda:</div>
<div class=" col-md-2 truncate" style="max-width: 283px!important">
<asp:DropDownList ID="DDlEnDemanda" runat="server" CssClass=" form-control input-sm select2me" ValidationGroup="GrpFiltrar" Width="100%">
<asp:ListItem Value="-1" Selected="True">Todos</asp:ListItem>
<asp:ListItem Value="1">Solo En Demanda</asp:ListItem>
<asp:ListItem Value="2">No en Demanda</asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1 truncate" >En Quebranto:</div>
<div class=" col-md-2 truncate" style="max-width: 283px!important">
<asp:DropDownList ID="DdlEnQuebranto" runat="server" CssClass=" form-control input-sm select2me" ValidationGroup="GrpFiltrar" Width="100%">
<asp:ListItem Value="-1" Selected="True">Todos</asp:ListItem>
<asp:ListItem Value="1">Solo En Quebranto</asp:ListItem>
<asp:ListItem Value="2">No En Quebranto</asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div> </div>
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>

View File

@@ -25,24 +25,10 @@ Partial Class CatClientes
If Not Page.IsPostBack Then If Not Page.IsPostBack Then
ViewState("Orden") = "" ViewState("Orden") = ""
CargaNombreClientes() Inicializa()
CargaSucursales() CargaSucursales()
CargaClasificaciones() CargaClasificaciones()
CargaVendedor() CargaVendedor()
'CargaCorporativo()
'CargaDatos()
PanelContrato.Visible = True
MPContrato.Enabled = True
Me.Form.DefaultButton = LbFiltrar.UniqueID
CargaPersonalizacion() CargaPersonalizacion()
End If End If
@@ -54,14 +40,14 @@ Partial Class CatClientes
Dim Nombre, RFC As String Dim Nombre, RFC As String
Nombre = "-1" Nombre = "-1"
RFC = "-1" RFC = "-1"
If TxtNombre.Text.Trim <> String.Empty Then Nombre = TxtNombre.Text.Trim If TxtNombre.Text.Trim <> String.Empty Then Nombre = TxtNombre.Text.Trim
If TxtRFC.Text.Trim <> String.Empty Then RFC = TxtRFC.Text.Trim If TxtRFC.Text.Trim <> String.Empty Then RFC = TxtRFC.Text.Trim
'If ObjClientes.GetClientes(-1, Nombre, "-1", "-1", RFC, "-1", "-1", DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Estatus:=DdlEstatus.SelectedValue.ToEntero, CveClienteClasificacion:=DdlClasificaciones.SelectedValue.ToEntero, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PermiteCreditoFiltro:=If(ChkPermiteCredito.Checked, 1, -1)) Then 'If ObjClientes.GetClientes(-1, Nombre, "-1", "-1", RFC, "-1", "-1", DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Estatus:=DdlEstatus.SelectedValue.ToEntero, CveClienteClasificacion:=DdlClasificaciones.SelectedValue.ToEntero, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PermiteCreditoFiltro:=If(ChkPermiteCredito.Checked, 1, -1)) Then
If ObjClientes.GetClientes(-1, Nombre, "-1", "-1", RFC, "-1", "-1", DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Estatus:=DdlEstatus.SelectedValue.ToEntero, CveClienteClasificacion:=DdlClasificaciones.SelectedValue.ToEntero, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PermiteCreditoFiltro:=DdlPermiteCredito.SelectedValue.ToEntero) Then If ObjClientes.GetClientes(-1, Nombre, "-1", "-1", RFC, "-1", "-1", DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Estatus:=DdlEstatus.SelectedValue.ToEntero, CveClienteClasificacion:=DdlClasificaciones.SelectedValue.ToEntero, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero,
PermiteCreditoFiltro:=DdlPermiteCredito.SelectedValue.ToEntero,
EnDemanda:=DDlEnDemanda.SelectedValue.ToEntero,
EnQuebranto:=DdlEnQuebranto.SelectedValue.ToEntero) Then
If ObjClientes.DtResultados.Rows.Count > 0 Then If ObjClientes.DtResultados.Rows.Count > 0 Then
DTDatos = ObjClientes.DtResultados DTDatos = ObjClientes.DtResultados
@@ -70,8 +56,6 @@ Partial Class CatClientes
Alert("No se encontraron registros con los parametros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) Alert("No se encontraron registros con los parametros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia)
End If End If
End If End If
ObjClientes.Dispose() ObjClientes.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then If ViewState("Orden").ToString() <> String.Empty Then
@@ -79,10 +63,8 @@ Partial Class CatClientes
Else Else
CargaGrid("") CargaGrid("")
End If End If
UPDatos.Update() UPDatos.Update()
End Sub End Sub
Private Sub CargaSucursales() Private Sub CargaSucursales()
@@ -96,27 +78,26 @@ Partial Class CatClientes
DdlClasificaciones.DataBind() DdlClasificaciones.DataBind()
DdlClasificaciones.Items.Insert(0, New ListItem("Todas", "-1")) DdlClasificaciones.Items.Insert(0, New ListItem("Todas", "-1"))
End Sub End Sub
Private Sub CargaNombreClientes() Private Sub Inicializa()
PanelContrato.Visible = True
MPContrato.Enabled = True
Me.Form.DefaultButton = LbFiltrar.UniqueID
DdlClienteAUnificar.setEsWebService(True) DdlClienteAUnificar.setEsWebService(True)
DdlClienteAUnificar.SelectedValue = "-1" DdlClienteAUnificar.SelectedValue = "-1"
DdlClienteAUnificar.SelectedText = "Todos" DdlClienteAUnificar.SelectedText = "Todos"
DdlClienteOriginal.setEsWebService(True) DdlClienteOriginal.setEsWebService(True)
DdlClienteOriginal.SelectedValue = "-1" DdlClienteOriginal.SelectedValue = "-1"
DdlClienteOriginal.SelectedText = "Todos" DdlClienteOriginal.SelectedText = "Todos"
'DdlClienteAUnificar.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) If UsuarioActual.CveEmpresa = 119 Then
'DdlClienteAUnificar.DataBind() divfiltro2.Visible = True
End If
'DdlClienteOriginal.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
'DdlClienteOriginal.DataBind()
UpBodyUnificar.Update() UpBodyUnificar.Update()
End Sub End Sub
Private Sub CargaVendedor() Private Sub CargaVendedor()
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa) DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
DdlVendedor.DataBind() DdlVendedor.DataBind()
@@ -127,13 +108,8 @@ Partial Class CatClientes
CargaDatos() CargaDatos()
End Sub End Sub
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
GvDatos.ExportToExcel("RepClientes_" & NowADS().ToShortDateString) GvDatos.ExportToExcel("RepClientes_" & NowADS().ToShortDateString)
End Sub End Sub
@@ -261,7 +237,7 @@ Partial Class CatClientes
End If End If
ObjCliente.Dispose() ObjCliente.Dispose()
CargaNombreClientes() Inicializa()
CargaDatos() CargaDatos()
End Sub End Sub
#End Region #End Region
@@ -276,8 +252,7 @@ Partial Class CatClientes
GuardaPersonalizacion() GuardaPersonalizacion()
End If End If
Personaliza() Personaliza(True)
End Sub End Sub
@@ -411,7 +386,6 @@ Partial Class CatClientes
End If End If
If objUsuario.AddUsuariosPersonalizaciones(UsuarioActual, "CatClientes.aspx", String.Join("|", ListPersonalizada)) Then If objUsuario.AddUsuariosPersonalizaciones(UsuarioActual, "CatClientes.aspx", String.Join("|", ListPersonalizada)) Then
'Alert("Personalizacion guardada") 'Alert("Personalizacion guardada")
End If End If
@@ -420,13 +394,12 @@ Partial Class CatClientes
End Sub End Sub
Private Sub CargaPersonalizacion() Private Sub CargaPersonalizacion(Optional RecargaDatos As Boolean = False)
Dim strBasePersonalizacion As String = UsuarioActual.Personalizaciones("CatClientes.aspx") Dim strBasePersonalizacion As String = UsuarioActual.Personalizaciones("CatClientes.aspx")
If strBasePersonalizacion.Trim.Length > 0 Then If strBasePersonalizacion.Trim.Length > 0 Then
ChkCodigo.Checked = False ChkCodigo.Checked = False
ChkNombre.Checked = False ChkNombre.Checked = False
ChkRFC.Checked = False ChkRFC.Checked = False
@@ -564,7 +537,7 @@ Partial Class CatClientes
Next Next
Personaliza() Personaliza(RecargaDatos)
Else Else
PersonalizaDefault() PersonalizaDefault()
@@ -577,7 +550,7 @@ Partial Class CatClientes
Private Sub PersonalizaDefault() Private Sub PersonalizaDefault()
End Sub End Sub
Private Sub Personaliza() Private Sub Personaliza(Optional RecargaDatos As Boolean = False)
GvDatos.Columns(0).Visible = ChkCodigo.Checked GvDatos.Columns(0).Visible = ChkCodigo.Checked
@@ -614,8 +587,7 @@ Partial Class CatClientes
GvDatos.Columns(28).Visible = ChkPermiteCredito.Checked GvDatos.Columns(28).Visible = ChkPermiteCredito.Checked
GvDatos.Columns(29).Visible = chkFechaLimiteCredito.Checked GvDatos.Columns(29).Visible = chkFechaLimiteCredito.Checked
If RecargaDatos Then CargaDatos()
CargaDatos()
UPDatos.Update() UPDatos.Update()
End Sub End Sub

View File

@@ -0,0 +1,94 @@
<%@ Page Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="True" CodeFile="CatPSSubProyectosVendedores.aspx.vb" Inherits="Ventas_CatPSSubProyectosVendedores" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catalogo de Productos/Servicios, SubProyectos y Vendedores
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAgregar" OnClick="LnkAgregar_Click" runat="server"><i class="fa fa-plus"></i>Agregar</asp:LinkButton></li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvPSSubProyectosVendedores.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvPSSubProyectosVendedores.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<br />
<asp:GridView ID="GvPSSubProyectosVendedores" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="100%" AutoGenerateColumns="False"
DataKeyNames="CvePS,CodigoPS,CveSubProyecto,SubProyecto,CveVendedor,Vendedor" >
<Columns>
<asp:TemplateField HeaderText="PS" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblps" runat="server" Text='<%# Eval("CodigoPS")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SubProyecto" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblsubproyecto" runat="server" Text='<%# Eval("SubProyecto")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Vendedor" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblvendedor" runat="server" Text='<%# Eval("Vendedor")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" OnClick="LnkEliminar_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModalAdd" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAdd" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltltitulo" Text="Productos/Servicios, SubProyectos y Vendedores" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width:100%" CssClass="form-control input-sm DdlPS" CssClassDdl="select2me" DataTextField="PSCodigo" DataValueField="CvePS" />
<label for="<%= DdlPS.ClientID.ToString()%>">
Productos / Servicio:<label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlSubProyecto" CssClass="form-control input-sm select2me" Width="100%" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto"></asp:DropDownList>
<label for="<%= DdlSubProyecto.ClientID.ToString()%>">SubProyecto:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlVendedor" DataTextField="Vendedor" DataValueField="CveVendedor" CausesValidation="true" runat="server" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me"></asp:DropDownList>
<label for="<%= DdlVendedor.ClientID.ToString()%>">Vendedor:</label>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnAdd" OnClick="BtnAdd_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,107 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Ventas_CatPSSubProyectosVendedores
Inherits ClsPaginas
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
If Not IsPostBack Then
CargaDatos()
CargaCombos()
End If
End Sub
Protected Sub CargaDatos()
Dim ObjVentas As ClsVentas = New ClsVentas()
If ObjVentas.GetPSSubProyectosVendedores(UsuarioActual.CveEmpresa) Then
GvPSSubProyectosVendedores.DataSource = ObjVentas.DtResultados
GvPSSubProyectosVendedores.DataBind()
End If
ObjVentas.Dispose()
UpDatos.Update()
End Sub
Protected Sub CargaCombos()
DdlPS.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
DdlPS.SelectedText = ""
DdlPS.SelectedValue = "-1"
Else
DdlPS.ddl.Items.Clear()
DdlPS.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
DdlPS.ddl.DataBind()
DdlPS.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
End If
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
DdlVendedor.DataBind()
DdlVendedor.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlSubProyecto.DataSource = GlobalDTSubProyectos(UsuarioActual.CveEmpresa)
DdlSubProyecto.DataBind()
DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
UpModalAdd.Update()
End Sub
Protected Sub LimpiaRegistro()
DdlPS.SelectedValue = "-1"
DdlPS.SelectedText = ""
DdlVendedor.SelectedIndex = 0
DdlSubProyecto.SelectedIndex = 0
UpModalAdd.Update()
End Sub
Protected Sub LnkAgregar_Click(ByVal sender As Object, ByVal e As EventArgs)
RegistraScript("$('#DModalAdd').modal();")
LimpiaRegistro()
UpModalAdd.Update()
End Sub
Protected Sub BtnAdd_Click(ByVal sender As Object, ByVal e As EventArgs)
If DdlPS.SelectedValue = "" Then
Alert("Tiene que seleccionar un producto/servicio.")
Return
End If
If DdlVendedor.SelectedValue = "-1" Then
Alert("Tiene que seleccionar un vendedor.")
Return
End If
If DdlSubProyecto.SelectedValue = "-1" Then
Alert("Tiene que seleccionar un subproyecto.")
Return
End If
Dim ObjVentas As ClsVentas = New ClsVentas()
Dim Continuar As Boolean = ObjVentas.AddPSSubProyectosVendedores(DdlPS.SelectedValue.ToEntero(), DdlSubProyecto.SelectedValue.ToEntero(), DdlVendedor.SelectedValue.ToEntero())
ObjVentas.Dispose()
If Continuar Then
RegistraScript("$('#DModalAdd').modal('hide');")
LimpiaRegistro()
Alert("El registro se ha agregado")
CargaDatos()
End If
End Sub
Protected Sub LnkEliminar_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim gvRow As GridViewRow = CType(((CType(sender, LinkButton)).NamingContainer), GridViewRow)
Dim ObjVentas As ClsVentas = New ClsVentas()
Dim Continuar As Boolean = ObjVentas.RemovePSSubProyectosVendedores(gvRow.DataKey("CvePS").ToEntero(), gvRow.DataKey("CveSubProyecto").ToEntero(), gvRow.DataKey("CveVendedor").ToEntero())
ObjVentas.Dispose()
If Continuar Then
CargaDatos()
Alert("El registro se ha eliminado")
End If
End Sub
End Class

View File

@@ -124,7 +124,7 @@ Partial Class CatUnidadesMedida
If ObjUnidadesMedida.RemoveUnidadMedidaAlias(cve, nombrealias) Then If ObjUnidadesMedida.RemoveUnidadMedidaAlias(cve, nombrealias) Then
GvAlias.EditIndex = -1 GvAlias.EditIndex = -1
GlobalDTUnidadesMedidaAlias = ObjUnidadesMedida.DtResultados GlobalDTUnidadesMedidaAlias(UsuarioActual.CveEmpresa) = Nothing
ViewState("DTUnidadesMedidaAlias") = ObjUnidadesMedida.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa).FiltraParametros("CveUnidadMedida = " & cve) ViewState("DTUnidadesMedidaAlias") = ObjUnidadesMedida.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa).FiltraParametros("CveUnidadMedida = " & cve)
Alert("La Unidad de Medida se eliminó correctamente.", TipoMensaje.MsgInformacion) Alert("La Unidad de Medida se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If End If

View File

@@ -693,6 +693,12 @@
<asp:CheckBox ID="ChkRequiereOC" runat="server" CssClass="make-switchsd" data-size="small" Text="" ClientIDMode="Static" /> <asp:CheckBox ID="ChkRequiereOC" runat="server" CssClass="make-switchsd" data-size="small" Text="" ClientIDMode="Static" />
</div> </div>
</div> </div>
<div class="row" id="DivAseguradora" runat="server" visible="false">
<div class="form-group col-md-6">
<label>Aseguradora: </label>
<asp:CheckBox ID="ChkAseguradora" runat="server" CssClass="make-switchsd" data-size="small" Text="" ClientIDMode="Static" />
</div>
</div>
<div class="row"> <div class="row">
<div class=" col-md-6"> <div class=" col-md-6">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
@@ -1200,7 +1206,8 @@
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group form-md-line-input"> <div class="form-group form-md-line-input">
<asp:TextBox ID="TxtGastosEnvio" CssClass="form-control" runat="server"></asp:TextBox> <asp:TextBox ID="TxtGastosEnvio" CssClass="form-control" runat="server"></asp:TextBox>
<label for="<%= TxtGastosEnvio.ClientID.ToString()%>">$ Envío:</label></div> <label for="<%= TxtGastosEnvio.ClientID.ToString()%>">$ Envío:</label>
</div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@@ -1736,7 +1743,8 @@
<div class="portlet-title"> <div class="portlet-title">
<div class="caption font-green"> <div class="caption font-green">
<i class="icon-pin font-green"></i> <i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Parametros</span> <span class="caption-subject bold uppercase">Crédito</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Label ID="LblAlertaQuebranto" runat="server" Font-Bold="true" ForeColor="#CC0000"></asp:Label>
</div> </div>
<div class="tools"> <div class="tools">
@@ -1836,7 +1844,7 @@
</div> </div>
</div> </div>
<div> <div>
<label for="<%= TxtDocumentacion.ClientID.ToString()%>">Documentación:</label> <label for="<%= TxtDocumentacion.ClientID.ToString()%>">Observaciones:</label>
<asp:TextBox ID="TxtDocumentacion" CssClass="form-control" runat="server" Rows="3"></asp:TextBox> <asp:TextBox ID="TxtDocumentacion" CssClass="form-control" runat="server" Rows="3"></asp:TextBox>
</div> </div>
<div class="row" id="DivDiasRevision" runat="server" visible="false"> <div class="row" id="DivDiasRevision" runat="server" visible="false">
@@ -1864,6 +1872,16 @@
<asp:TextBox ID="TxtObsDiasRevision" runat="server" CssClass="form-control" Enabled="false"></asp:TextBox> <asp:TextBox ID="TxtObsDiasRevision" runat="server" CssClass="form-control" Enabled="false"></asp:TextBox>
<label for="<%= TxtObsDiasRevision.ClientID.ToString()%>">Documentación Revisión: </label> <label for="<%= TxtObsDiasRevision.ClientID.ToString()%>">Documentación Revisión: </label>
</div> </div>
<div class="row" runat="server" id="divQuebranto1" visible="false">
<div class="col-md-12">
<div class="col-md-4">
<asp:CheckBox ID="ChkEnQuebranto" runat="server" Text="En Quebranto" />
</div>
<div class="col-md-4">
<asp:CheckBox ID="ChkEnDemanda" runat="server" Text="En Demanda" />
</div>
</div>
</div>
</div> </div>
@@ -1937,6 +1955,14 @@
</div> </div>
</div> </div>
<div class="row" runat="server" id="divQuebranto2" visible="false">
<div class="col-md-12">
<label class="col-md-1 " style="width: 120px; text-align: right">Registro Firmas:</label>
<div class="col-md-2" style="width: 250px">
<asp:TextBox ID="TxtNombreFirmas" runat="server" Width="250px"></asp:TextBox>
</div>
</div>
</div>
</div> </div>
@@ -2318,8 +2344,8 @@
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Autorización" ItemStyle-HorizontalAlign="Center" Visible="false"> <asp:TemplateField HeaderText="Autorización" ItemStyle-HorizontalAlign="Center" Visible="false">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="LnkAutorizar" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" tooltip="Autorizar Anticipo" runat="server" OnClick="LnkAutorizarAnticipo_Click" /> <asp:LinkButton ID="LnkAutorizar" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ToolTip="Autorizar Anticipo" runat="server" OnClick="LnkAutorizarAnticipo_Click" />
<asp:LinkButton ID="LnkCancelar" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-ban'></i>" tooltip="Bloquear Anticipo" runat="server" OnClick="LnkCancelarAnticipo_Click" /> <asp:LinkButton ID="LnkCancelar" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-ban'></i>" ToolTip="Bloquear Anticipo" runat="server" OnClick="LnkCancelarAnticipo_Click" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>
@@ -4632,20 +4658,7 @@
<div class="row "> <div class="row ">
<div class="col-md-12"> <div class="col-md-12">
<div class="row ">
<div class="col-md-12">
<div class="col-md-2" >
<asp:CheckBox ID="ChkEnQuebranto" runat="server" Text="En Quebranto" />
</div>
<div class="col-md-2" >
<asp:CheckBox ID="ChkEnDemanda" runat="server" Text="En Demanda" />
</div>
<label class="col-md-1 " style="width: 120px; text-align: right">Registro Firmas:</label>
<div class="col-md-2" style="width: 250px">
<asp:TextBox ID="TxtNombreFirmas" runat="server" Width="250px"></asp:TextBox>
</div>
</div>
</div>
<div class="row "> <div class="row ">
<div class=" col-md-12" style="text-align: right!important"> <div class=" col-md-12" style="text-align: right!important">
<input type="text" id="TxtBuscarLineaAdicional" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBuscarLineaAdicional','{0}')", GvLineasAdicionales.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" /> <input type="text" id="TxtBuscarLineaAdicional" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBuscarLineaAdicional','{0}')", GvLineasAdicionales.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
@@ -5307,7 +5320,6 @@
</div> </div>
<div class="row" style="padding-left: 16px"> <div class="row" style="padding-left: 16px">
<div class="form-group form-md-line-input input-iconright col-xs-6" runat="server" id="Div4" visible="false"> <div class="form-group form-md-line-input input-iconright col-xs-6" runat="server" id="Div4" visible="false">
</div> </div>
<div class="form-group form-md-line-input input-iconright col-xs-6"> <div class="form-group form-md-line-input input-iconright col-xs-6">
<div id="DivEstatusSucursal" visible="false" runat="server" class="form-group form-md-line-input input-iconright col-xs-12"> <div id="DivEstatusSucursal" visible="false" runat="server" class="form-group form-md-line-input input-iconright col-xs-12">
@@ -6972,14 +6984,9 @@
<asp:ListItem Text="Cerrado" Value="0"></asp:ListItem> <asp:ListItem Text="Cerrado" Value="0"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
<label for="<%= DdlLAEstatus.ClientID.ToString()%>">Estatus:</label> <label for="<%= DdlLAEstatus.ClientID.ToString()%>">Estatus:</label>
</div
</div> </div>
</div> </div>
</div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<asp:UpdatePanel runat="server"> <asp:UpdatePanel runat="server">

View File

@@ -742,7 +742,6 @@ Partial Class Clientes
End If End If
divRegimen.Visible = True divRegimen.Visible = True
If UsuarioActual.CveEmpresa.Contiene(1) Or UsuarioActual.Empresa.Funcionalidad(531) = "1" Then If UsuarioActual.CveEmpresa.Contiene(1) Or UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
@@ -920,6 +919,8 @@ Partial Class Clientes
TabLineasAdicionales.Visible = True TabLineasAdicionales.Visible = True
LnkAgregarLineaAdicional.Visible = True LnkAgregarLineaAdicional.Visible = True
GetLineasAdicionales() GetLineasAdicionales()
divQuebranto1.Visible = True
divQuebranto2.Visible = True
End If End If
If UsuarioActual.Empresa.Funcionalidad(109) <> "1" Then If UsuarioActual.Empresa.Funcionalidad(109) <> "1" Then
@@ -931,6 +932,11 @@ Partial Class Clientes
ChkPermiso4.Enabled = False ChkPermiso4.Enabled = False
ChkPermiso5.Enabled = False ChkPermiso5.Enabled = False
ChkPermiso6.Enabled = False ChkPermiso6.Enabled = False
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
DivAseguradora.Visible = True
End If
End If End If
@@ -1543,6 +1549,7 @@ Partial Class Clientes
ChkRequiereOC.Checked = ObjClientes.RequiereOC ChkRequiereOC.Checked = ObjClientes.RequiereOC
ChkEsDistribuidor.Checked = Boolean.Parse(ObjClientes.DtResultados(0)("EsDistribuidor").ToString()) ChkEsDistribuidor.Checked = Boolean.Parse(ObjClientes.DtResultados(0)("EsDistribuidor").ToString())
CobranzaTelefono = ObjClientes.CobranzaTelefono CobranzaTelefono = ObjClientes.CobranzaTelefono
ChkAseguradora.Checked = ObjClientes.Aseguradora
If ObjClientes.DtResultados(0)("Genero").ToString().Length > 0 Then If ObjClientes.DtResultados(0)("Genero").ToString().Length > 0 Then
DdlGeneroCliente.SelectedValueExist(If(Boolean.Parse(ObjClientes.DtResultados(0)("Genero").ToString()), 1, 0)) DdlGeneroCliente.SelectedValueExist(If(Boolean.Parse(ObjClientes.DtResultados(0)("Genero").ToString()), 1, 0))
@@ -1689,22 +1696,18 @@ Partial Class Clientes
'Horario 'Horario
TxtHorario.Text = ObjClientes.Horario TxtHorario.Text = ObjClientes.Horario
TxtObsDiasRevision.Text = ObjClientes.ObservacionRevision TxtObsDiasRevision.Text = ObjClientes.ObservacionRevision
TxtReferenciaFiscal.Text = ObjClientes.ReferenciaFiscal TxtReferenciaFiscal.Text = ObjClientes.ReferenciaFiscal
TxtCelular.Text = ObjClientes.Celular TxtCelular.Text = ObjClientes.Celular
TxtExtOtro.Text = ObjClientes.ExtOtros TxtExtOtro.Text = ObjClientes.ExtOtros
'If UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122, 145) Then
' ActivarRegistroAutomatico()
'End If
ChkEnQuebranto.Checked = ObjClientes.EnQuebranto ChkEnQuebranto.Checked = ObjClientes.EnQuebranto
ChkEnDemanda.Checked = ObjClientes.EnDemanda ChkEnDemanda.Checked = ObjClientes.EnDemanda
TxtNombreFirmas.Text = ObjClientes.CreditoRegistroFirmas TxtNombreFirmas.Text = ObjClientes.CreditoRegistroFirmas
If ObjClientes.EnQuebranto Then LblAlertaQuebranto.Text = " En Quebranto "
If ObjClientes.EnDemanda Then LblAlertaQuebranto.Text &= " En Demanda "
'7eleven '7eleven
TxtProveedor.Text = ObjClientes.SevenEleven_NumProveedor TxtProveedor.Text = ObjClientes.SevenEleven_NumProveedor
@@ -1851,6 +1854,23 @@ Partial Class Clientes
GvCxCHistorial.DataSource = dt.AsEnumerable().Take(22).CopyToDataTable() GvCxCHistorial.DataSource = dt.AsEnumerable().Take(22).CopyToDataTable()
End If End If
Retorno = True Retorno = True
If UsuarioActual.CveEmpresa.Contiene(119, 158) Then
Dim tdtt As DataTable = DtCxCActivas.FiltraParametros("DiasVencidos > 0")
If tdtt.Rows.Count > 0 Then
Dim tstr As String = "Facturas con vencimiento: <br/>"
Dim tdtsaldo As DataTable = tdtt.FiltraParametros("CveMoneda = 1")
If tdtsaldo.Rows.Count > 0 Then
tstr &= tdtt.Rows.Count & $" - ${tdtsaldo.SUM("Saldo").FormatoNumero} Pesos.<br/>"
End If
tdtsaldo = tdtt.FiltraParametros("CveMoneda = 2")
If tdtsaldo.Rows.Count > 0 Then
tstr &= tdtsaldo.Rows.Count & $" - ${tdtsaldo.SUM("Saldo").FormatoNumero} Dólares.<br/>"
End If
Alert(tstr, TipoMensaje.MsgAdvertencia)
End If
End If
Else Else
GvCxC.DataSource = Nothing GvCxC.DataSource = Nothing
DtCxCActivas = Nothing DtCxCActivas = Nothing
@@ -2590,7 +2610,7 @@ Partial Class Clientes
ComExtEstado:=IIf(TxtComExtEstado.Text = "", "-1", TxtComExtEstado.Text).ToString(), ComExtMunicipio:=IIf(TxtComExtMunicipio.Text = "", "-1", TxtComExtMunicipio.Text).ToString(), ComExtColonia:=IIf(TxtComExtColonia.Text = "", "-1", TxtComExtColonia.Text).ToString(), RequiereOC:=ChkRequiereOC.Checked, LT:=LT, LG:=LG, EsDistribuidor:=ChkEsDistribuidor.Checked, ComExtEstado:=IIf(TxtComExtEstado.Text = "", "-1", TxtComExtEstado.Text).ToString(), ComExtMunicipio:=IIf(TxtComExtMunicipio.Text = "", "-1", TxtComExtMunicipio.Text).ToString(), ComExtColonia:=IIf(TxtComExtColonia.Text = "", "-1", TxtComExtColonia.Text).ToString(), RequiereOC:=ChkRequiereOC.Checked, LT:=LT, LG:=LG, EsDistribuidor:=ChkEsDistribuidor.Checked,
TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero(), CargoUsado:=ChkCargoUsado.Checked, BonificacionUsado:=ChkBonificacionUsado.Checked, CveTipoRetencion:=DdlTipoRetencion.SelectedValue.ToEntero(), CorreoEntregaCompras:=TxtCorreoEntregaCompras.Text, CorreoEntregaAlmacen:=TxtCorreoEntregaAlmacen.Text, CveSATEstado:=DdlEstadoSAT.SelectedValue.ToEntero(), CveAdminTrayecto:=If(DdlAdminTrayecto.SelectedValue.ToEntero() <= 0, 0, DdlAdminTrayecto.SelectedValue.ToEntero()), TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero(), CargoUsado:=ChkCargoUsado.Checked, BonificacionUsado:=ChkBonificacionUsado.Checked, CveTipoRetencion:=DdlTipoRetencion.SelectedValue.ToEntero(), CorreoEntregaCompras:=TxtCorreoEntregaCompras.Text, CorreoEntregaAlmacen:=TxtCorreoEntregaAlmacen.Text, CveSATEstado:=DdlEstadoSAT.SelectedValue.ToEntero(), CveAdminTrayecto:=If(DdlAdminTrayecto.SelectedValue.ToEntero() <= 0, 0, DdlAdminTrayecto.SelectedValue.ToEntero()),
CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text, ComExtCalle:=TxtComExtCalle.Text.Trim(), ComExtNumExt:=TxtComExtNumero.Text.Trim(), ComExtCP:=TxtComExtCP.Text.Trim(), FechaLimiteCredito:=FechaLimiteCredito, Genero:=GeneroCliente, CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text, ComExtCalle:=TxtComExtCalle.Text.Trim(), ComExtNumExt:=TxtComExtNumero.Text.Trim(), ComExtCP:=TxtComExtCP.Text.Trim(), FechaLimiteCredito:=FechaLimiteCredito, Genero:=GeneroCliente,
CveAlmacenAsignado:=DdlAlmacenAsignado.SelectedValue.ToEntero, CveAlmacenAlterno:=DdlAlmacenAlterno.SelectedValue.ToEntero, UsaProductoAlterno:=ChkProductoAlterno.Checked, EsFilial:=ChkEsFilial.Checked, GastosEnvio:=TxtGastosEnvio.Text.ToDecimal) Then CveAlmacenAsignado:=DdlAlmacenAsignado.SelectedValue.ToEntero, CveAlmacenAlterno:=DdlAlmacenAlterno.SelectedValue.ToEntero, UsaProductoAlterno:=ChkProductoAlterno.Checked, EsFilial:=ChkEsFilial.Checked, GastosEnvio:=TxtGastosEnvio.Text.ToDecimal, Aseguradora:=ChkAseguradora.Checked) Then
CveClienteNuevo = ObjClientes.CveCliente CveClienteNuevo = ObjClientes.CveCliente
@@ -2675,7 +2695,7 @@ Partial Class Clientes
CveAdminTrayecto:=If(DdlAdminTrayecto.SelectedValue.ToEntero() <= 0, 0, DdlAdminTrayecto.SelectedValue.ToEntero()), CveAdminTrayecto:=If(DdlAdminTrayecto.SelectedValue.ToEntero() <= 0, 0, DdlAdminTrayecto.SelectedValue.ToEntero()),
NoDesglosaIVA:=Not ChkNoDesglosaIVA.Checked, CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text, ComExtCalle:=TxtComExtCalle.Text.Trim(), ComExtNumExt:=TxtComExtNumero.Text.Trim(), ComExtCP:=TxtComExtCP.Text.Trim(), FechaLimiteCredito:=FechaLimiteCredito, NoDesglosaIVA:=Not ChkNoDesglosaIVA.Checked, CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text, ComExtCalle:=TxtComExtCalle.Text.Trim(), ComExtNumExt:=TxtComExtNumero.Text.Trim(), ComExtCP:=TxtComExtCP.Text.Trim(), FechaLimiteCredito:=FechaLimiteCredito,
Genero:=GeneroCliente, CveAlmacenAsignado:=DdlAlmacenAsignado.SelectedValue.ToEntero, CveAlmacenAlterno:=DdlAlmacenAlterno.SelectedValue.ToEntero, UsaProductoAlterno:=ChkProductoAlterno.Checked, Genero:=GeneroCliente, CveAlmacenAsignado:=DdlAlmacenAsignado.SelectedValue.ToEntero, CveAlmacenAlterno:=DdlAlmacenAlterno.SelectedValue.ToEntero, UsaProductoAlterno:=ChkProductoAlterno.Checked,
EnQuebranto:=ChkEnQuebranto.Checked, EnDemanda:=ChkEnDemanda.Checked, CreditoRegistroFirmas:=TxtNombreFirmas.Text.Trim, EsFilial:=ChkEsFilial.Checked, GastosEnvio:=TxtGastosEnvio.Text.ToDecimal) Then EnQuebranto:=ChkEnQuebranto.Checked, EnDemanda:=ChkEnDemanda.Checked, CreditoRegistroFirmas:=TxtNombreFirmas.Text.Trim, EsFilial:=ChkEsFilial.Checked, GastosEnvio:=TxtGastosEnvio.Text.ToDecimal, Aseguradora:=ChkAseguradora.Checked) Then
If Not ObjClientes.LimpiaImpuestosLocales(Me.CveCliente) Then If Not ObjClientes.LimpiaImpuestosLocales(Me.CveCliente) Then
ErrorProceso = True ErrorProceso = True

View File

@@ -569,10 +569,44 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
} }
else else
{ {
//SI REGISTRA SALIDA DE ALMACÉN EN AUTOMÁTICO Y ES DEVOLUCION QUE REALIZE EL MOVMIENTO DE SALIDA DE ALMACEN //EN BDH, SI ES DEVOLUCION, QUE REALICE LA SALIDA DE ALMACEN
if ((UsuarioActual.Empresa.Funcionalidad(567) == "1" || UsuarioActual.Empresa.Funcionalidad(531) == "1") && factura.TipoDocto == "Dev" && factura.SaldoAlmacen != 0) if (UsuarioActual.Empresa.Funcionalidad(531) == "1" && factura.TipoDocto == "Dev" && factura.SaldoAlmacen != 0)
{ {
factura.RealizarDevolucionAlmacen = true; factura.RealizarDevolucionAlmacen = 1;
}
//SI REGISTRA SALIDA DE ALMACÉN EN AUTOMÁTICO, QUE REALIZE EL MOVIMIENTO DE ALMACEN EN AUTOMATICO
if (UsuarioActual.Empresa.Funcionalidad(567) == "1" && factura.TipoDocto.Contiene("Ing", "Dev") && factura.SaldoAlmacen != 0)
{
factura.RealizarDevolucionAlmacen = 1;
}
//SI TIENE PERMISO 'PERMITE DEVOLVER PRODUCTO EN UNA CANCELACION', QUE REALIZE EL MOVIMIENTO DE ALMACEN EN AUTOMATICO
if (UsuarioActual.TienePermisoProceso(269) && factura.TipoDocto.Contiene("Ing", "Dev") && factura.SaldoAlmacen != 0)
{
factura.RealizarDevolucionAlmacen = 1;
}
//EN TODAS LAS EMPRESAS. SI ES REMISION FACTURADA DEBE REALIZAR EL MOVIMIENTO DE ALMACEN EN AUTOMATICO
if (factura.TipoDocto == "Ing")
{
using (var ObjVentas = new ClsVentas())
{
if (ObjVentas.GetRemisionesRelacionadas(CveVenta, factura.TipoDocto))
{
if (ObjVentas.DtResultados.Copy().Rows.Count > 0)
{
factura.RealizarDevolucionAlmacen = 1;
}
}
else
{
retorno = new Modelos.Factura.MCancelacionVentaMensaje();
retorno.Mensaje = "No se pudo verificar si tiene remisiones relacionadas";
retorno.HuboError = true;
return retorno;
}
}
} }
bool AplicaCancelacionConPagos = false; bool AplicaCancelacionConPagos = false;
@@ -581,10 +615,6 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
AplicaCancelacionConPagos = true; AplicaCancelacionConPagos = true;
} }
if (UsuarioActual.TienePermisoProceso(269) && UsuarioActual.Empresa.Funcionalidad(109) == "1" && factura.TipoDocto == "Ing" && factura.SaldoAlmacen != 0)
{
factura.RealizarDevolucionAlmacen = true;
}
retorno = factura.EjecutarCancelacionPendiente(CveEstatus, CancelacionFecha, CancelacionAcuse, AplicaCancelacionConPagos: AplicaCancelacionConPagos); retorno = factura.EjecutarCancelacionPendiente(CveEstatus, CancelacionFecha, CancelacionAcuse, AplicaCancelacionConPagos: AplicaCancelacionConPagos);
} }

View File

@@ -208,10 +208,9 @@
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<br />
<div class="row"> <div class="row">
<div align="right"> <div align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; width: 150px;" /> <input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div> </div>
</div> </div>

View File

@@ -83,8 +83,10 @@
<asp:ListItem Text="Todos" Value="-1" Selected="True"></asp:ListItem> <asp:ListItem Text="Todos" Value="-1" Selected="True"></asp:ListItem>
<asp:ListItem Text="Pagaré Especial" Value="1"></asp:ListItem> <asp:ListItem Text="Pagaré Especial" Value="1"></asp:ListItem>
<asp:ListItem Text="PO" Value="2"></asp:ListItem> <asp:ListItem Text="PO" Value="2"></asp:ListItem>
<asp:ListItem Text="Pagaré Linea" Value="3"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<div class="col-md-1 truncate" runat="server" id="DVAgrupador1" visible="false">Agrupador:</div> <div class="col-md-1 truncate" runat="server" id="DVAgrupador1" visible="false">Agrupador:</div>
<div class="col-md-1 " runat="server" id="DVAgrupador2" visible="false"> <div class="col-md-1 " runat="server" id="DVAgrupador2" visible="false">
<asp:DropDownList runat="server" ID="DdlAgrupador" CssClass="select2me" Width="100%"> <asp:DropDownList runat="server" ID="DdlAgrupador" CssClass="select2me" Width="100%">
@@ -99,7 +101,11 @@
<div class="portlet-body" style="display: none;"> <div class="portlet-body" style="display: none;">
<div class="row"> <div class="row">
<label class="col-md-1">Sucursal: </label>
<div class="col-md-1">
<asp:DropDownList ID="DdlSubProyectos" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:DropDownList>
<%--<asp:DropDownList CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" ID="DdlSubProyectos" DataTextField="SubProyecto" DataValueField="CveSubProyecto" runat="server"></asp:DropDownList>--%>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -123,7 +129,6 @@
<div class="col-md-12"> <div class="col-md-12">
<asp:GridView ID="GvD" Width="100%" runat="server" GridLines="None" <asp:GridView ID="GvD" Width="100%" runat="server" GridLines="None"
DataKeyNames="CveLineaAdicional,LineaAdicional,CveCliente,CveProveedor,TipoLinea,Importe,CveMoneda,FechaVencimiento,CveUsuario,CveCategoria,FechaIng,Proveedor,DiasVencimiento"
CssClass="table table-striped table-advance table-hover ScrollAD input-sm " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true" CssClass="table table-striped table-advance table-hover ScrollAD input-sm " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False"> AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
<Columns> <Columns>
@@ -135,6 +140,11 @@
<asp:BoundField DataField="Abreviatura" HeaderText="Moneda" /> <asp:BoundField DataField="Abreviatura" HeaderText="Moneda" />
<asp:BoundField DataField="DiasVencimiento" HeaderText="Dias de Venc." /> <asp:BoundField DataField="DiasVencimiento" HeaderText="Dias de Venc." />
<asp:BoundField DataField="FechaVencimiento" HeaderText="F. Vencimiento" DataFormatString="{0:d}" /> <asp:BoundField DataField="FechaVencimiento" HeaderText="F. Vencimiento" DataFormatString="{0:d}" />
<asp:TemplateField HeaderText="P. Cred." >
<ItemTemplate>
<asp:Literal ID="LtlPC" runat="server" Text='<%# Eval("PermiteCredito").ToString()=="True"?"Si":"No" %>'></asp:Literal>&nbsp;
</ItemTemplate>
</asp:TemplateField>
</Columns> </Columns>
</asp:GridView> </asp:GridView>
</div> </div>

View File

@@ -71,6 +71,10 @@ public partial class Ventas_RepVencimientosCredito : ClsPaginas
txtFechaI.Text = NowADS().AddMonths(-1).FirstDayOfMonth().ToShortDateString(); txtFechaI.Text = NowADS().AddMonths(-1).FirstDayOfMonth().ToShortDateString();
txtFechaF.Text = NowADS().LastDayOfMonth().ToShortDateString(); txtFechaF.Text = NowADS().LastDayOfMonth().ToShortDateString();
DdlClientes.setEsWebService(true);
DdlClientes.Attributes.Add("data-metodo", "getcliente");
DdlClientes.SelectedText = "Todos";
DdlClientes.SelectedValue = "-1";
DdlSubProyectos.Items.Insert(0, new ListItem("Todos", "-1")); DdlSubProyectos.Items.Insert(0, new ListItem("Todos", "-1"));
DdlSubProyectos.DataSource = get_GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa); DdlSubProyectos.DataSource = get_GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa);
DdlSubProyectos.DataBind(); DdlSubProyectos.DataBind();
@@ -85,7 +89,7 @@ public partial class Ventas_RepVencimientosCredito : ClsPaginas
private void CargaDatos() private void CargaDatos()
{ {
DTDatosGvD = new DataTable(); DTDatosGvD = new DataTable();
LnkDescargaExcel.Visible = false; LnkDescargaExcel.Visible = false;
ClsVentas objVentas = new ClsVentas(); ClsVentas objVentas = new ClsVentas();

View File

@@ -2807,7 +2807,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="col-md-2">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="portlet light xspadding bordered whitoutcol"> <div class="portlet light xspadding bordered whitoutcol">
@@ -3069,7 +3069,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="col-md-4">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="portlet light xspadding bordered whitoutcol"> <div class="portlet light xspadding bordered whitoutcol">
@@ -3270,6 +3270,119 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<div class="col-md-12">
<div class="portlet light xspadding bordered whitoutcol">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">IMSS Bienestar</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="expand"></a>
</div>
</div>
<div class="portlet-body form-horizontal form-row-sepe formnombottom" style="display: none;">
<div class="form-body">
<table border="0">
<tr align="left">
<td>Número de orden de suministro:&nbsp;</td>
<td>
<div class="form-group form-md-line-input" style="width: 90%">
<asp:TextBox ID="TxtNOS" CssClass="form-control input-sm" runat="server"></asp:TextBox><label></label><i></i>
</div>
</td>
</tr>
<tr align="left">
<td>Orden de remisión:&nbsp;</td>
<td>
<div class="form-group form-md-line-input" style="width: 90%">
<asp:TextBox ID="TxtOR" CssClass="form-control input-sm" runat="server"></asp:TextBox><label></label><i></i>
</div>
</td>
</tr>
<tr align="left">
<td>CLUES:&nbsp;</td>
<td>
<div class="form-group form-md-line-input" style="width: 90%">
<asp:TextBox ID="TxtCLUES" CssClass="form-control input-sm" runat="server"></asp:TextBox><label></label><i></i>
</div>
</td>
</tr>
<tr align="left">
<td>Contrato:&nbsp;</td>
<td>
<div class="form-group form-md-line-input" style="width: 90%">
<asp:TextBox ID="TxtContrato" CssClass="form-control input-sm" runat="server"></asp:TextBox><label></label><i></i>
</div>
</td>
</tr>
<tr align="left">
<td>Fecha de expedición:&nbsp;</td>
<td>
<div class="input-group input-small date date-picker" data-date-format="dd/mm/yyyy">
<asp:TextBox ID="TxtFEEX" CssClass="form-control" runat="server" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:HyperLink ID="ImgTxtFEEX" class="btn default" runat="server"><i class="fa fa-calendar"></i></asp:HyperLink>
</span>
<ajax:MaskedEditExtender ID="MEETxtFEEX" runat="server" TargetControlID="TxtFEEX" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CEETxtFEEX" runat="server" TargetControlID="TxtFEEX" PopupButtonID="ImgTxtFEEX" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CVTxtFEEX" runat="server" ControlToValidate="TxtFEEX" Display="None" ErrorMessage="El campo <b>''Fecha de expedición''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpEmitirImprimir"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCETxtFEEX" runat="server" HighlightCssClass="vco" TargetControlID="CVTxtFEEX" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</td>
</tr>
<tr align="left">
<td>Fecha de recepción:&nbsp;</td>
<td>
<div class="input-group input-small date date-picker" data-date-format="dd/mm/yyyy">
<asp:TextBox ID="TxtFERE" CssClass="form-control" runat="server" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:HyperLink ID="ImgTxtFERE" class="btn default" runat="server"><i class="fa fa-calendar"></i></asp:HyperLink>
</span>
<ajax:MaskedEditExtender ID="METxtFERE" runat="server" TargetControlID="TxtFERE" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CETxtFERE" runat="server" TargetControlID="TxtFERE" PopupButtonID="ImgTxtFERE" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CVTxtFERE" runat="server" ControlToValidate="TxtFERE" Display="None" ErrorMessage="El campo <b>''Fecha de recepción''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpEmitirImprimir"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCETxtFERE" runat="server" HighlightCssClass="vco" TargetControlID="CVTxtFERE" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</td>
</tr>
<tr align="left">
<td>Fecha de recepción:&nbsp;</td>
<td>
<div class="input-group input-small date date-picker" data-date-format="dd/mm/yyyy">
<asp:TextBox ID="TxtFEEN" CssClass="form-control" runat="server" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:HyperLink ID="ImgTxtFEEN" class="btn default" runat="server"><i class="fa fa-calendar"></i></asp:HyperLink>
</span>
<ajax:MaskedEditExtender ID="METxtFEEN" runat="server" TargetControlID="TxtFEEN" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CETxtFEEN" runat="server" TargetControlID="TxtFEEN" PopupButtonID="ImgTxtFEEN" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CVTxtFEEN" runat="server" ControlToValidate="TxtFEEN" Display="None" ErrorMessage="El campo <b>''Fecha de entrega''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpEmitirImprimir"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCETxtFEEN" runat="server" HighlightCssClass="vco" TargetControlID="CVTxtFEEN" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</ContentTemplate> </ContentTemplate>
@@ -9091,8 +9204,7 @@
}); });
} }
function pageLoad() function pageLoad() {
{
//ABRIR EL DROPDOWN DE PS DESPUES DE ASIGNAR CANTIDAD //ABRIR EL DROPDOWN DE PS DESPUES DE ASIGNAR CANTIDAD
if ('<%= UsuarioActual.Empresa.Funcionalidad(109) %>' == '1') { if ('<%= UsuarioActual.Empresa.Funcionalidad(109) %>' == '1') {
$('#TxtCantidad').on('keydown', function (e) { $('#TxtCantidad').on('keydown', function (e) {
@@ -9128,8 +9240,7 @@
var totalPago = ToDouble($get("TxtImporteEfectivo").value); var totalPago = ToDouble($get("TxtImporteEfectivo").value);
if (totalPago > 0) { if (totalPago > 0) {
args.IsValid = (ToDouble(args.Value) > 0); args.IsValid = (ToDouble(args.Value) > 0);
}else } else {
{
args.IsValid = true; args.IsValid = true;
} }
} }
@@ -9139,8 +9250,7 @@
var totalPago = ToDouble($get("TxtImporteCredito").value); var totalPago = ToDouble($get("TxtImporteCredito").value);
if (totalPago > 0) { if (totalPago > 0) {
args.IsValid = (ToDouble(args.Value) > 0); args.IsValid = (ToDouble(args.Value) > 0);
}else } else {
{
args.IsValid = true; args.IsValid = true;
} }
} }
@@ -9150,8 +9260,7 @@
var totalPago = ToDouble($get("TxtImporteDebito").value); var totalPago = ToDouble($get("TxtImporteDebito").value);
if (totalPago > 0) { if (totalPago > 0) {
args.IsValid = (ToDouble(args.Value) > 0); args.IsValid = (ToDouble(args.Value) > 0);
}else } else {
{
args.IsValid = true; args.IsValid = true;
} }
} }
@@ -9161,8 +9270,7 @@
var totalPago = ToDouble($get("TxtImporteCheque").value); var totalPago = ToDouble($get("TxtImporteCheque").value);
if (totalPago > 0) { if (totalPago > 0) {
args.IsValid = (ToDouble(args.Value) > 0); args.IsValid = (ToDouble(args.Value) > 0);
}else } else {
{
args.IsValid = true; args.IsValid = true;
} }
} }
@@ -9172,8 +9280,7 @@
var totalPago = ToDouble($get("TxtImporteTransferencia").value); var totalPago = ToDouble($get("TxtImporteTransferencia").value);
if (totalPago > 0) { if (totalPago > 0) {
args.IsValid = (ToDouble(args.Value) > 0); args.IsValid = (ToDouble(args.Value) > 0);
}else } else {
{
args.IsValid = true; args.IsValid = true;
} }
} }

View File

@@ -5030,10 +5030,15 @@ Partial Class Ventas
BtnArchivoAdjunto.Visible = True BtnArchivoAdjunto.Visible = True
BtnEliminarAdjunto.Visible = True BtnEliminarAdjunto.Visible = True
BtnAdjuntar.Visible = False BtnAdjuntar.Visible = False
If Request("CveVenta") IsNot Nothing Then
BtnReemplazarAdjunto.Visible = True BtnReemplazarAdjunto.Visible = True
End If
Else Else
If Request("CveVenta") IsNot Nothing Then
BtnReemplazarAdjunto.Visible = True BtnReemplazarAdjunto.Visible = True
End If End If
End If
ViewState("CveSubProyectoVenta") = DbRowVenta("CveSubProyecto").ToString().ToEntero() ViewState("CveSubProyectoVenta") = DbRowVenta("CveSubProyecto").ToString().ToEntero()
@@ -6070,6 +6075,8 @@ Partial Class Ventas
ThCantidadFacturada2.Visible = False ThCantidadFacturada2.Visible = False
End If End If
'SI ES FACTURACION DIRECTA DESDE URL NO CARGAR LOS BOTONES
If Request("CveCotizacion") Is Nothing Then
'ACTIVA EDITAR 'ACTIVA EDITAR
'SOLO LA PUEDE EDITAR USUATIOACTUAL-VENDEDOR | NO DEBE ESTAR FACTURADA 'SOLO LA PUEDE EDITAR USUATIOACTUAL-VENDEDOR | NO DEBE ESTAR FACTURADA
If (UsuarioActual.CveUsuario = DbRowVenta("CveUsuario").ToString().ToEntero() Or UsuarioActual.CveVendedor = DdlVendedor.SelectedValue.ToEntero()) And TmpDT.SUM("CantidadFacturadaCot") = 0 Then 'And TmpDT.SUM("CantidadFacturadaCot") < TmpDT.SUM("Cantidad") If (UsuarioActual.CveUsuario = DbRowVenta("CveUsuario").ToString().ToEntero() Or UsuarioActual.CveVendedor = DdlVendedor.SelectedValue.ToEntero()) And TmpDT.SUM("CantidadFacturadaCot") = 0 Then 'And TmpDT.SUM("CantidadFacturadaCot") < TmpDT.SUM("Cantidad")
@@ -6085,6 +6092,8 @@ Partial Class Ventas
VerificarBtnFacturarCotizacion(DbRowVenta("CveVendedor").ToString().ToEntero()) VerificarBtnFacturarCotizacion(DbRowVenta("CveVendedor").ToString().ToEntero())
End If End If
End If
If DbRowVenta("TipoDocto").ToString().Contiene("Ped") Then If DbRowVenta("TipoDocto").ToString().Contiene("Ped") Then
'ACTIVA BOTONERA | DEBE TENER CONCEPTOS PENDIENTES DE FACTURAR 'ACTIVA BOTONERA | DEBE TENER CONCEPTOS PENDIENTES DE FACTURAR
If TmpDT.SUM("CantidadFacturadaPed2") < TmpDT.SUM("Cantidad") Then If TmpDT.SUM("CantidadFacturadaPed2") < TmpDT.SUM("Cantidad") Then
@@ -6115,6 +6124,11 @@ Partial Class Ventas
If UsuarioActual.TienePermisoProceso(302) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ped") Then BtnPermisoEditarRemision.Visible = True If UsuarioActual.TienePermisoProceso(302) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ped") Then BtnPermisoEditarRemision.Visible = True
If UsuarioActual.TienePermisoProceso(302) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Egs") Then BtnEditar.Visible = True If UsuarioActual.TienePermisoProceso(302) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Egs") Then BtnEditar.Visible = True
'OCULTAR BOTON DE EDICION SI SE FACTURA COTIZACION DESDE URL
If UsuarioActual.Empresa.Funcionalidad(558) <> "1" AndAlso Request("CveCotizacion") IsNot Nothing Then
BtnEditar.Visible = False
End If
If UsuarioActual.Empresa.Funcionalidad(280) = "1" Then If UsuarioActual.Empresa.Funcionalidad(280) = "1" Then
RblPaqueteria.SelectedValue = If(DbRowVenta("FormaPaqueteria").ToString = "", "1", DbRowVenta("FormaPaqueteria").ToString) RblPaqueteria.SelectedValue = If(DbRowVenta("FormaPaqueteria").ToString = "", "1", DbRowVenta("FormaPaqueteria").ToString)
RblPaqueteria.Enabled = False RblPaqueteria.Enabled = False
@@ -6241,6 +6255,38 @@ Partial Class Ventas
End If End If
End If End If
Dim Addenda = DbRowVenta("Addenda").ToString()
If Not String.IsNullOrEmpty(Addenda) Then
Try
Dim ObjAddenda As New Modelos.M_REM
Addenda = Addenda.Replace("<cfdi:Addenda>", "")
Addenda = Addenda.Replace("</cfdi:Addenda>", "")
Dim strAddenda As New StringBuilder()
strAddenda.Append("<?xml version=""1.0""?>")
strAddenda.Append(Addenda)
Dim serializer As System.Xml.Serialization.XmlSerializer = New System.Xml.Serialization.XmlSerializer(ObjAddenda.GetType())
Dim string_reader As TextReader = New System.IO.StringReader(strAddenda.ToString())
ObjAddenda = DirectCast(serializer.Deserialize(string_reader), Modelos.M_REM)
If ObjAddenda IsNot Nothing Then
TxtNOS.Text = ObjAddenda.NOS
TxtOR.Text = ObjAddenda._OR
TxtCLUES.Text = ObjAddenda.CLUES
TxtContrato.Text = ObjAddenda.CONTRATO
TxtFEEX.Text = ObjAddenda.FEEX
TxtFERE.Text = ObjAddenda.FERE
TxtFEEN.Text = ObjAddenda.FEEN
End If
Catch ex As Exception
OnError("Ocurrió un error al cargar los datos de la addenda", ex)
End Try
End If
End If End If
End Using End Using
End If End If
@@ -7298,7 +7344,7 @@ Partial Class Ventas
BtnModalClienteDocumentoCancelar.Visible = False BtnModalClienteDocumentoCancelar.Visible = False
If CveVenta <= 0 Then If CveVenta <= 0 Then
LnkUploadDocumentacionCliente.Visible = True LnkUploadDocumentacionCliente.Visible = UsuarioActual.Empresa.Funcionalidad(382) <> "1"
End If End If
UpModalTitleUploadDocumentoCliente.Update() UpModalTitleUploadDocumentoCliente.Update()
@@ -10165,7 +10211,8 @@ Partial Class Ventas
End If End If
If RequiereOC AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ant", "Ing") AndAlso Not CveDevolucion > 0 Then If RequiereOC AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ant", "Ing") AndAlso Not CveDevolucion > 0 Then
If Not CargaDocumentoOC Then
If Not CargaDocumentoOC AndAlso UsuarioActual.Empresa.Funcionalidad(382) <> "1" Then
Alert("Tiene que cargar un archivo de orden de compra", TipoMensaje.MsgAdvertencia) Alert("Tiene que cargar un archivo de orden de compra", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
@@ -12033,7 +12080,7 @@ Partial Class Ventas
Dim ForzarAjuste As Boolean = False Dim ForzarAjuste As Boolean = False
'EL IMPORTE DE NC NO PUEDE SER MAYOR AL DE LA FACTURA 'EL IMPORTE DE NC NO PUEDE SER MAYOR AL DE LA FACTURA
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso (tTipoAmortizacion = 1) Then If (tTipoAmortizacion = 1) Then
ForzarAjuste = True ForzarAjuste = True
End If End If
@@ -12885,6 +12932,49 @@ Partial Class Ventas
End If End If
End If End If
'AGREGA LA ADDENDA DESDE AQUI PARA QUE SE GUARDE LA INFORMACION DEL CAMPO
If ObjFactura.TipoDocto = "Ing" AndAlso Not String.IsNullOrEmpty(TxtNOS.Text.Trim()) Then
Dim Obj_REM As New Modelos.M_REM
Obj_REM.NOS = TxtNOS.Text
Obj_REM._OR = TxtOR.Text
Obj_REM.CLUES = TxtCLUES.Text
Obj_REM.CONTRATO = TxtContrato.Text
Obj_REM.FEEX = TxtFEEX.Text
Obj_REM.FEEN = TxtFEEN.Text
Obj_REM.FERE = TxtFERE.Text
Dim xmlRem As String = ""
Try
Dim serializer As System.Xml.Serialization.XmlSerializer = New System.Xml.Serialization.XmlSerializer(Obj_REM.GetType)
Dim string_writer As New System.IO.StringWriter
serializer.Serialize(string_writer, Obj_REM)
xmlRem = string_writer.ToString()
'QUITAR NAMESPACES Y ETIQUETAS NO NECESARIAS
If xmlRem <> "" Then
xmlRem = xmlRem.Replace("<?xml version=""1.0"" encoding=""utf-16""?>", "")
xmlRem = xmlRem.Replace("xmlns:xsd=""http://www.w3.org/2001/XMLSchema""", "")
xmlRem = xmlRem.Replace("xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""", "")
End If
Catch ex As Exception
xmlRem = ""
OnError("Ocurrió un error al guardar los datos de la addenda", ex)
End Try
If Not String.IsNullOrEmpty(xmlRem) Then
Dim SB As New StringBuilder
SB.Append("<cfdi:Addenda>")
SB.AppendFormat("{0}", xmlRem)
SB.Append("</cfdi:Addenda>")
ObjFactura.Addenda = SB.ToString()
End If
End If
End Sub End Sub
Private Sub CreaObjetosVentaDevolucion() Private Sub CreaObjetosVentaDevolucion()
@@ -13212,7 +13302,7 @@ Partial Class Ventas
Timbre.Comprobante.Serie = Obj.Serie Timbre.Comprobante.Serie = Obj.Serie
Timbre.Comprobante.Fecha = Obj.FechaCP Timbre.Comprobante.Fecha = Obj.FechaCP
Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33 Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33
Timbre.Comprobante.CondicionesdePago = If(UsuarioActual.CveEmpresa.Contiene(15, 76), "No Aplica", Obj.FormaPago33) Timbre.Comprobante.CondicionesdePago = If(UsuarioActual.CveEmpresa.Contiene(15, 76, 198), "No Aplica", Obj.FormaPago33)
Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT
Timbre.Comprobante.SubTotal = Obj.SubTotal Timbre.Comprobante.SubTotal = Obj.SubTotal
Timbre.Comprobante.Descuentos = Obj.Descuento Timbre.Comprobante.Descuentos = Obj.Descuento
@@ -13609,6 +13699,7 @@ Partial Class Ventas
} }
End If End If
End If End If
Return Timbre Return Timbre
@@ -14148,7 +14239,7 @@ Partial Class Ventas
FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero, FacturarSucursal:=factura.FacturarSucursal, VentaDesglosaIEPS:=factura.VentaDesglosaIEPS, RFCReceptor:=RFCReceptor, Adjunto:=Adjunto, DevolucionImportePagado:=factura.DevolucionImportePagado, EsGarantia:=factura.EsGarantia, ServicioDomicilio:=TrServicioDomicilio.Visible, FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero, FacturarSucursal:=factura.FacturarSucursal, VentaDesglosaIEPS:=factura.VentaDesglosaIEPS, RFCReceptor:=RFCReceptor, Adjunto:=Adjunto, DevolucionImportePagado:=factura.DevolucionImportePagado, EsGarantia:=factura.EsGarantia, ServicioDomicilio:=TrServicioDomicilio.Visible,
CveLineaAdicional:=DdlLineaAdicional.SelectedValue.ToEntero(), DescripcionVenta:=DescripcionVenta, CveLineaAdicional:=DdlLineaAdicional.SelectedValue.ToEntero(), DescripcionVenta:=DescripcionVenta,
CveMedico:=CveMedico, CveProcedimiento:=CveProcedimiento, CveTipoVenta:=CveTipoVentaGuardar, RequiereOS:=ChkRequiereTecnico.Checked, FechaParaSurtir:=factura.FechaParaSurtir, CveMedico:=CveMedico, CveProcedimiento:=CveProcedimiento, CveTipoVenta:=CveTipoVentaGuardar, RequiereOS:=ChkRequiereTecnico.Checked, FechaParaSurtir:=factura.FechaParaSurtir,
Paciente:=TxtPaciente.Text, Episodio:=TxtEpisodio.Text, CveMotivoDevolucion:=CveMotivoDevolucion) Then Paciente:=TxtPaciente.Text, Episodio:=TxtEpisodio.Text, CveMotivoDevolucion:=CveMotivoDevolucion, Addenda:=factura.Addenda) Then
ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico") ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Else Else
If factura.TipoDocto.Contiene("Dev", "Egs") OrElse DtVentasNC IsNot Nothing OrElse CveEstatusRefacturacion > 0 OrElse CveAnticipoPadre > 0 Then If factura.TipoDocto.Contiene("Dev", "Egs") OrElse DtVentasNC IsNot Nothing OrElse CveEstatusRefacturacion > 0 OrElse CveAnticipoPadre > 0 Then
@@ -14518,7 +14609,7 @@ Partial Class Ventas
'Si viene de OS, Se guarda CveVenta en OS 'Si viene de OS, Se guarda CveVenta en OS
If CveOS > 0 Then If CveOS > 0 Then
If Not ObjOS.UpdateVentaOS(factura.CveVenta, CveOS) Then If Not ObjOS.UpdateVentaOS(factura.CveVenta, CveOS, UsuarioActual.CveEmpresa) Then
ErrorList.Add("Ocurrió un error al guardar la venta en Ordenes de Servicio") ErrorList.Add("Ocurrió un error al guardar la venta en Ordenes de Servicio")
End If End If
End If End If
@@ -23197,6 +23288,7 @@ Partial Class Ventas
If Not UsuarioActual.TienePermisoProceso(289) Then If Not UsuarioActual.TienePermisoProceso(289) Then
DdlMetodoPago33.Enabled = True DdlMetodoPago33.Enabled = True
DdlFormaPago33.Enabled = True
End If End If
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
@@ -26066,7 +26158,9 @@ Partial Class Ventas
AplicaCancelacionConPagos = True AplicaCancelacionConPagos = True
End If End If
resp = ObjFacturaCancelacion.CancelarFactura(ChkDevAlm.Checked, ListaRemisionesCancelar, CveMotivoCancelacion:=DdlMotivoCancelacion.SelectedValue.ToEntero(), Motivo:=TxtMotivoCancelacion.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion, AplicaCancelacionConPagos:=AplicaCancelacionConPagos)
resp = ObjFacturaCancelacion.CancelarFactura(If(ChkDevAlm.Checked, 1, 0), ListaRemisionesCancelar, CveMotivoCancelacion:=DdlMotivoCancelacion.SelectedValue.ToEntero(), Motivo:=TxtMotivoCancelacion.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion, AplicaCancelacionConPagos:=AplicaCancelacionConPagos)
strMensaje.Append(resp.Mensaje) strMensaje.Append(resp.Mensaje)
Dim DtBonificaciones As DataTable = Nothing Dim DtBonificaciones As DataTable = Nothing
@@ -26083,7 +26177,7 @@ Partial Class Ventas
Try Try
'VERIFICA SI TIENE RNC DE BONIFICACION 'VERIFICA SI TIENE RNC DE BONIFICACION
Dim Bon As New Modelos.Factura(UsuarioActual, RowBon("CveVentaBonificacion").ToString().ToEntero(), UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Dim Bon As New Modelos.Factura(UsuarioActual, RowBon("CveVentaBonificacion").ToString().ToEntero(), UsuarioActual.CveEmpresa, VerificaAlmacen:=False)
Dim respBon As Modelos.Factura.MCancelacionVentaMensaje = Bon.CancelarFactura(False, ListaRemisionesCancelar, CveMotivoCancelacion:=DdlMotivoCancelacion.SelectedValue.ToEntero(), Motivo:=TxtMotivoCancelacion.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion) Dim respBon As Modelos.Factura.MCancelacionVentaMensaje = Bon.CancelarFactura(0, ListaRemisionesCancelar, CveMotivoCancelacion:=DdlMotivoCancelacion.SelectedValue.ToEntero(), Motivo:=TxtMotivoCancelacion.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion)
If respBon.HuboError Then If respBon.HuboError Then
strMensaje.AppendFormat("<br/>Ocurrió un error al cancelar la remisión de NC de bonificación <b> {0} </b>.", Bon.SerieFolio) strMensaje.AppendFormat("<br/>Ocurrió un error al cancelar la remisión de NC de bonificación <b> {0} </b>.", Bon.SerieFolio)
Else Else
@@ -30644,7 +30738,7 @@ Partial Class Ventas
Dim ImporteReferencia As Decimal = If(NivelTotal = 1, Total, SubTotal) Dim ImporteReferencia As Decimal = If(NivelTotal = 1, Total, SubTotal)
Dim Porcentaje As Decimal = ((Importe * 100) / ImporteReferencia) / 100 Dim Porcentaje As Decimal = ((Importe * 100D) / ImporteReferencia) / 100D
Dim FiltroStr As String = "" Dim FiltroStr As String = ""
Dim TotalImpuestosLocalesVentaOriginal As Decimal = 0 Dim TotalImpuestosLocalesVentaOriginal As Decimal = 0
@@ -30652,7 +30746,7 @@ Partial Class Ventas
'CALCULA LO EQUIVALENTE EN IMPUSTOS LOCALES 'CALCULA LO EQUIVALENTE EN IMPUSTOS LOCALES
If TmpDTImpuestos IsNot Nothing AndAlso TmpDTImpuestos.Rows.Count > 0 Then If TmpDTImpuestos IsNot Nothing AndAlso TmpDTImpuestos.Rows.Count > 0 Then
TotalImpuestosLocalesVentaOriginal = TmpDTImpuestos.SUM("Importe") TotalImpuestosLocalesVentaOriginal = TmpDTImpuestos.SUMD("Importe")
TotalImpuestosLocalesRecalculado = TotalImpuestosLocalesVentaOriginal * Porcentaje TotalImpuestosLocalesRecalculado = TotalImpuestosLocalesVentaOriginal * Porcentaje
End If End If
@@ -30666,7 +30760,7 @@ Partial Class Ventas
For Each Dr As DataRow In DtImpuestosLocal.Rows For Each Dr As DataRow In DtImpuestosLocal.Rows
FiltroStr = String.Format("ISNULL(PorcentajeIVA,0) = {0} AND ISNULL(PorcentajeRetIVA,0) = {1} AND ISNULL(PorcentajeRetISR,0) = {2} AND ISNULL(PorcentajeIEPS,0) = {3} AND ISNULL(CveSubProyecto,0) = {4} ", Dr("PorcentajeIVA").ToString().ToDecimal, Dr("PorcentajeRetIVA").ToString().ToDecimal, Dr("PorcentajeRetISR").ToString().ToDecimal, Dr("PorcentajeIEPS").ToString().ToDecimal, Dr("CveSubProyecto")) FiltroStr = String.Format("ISNULL(PorcentajeIVA,0) = {0} AND ISNULL(PorcentajeRetIVA,0) = {1} AND ISNULL(PorcentajeRetISR,0) = {2} AND ISNULL(PorcentajeIEPS,0) = {3} AND ISNULL(CveSubProyecto,0) = {4} ", Dr("PorcentajeIVA").ToString().ToDecimal, Dr("PorcentajeRetIVA").ToString().ToDecimal, Dr("PorcentajeRetISR").ToString().ToDecimal, Dr("PorcentajeIEPS").ToString().ToDecimal, Dr("CveSubProyecto"))
Dim importePuTemp As Decimal = 0 Dim importePuTemp As Decimal = 0
importePuTemp = (Porcentaje * (TmpDT.SUM("TotalImporte", FiltroStr) - TmpDT.SUM("Descuento", FiltroStr))) importePuTemp = (Porcentaje * (TmpDT.SUMD("TotalImporte", FiltroStr) - TmpDT.SUMD("Descuento", FiltroStr)))
Dim DescuentoAplicado As Decimal = 0 Dim DescuentoAplicado As Decimal = 0
If AplicaDescuentos Then If AplicaDescuentos Then
@@ -35487,6 +35581,8 @@ Partial Class Ventas
If UsuarioActual.TienePermisoProceso(357) AndAlso LblSeTimbro.Text = "No" Then If UsuarioActual.TienePermisoProceso(357) AndAlso LblSeTimbro.Text = "No" Then
DdlUsoCFDI.Enabled = True DdlUsoCFDI.Enabled = True
DdlMetodoPago33.Enabled = True
DdlFormaPago33.Enabled = True
End If End If
If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso CveTipoVenta.Contiene(1, 2, 3, 5, 6) Then If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso CveTipoVenta.Contiene(1, 2, 3, 5, 6) Then
@@ -39157,6 +39253,5 @@ Partial Class Ventas
' End Sub ' End Sub
'End Class 'End Class
End Class End Class