This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2024-01-12 10:02:47 -07:00
10 changed files with 1312 additions and 677 deletions

View File

@@ -3548,12 +3548,21 @@ Public Class ClsPaginas
End Property End Property
Property GlobalDTAC_PD_Programas(CveEjeRector As Integer) As DataTable Property GlobalDTAC_PD_Programas(CveEjeRector As Integer) As DataTable
Get Get
Dim CveEmpresa As Integer = 48
Dim AppNombre As String = $"GlobalDTAC_PD_Programas-{CveEmpresa}"
'sino existe, recarga los datos
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Using ObjAC As New ClsAC
If ObjAC.GetClasificacionAdministrativa(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados
End Using
End If
GlobalDTAC_PD_Programas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
If CveEjeRector <> -1 Then If CveEjeRector <> -1 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTAC_PD_Programas"), DataTable), String.Format("CveEjeRector = {0}", CveEjeRector), "", DataViewRowState.CurrentRows) Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveEjeRector = {0}", CveEjeRector), "", DataViewRowState.CurrentRows)
GlobalDTAC_PD_Programas = Dv.ToTable GlobalDTAC_PD_Programas = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
GlobalDTAC_PD_Programas = DirectCast(Application("GlobalDTAC_PD_Programas"), DataTable) GlobalDTAC_PD_Programas = DirectCast(Application(AppNombre), DataTable)
End If End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
@@ -5454,7 +5463,7 @@ Public Class ClsPaginas
If XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Name = "tfd:TimbreFiscalDigital" Then If XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Name = "tfd:TimbreFiscalDigital" Then
Vta.FolioFiscal = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("UUID").InnerText Vta.FolioFiscal = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("UUID").InnerText
Vta.NoSerieCertificado = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("NoCertificadoSAT").InnerText Vta.NoSerieCertificado = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("NoCertificadoSAT").InnerText
Vta.FechaCertificacion = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("FechaTimbrado").InnerText.ToDate Vta.FechaTimbrado = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("FechaTimbrado").InnerText.ToDate
Vta.SelloCFDi = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("SelloCFD").InnerText Vta.SelloCFDi = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("SelloCFD").InnerText
Vta.SelloSAT = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("SelloSAT").InnerText Vta.SelloSAT = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("SelloSAT").InnerText
End If End If
@@ -5573,7 +5582,7 @@ Public Class ClsPaginas
If XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Name = "tfd:TimbreFiscalDigital" Then If XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Name = "tfd:TimbreFiscalDigital" Then
Vta.FolioFiscal = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("UUID").InnerText Vta.FolioFiscal = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("UUID").InnerText
Vta.NoSerieCertificado = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("noCertificadoSAT").InnerText Vta.NoSerieCertificado = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("noCertificadoSAT").InnerText
Vta.FechaCertificacion = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("FechaTimbrado").InnerText.ToDate Vta.FechaTimbrado = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("FechaTimbrado").InnerText.ToDate
Vta.SelloCFDi = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("selloCFD").InnerText Vta.SelloCFDi = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("selloCFD").InnerText
Vta.SelloSAT = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("selloSAT").InnerText Vta.SelloSAT = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("selloSAT").InnerText
End If End If
@@ -5651,7 +5660,7 @@ Public Class ClsPaginas
'ImgCBB = String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/{4}.jpg", Request.Url.Scheme.Replace("https", "http"), Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, Vta.SerieFolio) 'ImgCBB = String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/{4}.jpg", Request.Url.Scheme.Replace("https", "http"), Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, Vta.SerieFolio)
'Dim CadenaOriginals As String = "||1.0|" + Vta.FolioFiscal + "|" + Vta.FechaCertificacion.ToString("yyyy-MM-dd") + "T" + Vta.FechaCertificacion.ToString("HH:mm:ss") + "|" + Vta.SelloCFDi + "|" + Vta.NoSerieCertificado + "||" 'Dim CadenaOriginals As String = "||1.0|" + Vta.FolioFiscal + "|" + Vta.FechaCertificacion.ToString("yyyy-MM-dd") + "T" + Vta.FechaCertificacion.ToString("HH:mm:ss") + "|" + Vta.SelloCFDi + "|" + Vta.NoSerieCertificado + "||"
Dim CadenaOriginals As String = String.Format("||{0}|{1}|{2}T{3}|{4}|{5}||", If(Vta.Version.Contiene("3.3", "4.0"), "1.1", "1.0"), Vta.FolioFiscal, Vta.FechaCertificacion.ToString("yyyy-MM-dd"), Vta.FechaCertificacion.ToString("HH:mm:ss"), Vta.SelloCFDi, Vta.NoSerieCertificado) Dim CadenaOriginals As String = String.Format("||{0}|{1}|{2}T{3}|{4}|{5}||", If(Vta.Version.Contiene("3.3", "4.0"), "1.1", "1.0"), Vta.FolioFiscal, Vta.FechaTimbrado.ToString("yyyy-MM-dd"), Vta.FechaTimbrado.ToString("HH:mm:ss"), Vta.SelloCFDi, Vta.NoSerieCertificado)
If Not ImagenCBB.Exists Then ImgCBB = "" If Not ImagenCBB.Exists Then ImgCBB = ""
Dim RutaFormato As String = "" Dim RutaFormato As String = ""
Dim RutaFormatoDefault As String = "" Dim RutaFormatoDefault As String = ""
@@ -5717,7 +5726,7 @@ Public Class ClsPaginas
params.Add(New ReportParameter("DomicilioSucursal", DomicilioSucursal)) params.Add(New ReportParameter("DomicilioSucursal", DomicilioSucursal))
params.Add(New ReportParameter("Vencimiento", Vta.FechaVencimiento.ToString("dd/MM/yyyy"))) params.Add(New ReportParameter("Vencimiento", Vta.FechaVencimiento.ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("FolioFiscal", Vta.FolioFiscal)) params.Add(New ReportParameter("FolioFiscal", Vta.FolioFiscal))
params.Add(New ReportParameter("FechaCertificacion", String.Format("{0}T{1}", Vta.FechaCertificacion.ToString("yyyy-MM-dd"), Vta.FechaCertificacion.ToString("HH:mm:ss")))) params.Add(New ReportParameter("FechaCertificacion", String.Format("{0}T{1}", Vta.FechaTimbrado.ToString("yyyy-MM-dd"), Vta.FechaTimbrado.ToString("HH:mm:ss"))))
params.Add(New ReportParameter("SelloCFDI", Vta.SelloCFDi)) params.Add(New ReportParameter("SelloCFDI", Vta.SelloCFDi))
params.Add(New ReportParameter("CadenaSAT", CadenaOriginals)) params.Add(New ReportParameter("CadenaSAT", CadenaOriginals))
params.Add(New ReportParameter("SelloSAT", Vta.SelloSAT)) params.Add(New ReportParameter("SelloSAT", Vta.SelloSAT))

View File

@@ -339,8 +339,6 @@ Public Class ClsTransportes
End Function End Function
#End Region #End Region
#End Region
#Region "Rutas" #Region "Rutas"
Public Function GetRutas(CveRuta As Integer, CveUsuario As Integer, CveEmpresa As Integer, Ruta As String, Estatus As Boolean, FechaIng As DateTime) As Boolean Public Function GetRutas(CveRuta As Integer, CveUsuario As Integer, CveEmpresa As Integer, Ruta As String, Estatus As Boolean, FechaIng As DateTime) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False

View File

@@ -424,7 +424,7 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function AddVenta(TipoDocto As String, FolioFact As Integer, CveCliente As Integer, CveClienteSucursal As Integer, SubTotal As Double, Descuento As Double, Amortizacion As Double, IVA As Double, RetIVA As Double, RetISR As Double, Total As Double, Public Function AddVenta(TipoDocto As String, FolioFact As Integer, CveCliente As Integer, CveClienteSucursal As Integer, SubTotal As Decimal, Descuento As Decimal, Amortizacion As Decimal, IVA As Decimal, RetIVA As Decimal, RetISR As Decimal, Total As Decimal,
CveMoneda As Integer, TipoCambio As Double, CveMetodoPago As Integer, CondicionesPago As Integer, FormaPago As Integer, FechaVencimiento As DateTime, Fecha As DateTime, MotivoDescuento As String, Observaciones As String, FechaEjecucion As DateTime, CveMoneda As Integer, TipoCambio As Double, CveMetodoPago As Integer, CondicionesPago As Integer, FormaPago As Integer, FechaVencimiento As DateTime, Fecha As DateTime, MotivoDescuento As String, Observaciones As String, FechaEjecucion As DateTime,
CveVendedor As Integer, Alfa1 As String, Alfa2 As String, Alfa3 As String, Num1 As Double, Num2 As Double, Num3 As Double, CveVendedor As Integer, Alfa1 As String, Alfa2 As String, Alfa3 As String, Num1 As Double, Num2 As Double, Num3 As Double,
Fech1 As Date, Fech2 As Date, Fech3 As Date, CveCorte As Integer, NumeroPersonas As Integer, CvePrePoliza As Integer, CveUsuario As Integer, CveEmpresa As Integer, Fech1 As Date, Fech2 As Date, Fech3 As Date, CveCorte As Integer, NumeroPersonas As Integer, CvePrePoliza As Integer, CveUsuario As Integer, CveEmpresa As Integer,
@@ -438,7 +438,8 @@ Public Class ClsVentas
Optional DiasCredito As Integer = 0, Optional EsDiasCreditoFijo As Boolean = False, Optional AnticipoEspecial As Boolean = False, Optional Kilometraje As Double = 0, Optional EsAmortizacion As Boolean = False, Optional CveTipoRetencion As Integer = 0, Optional DiasCredito As Integer = 0, Optional EsDiasCreditoFijo As Boolean = False, Optional AnticipoEspecial As Boolean = False, Optional Kilometraje As Double = 0, Optional EsAmortizacion As Boolean = False, Optional CveTipoRetencion As Integer = 0,
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
) As Boolean ) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
@@ -449,15 +450,15 @@ Public Class ClsVentas
.Add("@FolioFact", SqlDbType.Int).Value = FolioFact .Add("@FolioFact", SqlDbType.Int).Value = FolioFact
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal .Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
.Add("@SubTotal", SqlDbType.Float).Value = SubTotal.RoundSQL .Add("@SubTotal", SqlDbType.Money).Value = SubTotal.RoundSQL
.Add("@Descuento", SqlDbType.Float).Value = Descuento.RoundSQL .Add("@Descuento", SqlDbType.Money).Value = Descuento.RoundSQL
.Add("@Amortizacion", SqlDbType.Float).Value = Amortizacion.RoundSQL .Add("@Amortizacion", SqlDbType.Money).Value = Amortizacion.RoundSQL
.Add("@IVA", SqlDbType.Float).Value = IVA.RoundSQL .Add("@IVA", SqlDbType.Money).Value = IVA.RoundSQL
.Add("@IEPS", SqlDbType.Float).Value = IEPS.RoundSQL .Add("@IEPS", SqlDbType.Money).Value = IEPS.RoundSQL
.Add("@RetIVA", SqlDbType.Float).Value = RetIVA.RoundSQL .Add("@RetIVA", SqlDbType.Money).Value = RetIVA.RoundSQL
.Add("@RetISR", SqlDbType.Float).Value = RetISR.RoundSQL .Add("@RetISR", SqlDbType.Money).Value = RetISR.RoundSQL
.Add("@ImpuestoLocal", SqlDbType.Float).Value = ImpuestoLocal.RoundSQL .Add("@ImpuestoLocal", SqlDbType.Money).Value = ImpuestoLocal.RoundSQL
.Add("@Total", SqlDbType.Float).Value = Total.RoundSQL .Add("@Total", SqlDbType.Money).Value = Total.RoundSQL
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
.Add("@TipoCambio", SqlDbType.Float).Value = TipoCambio .Add("@TipoCambio", SqlDbType.Float).Value = TipoCambio
.Add("@CveMetodoPago", SqlDbType.Int).Value = CveMetodoPago .Add("@CveMetodoPago", SqlDbType.Int).Value = CveMetodoPago
@@ -480,7 +481,7 @@ Public Class ClsVentas
.Add("@Fech3", SqlDbType.VarChar).Value = IIf(Fech3.ToString.Contiene("1/1/0001 12:00:00 a. m.", "01/01/0001 12:00:00 a. m."), "-1", Fech3.ToString("yyyy/MM/dd")) .Add("@Fech3", SqlDbType.VarChar).Value = IIf(Fech3.ToString.Contiene("1/1/0001 12:00:00 a. m.", "01/01/0001 12:00:00 a. m."), "-1", Fech3.ToString("yyyy/MM/dd"))
.Add("@CveCorte", SqlDbType.Int).Value = CveCorte .Add("@CveCorte", SqlDbType.Int).Value = CveCorte
.Add("@NumeroPersonas", SqlDbType.Int).Value = NumeroPersonas .Add("@NumeroPersonas", SqlDbType.Int).Value = NumeroPersonas
.Add("@Propina", SqlDbType.Float).Value = Propina .Add("@Propina", SqlDbType.Money).Value = Propina
.Add("@CveVentaTerminal", SqlDbType.Int).Value = CveVentaTerminal .Add("@CveVentaTerminal", SqlDbType.Int).Value = CveVentaTerminal
.Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza .Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza
.Add("@AtencionA", SqlDbType.VarChar).Value = AtencionA .Add("@AtencionA", SqlDbType.VarChar).Value = AtencionA
@@ -544,6 +545,7 @@ Public Class ClsVentas
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento .Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
.Add("@CveTipoVenta", SqlDbType.Int).Value = CveTipoVenta .Add("@CveTipoVenta", SqlDbType.Int).Value = CveTipoVenta
.Add("@RequiereOS", SqlDbType.Int).Value = RequiereOS .Add("@RequiereOS", SqlDbType.Int).Value = RequiereOS
.Add("@FechaParaSurtir", SqlDbType.DateTime).Value = If(FechaParaSurtir = MinFecha, Fecha, FechaParaSurtir)
.Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
@@ -1380,7 +1382,8 @@ Public Class ClsVentas
CvePresupuestoIngreso As Integer, Optional TiempoEntrega As String = "", Optional CveVentaDetallePadre As Integer = -1, CvePresupuestoIngreso As Integer, Optional TiempoEntrega As String = "", Optional CveVentaDetallePadre As Integer = -1,
Optional CveContratoDetalle As Integer = -1, Optional PorcentajeIVA As Decimal = 0, Optional IEPS As Decimal = -1, Optional PorcentajeIEPS As Double = 0, Optional CvePromocionDetalle As Integer = -1, Optional CveContratoDetalle As Integer = -1, Optional PorcentajeIVA As Decimal = 0, Optional IEPS As Decimal = -1, Optional PorcentajeIEPS As Double = 0, Optional CvePromocionDetalle As Integer = -1,
Optional CveMovimientoDetallePedido As Integer = -1, Optional ImporteRetIVA As Decimal = 0, Optional PorcentajeRetIVA As Double = 0, Optional CveMovimientoDetallePedido As Integer = -1, Optional ImporteRetIVA As Decimal = 0, Optional PorcentajeRetIVA As Double = 0,
Optional ImporteRetISR As Decimal = 0, Optional PorcentajeRetISR As Decimal = 0, Optional CuentaPredial As String = "", Optional CvePrecioLista As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional NumTurnos As Decimal = 0D) As Boolean Optional ImporteRetISR As Decimal = 0, Optional PorcentajeRetISR As Decimal = 0, Optional CuentaPredial As String = "", Optional CvePrecioLista As Integer = -1, Optional CveActivoFijo As Integer = -1,
Optional NumTurnos As Decimal = 0D, Optional EstatusAlmacen As Integer = 0) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_VentasDetalleAdd") DataAdapter("PA_VentasDetalleAdd")
@@ -1413,6 +1416,7 @@ Public Class ClsVentas
.Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
.Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
.Add("@NumTurnos", SqlDbType.Decimal).Value = NumTurnos .Add("@NumTurnos", SqlDbType.Decimal).Value = NumTurnos
.Add("@EstatusAlmacen", SqlDbType.Int).Value = EstatusAlmacen
End With End With
Try Try

View File

@@ -7094,7 +7094,6 @@ Namespace Modelos
Public Property FacturarSucursal As Boolean = False Public Property FacturarSucursal As Boolean = False
'Public Property Sucursal As SucursalModel 'Public Property Sucursal As SucursalModel
Public Property SubProyecto As Modelos.SubProyectoModel Public Property SubProyecto As Modelos.SubProyectoModel
Public Property DtDetalle As Data.DataTable Public Property DtDetalle As Data.DataTable
Public Property DtMercancias As Data.DataTable Public Property DtMercancias As Data.DataTable
Public Property DtDetalleAC As Data.DataTable Public Property DtDetalleAC As Data.DataTable
@@ -7108,7 +7107,6 @@ Namespace Modelos
Public Property DtDesgloseImpuestos As Data.DataTable Public Property DtDesgloseImpuestos As Data.DataTable
Public Property DtDocumentosRelacionados As Data.DataTable Public Property DtDocumentosRelacionados As Data.DataTable
Public Property DtNCVinculadas As Data.DataTable Public Property DtNCVinculadas As Data.DataTable
Public Property DtAnticipos As Data.DataTable Public Property DtAnticipos As Data.DataTable
Public Property DtPromociones As Data.DataTable Public Property DtPromociones As Data.DataTable
Public Property DtImpuestosLocales As Data.DataTable Public Property DtImpuestosLocales As Data.DataTable
@@ -7122,10 +7120,8 @@ Namespace Modelos
Public Property DtDocumentacionCliente As Data.DataTable Public Property DtDocumentacionCliente As Data.DataTable
Public Property DtContratosSerieDetalle As Data.DataTable Public Property DtContratosSerieDetalle As Data.DataTable
Public Property DtOtrosConceptos As Data.DataTable Public Property DtOtrosConceptos As Data.DataTable
Public Property DtRemisionesDocumentosRelacionados As Data.DataTable Public Property DtRemisionesDocumentosRelacionados As Data.DataTable
Public Property DtInventario As Data.DataTable Public Property DtInventario As Data.DataTable
'Public Property DtAnticipoAmortizacion As Data.DataTable
Public Property DtRemConceptosSurtidos As Data.DataTable Public Property DtRemConceptosSurtidos As Data.DataTable
Public Property UsadosBonificacion As List(Of Integer) Public Property UsadosBonificacion As List(Of Integer)
Public Property TipoBonificacion As Integer = 0 Public Property TipoBonificacion As Integer = 0
@@ -7176,7 +7172,6 @@ Namespace Modelos
Public Property RefDocto As String = "" Public Property RefDocto As String = ""
Public Property RealizarDevolucionAlmacen As Boolean Public Property RealizarDevolucionAlmacen As Boolean
Public Property CveAlmacenDevolucionVenta As Integer Public Property CveAlmacenDevolucionVenta As Integer
Public Property TipoDocumento As String Public Property TipoDocumento As String
@@ -7224,28 +7219,6 @@ Namespace Modelos
End Select End Select
End Get End Get
End Property End Property
Public ReadOnly Property TipodeComprobanteSAT As ClbNegBICFDv3_2.TipoDeComprobante
Get
Select Case TipoDocto
Case "Ing"
Return ClbNegBICFDv3_2.TipoDeComprobante.ingreso
Case "Egs"
Return ClbNegBICFDv3_2.TipoDeComprobante.egreso
Case "Dev"
Return ClbNegBICFDv3_2.TipoDeComprobante.egreso
Case "Cot"
Return Nothing
Case "Rem"
Return Nothing
Case "Nom"
Return Nothing
Case "Ant"
Return ClbNegBICFDv3_2.TipoDeComprobante.ingreso
Case Else
Return Nothing
End Select
End Get
End Property
Public ReadOnly Property ClaseDoctoSat As Integer Public ReadOnly Property ClaseDoctoSat As Integer
Get Get
Select Case TipoDocto Select Case TipoDocto
@@ -7293,7 +7266,6 @@ Namespace Modelos
Return retorno Return retorno
End Get End Get
End Property End Property
Public Property CondicionesPago As Integer = 0 ' 0 - Contado, 1 - Credito (CHECAR) Public Property CondicionesPago As Integer = 0 ' 0 - Contado, 1 - Credito (CHECAR)
Public ReadOnly Property CondicionesPagoText As String Public ReadOnly Property CondicionesPagoText As String
@@ -7308,7 +7280,6 @@ Namespace Modelos
Return retorno Return retorno
End Get End Get
End Property End Property
Public Property MotivoDescuento As String = "" Public Property MotivoDescuento As String = ""
Public Property EsGarantia As Boolean = False Public Property EsGarantia As Boolean = False
@@ -7433,24 +7404,21 @@ Namespace Modelos
Public Property Num1 As Double = 0 Public Property Num1 As Double = 0
Public Property Num2 As Double = 0 Public Property Num2 As Double = 0
Public Property Num3 As Double = 0 Public Property Num3 As Double = 0
Public Property DiasCredito As Integer Public Property DiasCredito As Integer
Public Property EsDiasCreditoFijo As Boolean Public Property EsDiasCreditoFijo As Boolean
Public Property CveCorte As Integer = -1 Public Property CveCorte As Integer = -1
'Public Property CveMesa As Integer = -1 'Public Property CveMesa As Integer = -1
Public Property NumeroPersonas As Integer = 0 Public Property NumeroPersonas As Integer = 0
<ComponentModel.DataAnnotations.Schema.NotMapped> <ComponentModel.DataAnnotations.Schema.NotMapped>
Public Property FechaPago As Date Public Property FechaPago As Date
Public Property CveNCaVincular As Integer Public Property CveNCaVincular As Integer
Public Property FolioFiscal As String = "" Public Property FolioFiscal As String = ""
Public Property NoSerieCertificado As String Public Property NoSerieCertificado As String
Public Property SelloCFDi As String = "" Public Property SelloCFDi As String = ""
Public Property SelloSAT As String = "" Public Property SelloSAT As String = ""
Public Property FechaEmision As Date Public Property FechaEmision As Date
Public Property FechaCertificacion As Date Public Property FechaTimbrado As Date
Public Property NoSerieCertificadoContribuyente As String Public Property NoSerieCertificadoContribuyente As String
Public Property NumeroCuenta As String = "" Public Property NumeroCuenta As String = ""
Public Property CveTipoAmortizacionAnticipo As Integer = -1 Public Property CveTipoAmortizacionAnticipo As Integer = -1
@@ -7564,8 +7532,8 @@ Namespace Modelos
Public Property VendedorCodigo As String = "" Public Property VendedorCodigo As String = ""
Public Property CveSucursalEjecucion As Integer Public Property CveSucursalEjecucion As Integer
Public Property FechaEjecucion As DateTime Public Property FechaEjecucion As DateTime
Public Property FechaParaSurtir As DateTime = MinFecha
Public Property CveSucursalCobranza As Integer Public Property CveSucursalCobranza As Integer
Public Property CveSubProyectoCobranza As Integer Public Property CveSubProyectoCobranza As Integer
Public Property CveSubProyectoEjecucion As Integer Public Property CveSubProyectoEjecucion As Integer
Public Property CveOS As Integer Public Property CveOS As Integer
@@ -7578,25 +7546,16 @@ Namespace Modelos
Public Property TipoEstatus As Integer = 0 Public Property TipoEstatus As Integer = 0
Public Property CveCondicionEntrega As Integer = -1 Public Property CveCondicionEntrega As Integer = -1
Public Property CondicionEntrega As String = "" Public Property CondicionEntrega As String = ""
Public Property TipoRelacion As String Public Property TipoRelacion As String
Public Property UUIDRelacionados As List(Of String) Public Property UUIDRelacionados As List(Of String)
Public Property CveVentaRelacion As Integer = -1 Public Property CveVentaRelacion As Integer = -1
Public Property ImporteRelacion As Decimal Public Property ImporteRelacion As Decimal
Public Property EsNCAmortizacion As Boolean Public Property EsNCAmortizacion As Boolean
Public Property Kilometraje As Decimal Public Property Kilometraje As Decimal
Public Property CveTipoRetencion As Integer Public Property CveTipoRetencion As Integer
Public Property VentaDesglosaIEPS As Boolean Public Property VentaDesglosaIEPS As Boolean
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
#End Region #End Region

View File

@@ -30,7 +30,7 @@ Partial Class General_CatRimTamanios
End If End If
End Sub End Sub
#Region "CARGAS" #Region "CARGAS"
Private Sub CargaCombos() Private Sub CargaCombos()
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
DdlClasificacion.DataBind() DdlClasificacion.DataBind()

View File

@@ -4,8 +4,7 @@ Imports System.Data
Imports System.Math Imports System.Math
Imports ClosedXML.Excel Imports ClosedXML.Excel
Imports Extensiones Imports Extensiones
Imports GemBox.Spreadsheet
Imports log4net.Filter
Partial Class General_SaldosIniciales Partial Class General_SaldosIniciales
Inherits ClsPaginas Inherits ClsPaginas
@@ -1601,14 +1600,14 @@ Partial Class General_SaldosIniciales
Dim Fecha As Date = Row("Fecha").ToString().ToDate Dim Fecha As Date = Row("Fecha").ToString().ToDate
Dim FechaVencimiento As Date = Row("Fecha Vencimiento").ToString().ToDate Dim FechaVencimiento As Date = Row("Fecha Vencimiento").ToString().ToDate
Dim ImpuestoLocal As Decimal = If(dt.Columns.Contains("ImpuestoLocal"), Row("ImpuestoLocal").ToString().ToDecimal, 0D) Dim ImpuestoLocal As Decimal = If(dt.Columns.Contains("ImpuestoLocal"), Row("ImpuestoLocal").ToString().ToDecimal, 0D)
Dim Amortizacion As Double = If(dt.Columns.Contains("Amort.Ant"), Row("Amort.Ant").ToString().ToDouble, 0.0) Dim Amortizacion As Decimal = If(dt.Columns.Contains("Amort.Ant"), Row("Amort.Ant").ToString().ToDecimal, 0)
Dim SubTotal As Decimal = Row("SubTotal").ToString().ToDecimal Dim SubTotal As Decimal = Row("SubTotal").ToString().ToDecimal
Dim IVA As Decimal = Row("IVA").ToString().ToDecimal Dim IVA As Decimal = Row("IVA").ToString().ToDecimal
Dim Total As Decimal = Row("Total").ToString().ToDecimal Dim Total As Decimal = Row("Total").ToString().ToDecimal
Dim Saldo As Decimal = Row("Saldo").ToString().ToDecimal Dim Saldo As Decimal = Row("Saldo").ToString().ToDecimal
Dim CveCliente As Integer = DtClientes.FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString().ToEntero() Dim CveCliente As Integer = DtClientes.FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString().ToEntero()
Dim RetIVA As Decimal = Row("Ret IVA").ToString().ToDecimal Dim RetIVA As Decimal = Row("Ret IVA").ToString().ToDecimal
Dim RetISR As Double = Row("Ret ISR").ToString().ToDouble Dim RetISR As Decimal = Row("Ret ISR").ToString().ToDecimal
Dim Moneda As String = Row("Moneda").ToString() Dim Moneda As String = Row("Moneda").ToString()
Dim TipoCambio As String = Row("Tipo Cambio").ToString() Dim TipoCambio As String = Row("Tipo Cambio").ToString()
Dim CveMoneda As Integer = 1 Dim CveMoneda As Integer = 1

File diff suppressed because it is too large Load Diff

View File

@@ -14,13 +14,24 @@ Partial Class Ventas_PVCobranza
Set(value As Integer) Set(value As Integer)
ViewState("CveCorte") = value ViewState("CveCorte") = value
End Set End Set
End Property
Private Property DineroCaja As Double
Get
Return If(IsNothing(ViewState("DineroCaja")), 0, ViewState("DineroCaja").ToString().ToDecimal())
End Get
Set(value As Double)
ViewState("DineroCaja") = value
End Set
End Property End Property
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
If Not Page.IsPostBack Then If Not Page.IsPostBack Then
CveCorte = 0 CveCorte = 0
CargaFiltros() CargaFiltros()
CargaCorteCaja() If UsuarioActual.TienePermisoProceso(371) Then
CargaCorteCaja()
End If
End If End If
End Sub End Sub
@@ -59,31 +70,118 @@ Partial Class Ventas_PVCobranza
DdlCuentaTarjetaDebito.DataBind() DdlCuentaTarjetaDebito.DataBind()
DdlCuentaCheque.DataBind() DdlCuentaCheque.DataBind()
DdlCuentaTransferencia.DataBind() DdlCuentaTransferencia.DataBind()
TxtImporteEfectivo.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();") TxtImporteEfectivo.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
TxtImporteCredito.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();") TxtImporteCredito.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
TxtImporteDebito.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();") TxtImporteDebito.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
TxtImporteCheque.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();") TxtImporteCheque.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
TxtImporteTransferencia.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();") TxtImporteTransferencia.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
TxtImporteOtrosContado.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();") TxtImporteOtrosContado.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
TxtEfectivoEnCaja.Attributes.Add("onKeyUp", "CalculaDiferencia();")
TxtEfectivoCajaBloqueo.Attributes.Add("onKeyUp", "CalculaDiferenciaBloqueo();")
End Sub End Sub
Private Sub CargaCorteCaja() Private Sub CargaCorteCaja()
Dim DebeCerrarCorte As Boolean = False Dim DebeCerrarCorte As Boolean = False
'Checar si hay un Turno Abierto 'Checar si hay un Turno Abierto
Dim ObjPVenta As New ClsPuntoVenta Dim ObjPVenta As New ClsPuntoVenta
If ObjPVenta.GetVta_Cortes("-1", "-1", UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, 0) Then If ObjPVenta.GetVta_Cortes("-1", "-1", UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, 0) Then
If ObjPVenta.DtResultados.Rows.Count > 0 Then If ObjPVenta.DtResultados.Rows.Count > 0 Then
CveCorte = ObjPVenta.CveCorte CveCorte = ObjPVenta.CveCorte
End If Dim FechaICorte As Date = ObjPVenta.FechaInicial.Date '.AddDays(-5)
End If If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso FechaICorte < NowADS().Date Then
ObjPVenta.Dispose() DebeCerrarCorte = True
LblMotivoBloqueo.Text = $"Existe un corte del día <b>{FechaICorte.ToString("dd/MM/yyyy")}</b>. Favor de cerrarlo para iniciar un nuevo corte."
Else
LblTurno.Text = ObjPVenta.FechaInicial.ToShortDateString
BtnIniciarTurno.Visible = False
LkbEstadodeCaja.Visible = True
LkbIngreso.Visible = True
LkbRetiro.Visible = True
UpTurno.Visible = True
End If
Else
UpTurno.Visible = False
'Ingresar un nuevo Turno
RegistraScript("window.onload = function MuestraCorteCaja() { document.getElementById(""C_btnShow"").click(); }")
End If
End If
ObjPVenta.Dispose()
If DebeCerrarCorte Then
CargaDatosCorte()
RegistraScript("window.onload = function MuestraPantallaBloqueo() { document.getElementById(""C_btnShowBloqueo"").click(); }")
End If
End Sub
Private Sub CargaDatosCorte()
Dim ObjPVenta As New ClsPuntoVenta
Dim Total As Double
If ObjPVenta.GetVta_Cortes("-1", "-1", UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, 0) Then
If ObjPVenta.DtResultados.Rows.Count > 0 Then
Total = ObjPVenta.DtResultados(0)("ImporteInicial").ToString().ToDouble + ObjPVenta.DtResultados(0)("VentasEfectivo").ToString().ToDouble + ObjPVenta.DtResultados(0)("Ingresado").ToString().ToDouble - ObjPVenta.DtResultados(0)("Retirado").ToString().ToDouble - ObjPVenta.DtResultados(0)("Devoluciones").ToString().ToDouble
DineroCaja = Total
LblEfectivoEsperado.Text = Total.FormatoNumero(2)
LblEfectivoBloqueo.Text = Total.FormatoNumero(2)
Dim Dt As New DataTable
Dt.Columns.Add("Descripcion", GetType(String))
Dt.Columns.Add("Importe", GetType(Decimal))
Dim Dr1 As DataRow = Dt.NewRow
Dr1("Descripcion") = "Fondo de Caja"
Dr1("Importe") = ObjPVenta.DtResultados(0)("ImporteInicial").ToString().ToDouble
Dt.Rows.Add(Dr1)
Dim Dr2 As DataRow = Dt.NewRow
Dr2("Descripcion") = "Ventas en Efectivo"
Dr2("Importe") = ObjPVenta.DtResultados(0)("VentasEfectivo").ToString().ToDouble
Dt.Rows.Add(Dr2)
Dim Dr21 As DataRow = Dt.NewRow
Dr21("Descripcion") = "Devoluciones"
Dr21("Importe") = ObjPVenta.DtResultados(0)("Devoluciones").ToString().ToDouble
Dt.Rows.Add(Dr21)
'Dim Dr3 = Dt.NewRow
'Dr3("Descripcion") = "Propinas"
'Dr3("Importe") = ObjPVenta.DtResultados(0)("Propina").ToString().ToDouble
'Dt.Rows.Add(Dr3)
Dim Dr4 As DataRow = Dt.NewRow
Dr4("Descripcion") = "Entradas"
Dr4("Importe") = ObjPVenta.DtResultados(0)("Ingresado").ToString().ToDouble
Dt.Rows.Add(Dr4)
Dim Dr5 As DataRow = Dt.NewRow
Dr5("Descripcion") = "Salidas"
Dr5("Importe") = ObjPVenta.DtResultados(0)("Retirado").ToString().ToDouble
Dt.Rows.Add(Dr5)
Dim Dr6 As DataRow = Dt.NewRow
Dr6("Descripcion") = "Total"
Dr6("Importe") = Total
Dt.Rows.Add(Dr6)
GvDineroCaja.DataSource = Dt
GvDineroCaja.DataBind()
UpDineroCaja.Update()
UpTerminarCorte.Update()
End If
End If
ObjPVenta.Dispose()
End Sub End Sub
Private Sub CargaDatos() Private Sub CargaDatos()
Dim ObjMovtos As New ClsMovimientos() Dim ObjMovtos As New ClsMovimientos()
@@ -276,6 +374,128 @@ Partial Class Ventas_PVCobranza
End If End If
Return Retorno Return Retorno
End Function End Function
Protected Sub BtnCerrarCaja_Click(sender As Object, e As EventArgs)
RegistraScript("$('#DivEstadoCaja').modal('hide')")
RegistraScript("$('#DivTerminarCorte').modal()", "divterminarcorte")
End Sub
Protected Sub LkbIngreso_Click(sender As Object, e As EventArgs)
CargaIngresoEgreso(1)
End Sub
Public Sub CargaIngresoEgreso(Opcion As Integer)
RegistraScript("$('#DivIngresoEgreso').modal()")
If Opcion = 1 Then
LblTituloIE.Text = "Ingreso de Efectivo: "
HdnTipoMovimiento.Value = "1"
ElseIf Opcion = 0 Then
LblTituloIE.Text = "Retiro de Efectivo: "
HdnTipoMovimiento.Value = "0"
End If
UpIngresoEgreso.Update()
End Sub
Protected Sub LkbRetiro_Click(sender As Object, e As EventArgs)
CargaIngresoEgreso(0)
End Sub
Private Sub LkbEstadodeCaja_Click(sender As Object, e As EventArgs) Handles LkbEstadodeCaja.Click
CargaDatosCorte()
CargaVentasPago()
CargaEntradasSalidas()
RegistraScript("$('#DivEstadoCaja').modal()")
End Sub
Private Sub CargaVentasPago()
Dim ObjPVenta As New ClsPuntoVenta
If ObjPVenta.GetVta_MetodosPago(CveCorte) Then
If ObjPVenta.DtResultados.Rows.Count > 0 Then
GvMetodosPago.DataSource = ObjPVenta.DtResultados
GvMetodosPago.DataBind()
UpMetodosPago.Update()
End If
End If
ObjPVenta.Dispose()
End Sub
Private Sub CargaEntradasSalidas()
Dim ObjPVenta As New ClsPuntoVenta
'Salida
If ObjPVenta.GetVta_MovimientosCajas(CveCorte, 0) Then
If ObjPVenta.DtResultados.Rows.Count > 0 Then
GvEgresos.DataSource = ObjPVenta.DtResultados
GvEgresos.DataBind()
UpEgresos.Update()
End If
End If
'Entrada
If ObjPVenta.GetVta_MovimientosCajas(CveCorte, 1) Then
If ObjPVenta.DtResultados.Rows.Count > 0 Then
GvIngresos.DataSource = ObjPVenta.DtResultados
GvIngresos.DataBind()
UpIngresos.Update()
End If
End If
ObjPVenta.Dispose()
End Sub
Private Sub BtnCerrarTurno_Click(sender As Object, e As EventArgs) Handles BtnCerrarTurno.Click
Dim ObjPVenta As New ClsPuntoVenta
If TxtEfectivoEnCaja.Text.Trim <> "" Then
If ObjPVenta.UpdateFinalizadoVtaCortes(CveCorte, TxtEfectivoEnCaja.Text.ToDouble, LblDiferenciaCaja.Text.ToDouble, NowADS(), UsuarioActual.CveEmpresa) Then
RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=CORT&CVECORTE={0}&FORMATO={1}", CveCorte, "PDF"))}'", "Imprimir")
Dim Liga As String = "document.location.href=""/Ventas/PVCobranza.aspx"";"
Alert("Se ha cerrado el turno correctamente.", TipoMensaje.MsgInformacion, Liga)
End If
End If
ObjPVenta.Dispose()
End Sub
Private Sub BtnCerrarBloqueo_Click(sender As Object, e As EventArgs) Handles BtnCerrarBloqueo.Click
Dim ObjPVenta As New ClsPuntoVenta
If TxtEfectivoCajaBloqueo.Text.Trim <> "" Then
If ObjPVenta.UpdateFinalizadoVtaCortes(CveCorte, TxtEfectivoCajaBloqueo.Text.ToDouble, LblDiferenciaCajaBloqueo.Text.ToDouble, NowADS(), UsuarioActual.CveEmpresa) Then
RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=CORT&CVECORTE={0}&FORMATO={1}", CveCorte, "PDF"))}'", "Imprimir")
Dim Liga As String = "document.location.href=""/Ventas/PVCobranza.aspx"";"
Alert("Se ha cerrado el turno correctamente.", TipoMensaje.MsgInformacion, Liga)
End If
Else
Alert("Debe especificar el efectivo en caja", TipoMensaje.MsgAdvertencia)
RegistraScript("window.onload = function MuestraPantallaBloqueo() { document.getElementById(""C_btnShowBloqueo"").click(); }")
End If
ObjPVenta.Dispose()
End Sub
Private Sub BtnIniciarTurno_Click(sender As Object, e As EventArgs) Handles BtnIniciarTurno.Click
Dim ObjPVenta As New ClsPuntoVenta
ObjPVenta.AddVtaCortes(NowADS(), TxtDineroCaja.Text.ToDecimal, UsuarioActual.CveUsuario, TxtDescripcionCaja.Text, UsuarioActual.CveEmpresa)
CveCorte = ObjPVenta.CveCorte
LblTurno.Text = NowADS().ToShortDateString
UpTurno.Visible = True
LkbEstadodeCaja.Visible = True
LkbIngreso.Visible = True
LkbRetiro.Visible = True
BtnIniciarTurno.Visible = False
ObjPVenta.Dispose()
RegistraScript("$('#DivCorteDeCaja').hide();")
UpTurno.Update()
End Sub
Private Sub BtnAceptarIE_Click(sender As Object, e As EventArgs) Handles BtnAceptarIE.Click
Dim ObjPVenta As New ClsPuntoVenta
If TxtCantidadIE.Text.ToEntero() > 0 Then
If ObjPVenta.AddVta_MovimientosCajas(CveCorte, UsuarioActual.CveUsuario, TxtCantidadIE.Text.ToDouble, TxtDescripcionIE.Text, HdnTipoMovimiento.Value.ToEntero(), NowADS()) Then
TxtCantidadIE.Text = ""
TxtDescripcionIE.Text = ""
RegistraScript("$('#DivIngresoEgreso').modal('hide')", "divingresoegreso")
Alert("El movimiento se realizó correctamente")
UpIngresoEgreso.Update()
End If
End If
ObjPVenta.Dispose()
End Sub
End Class End Class

View File

@@ -582,16 +582,16 @@
</tr> </tr>
<tr runat="server" id="TrVentasMedicas2" visible="false"> <tr runat="server" id="TrVentasMedicas2" visible="false">
<td runat="server" id="TdRequiereTecnico1" visible="false"> <td runat="server" id="TdRequiereTecnico1" visible="true">
<b>Requiere Técnico:</b> <b>Requiere Técnico:</b>
</td> </td>
<td runat="server" id="TdRequiereTecnico2" visible="false"> <td runat="server" id="TdRequiereTecnico2" visible="true">
<asp:CheckBox ID="ChkRequiereTecnico" runat="server" CssClass="chksino" OnCheckedChanged="ChkRequiereTecnico_CheckedChanged" AutoPostBack="true" Text="Requiere Técnico:" /> <asp:CheckBox ID="ChkRequiereTecnico" runat="server" CssClass="chksino" OnCheckedChanged="ChkRequiereTecnico_CheckedChanged" AutoPostBack="true" Text="Requiere Técnico:" />
</td> </td>
<td runat="server" id="TdFechaOS1" visible="false"> <td runat="server" id="TdFechaOS1" visible="true">
<b>Fecha de Cirugia:</b> <b>Fecha de Cirugia:</b>
</td> </td>
<td runat="server" id="TdFechaOS2" visible="false"> <td runat="server" id="TdFechaOS2" visible="true">
<asp:TextBox ID="TxtFechaOS" type="datetime-local" runat="server" CssClass="make-switchsd" CausesValidation="true" Style="width: 130px" ></asp:TextBox> <asp:TextBox ID="TxtFechaOS" type="datetime-local" runat="server" CssClass="make-switchsd" CausesValidation="true" Style="width: 130px" ></asp:TextBox>
</td> </td>
</tr> </tr>
@@ -1976,12 +1976,13 @@
</div> </div>
<div runat="server" id="DVMEEFechaEje" visible="true"> <div runat="server" id="DVMEEFechaEje" visible="true">
<ajax:MaskedEditExtender ID="MEEFechaEje" runat="server" TargetControlID="TxtFechaEjecucion" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender> <ajax:MaskedEditExtender ID="MEEFechaEje" runat="server" TargetControlID="TxtFechaEjecucion" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<asp:CompareValidator ID="CVFechaEje" runat="server" ControlToValidate="TxtFechaEjecucion" Display="None" ErrorMessage="El campo <b>''Fecha Ejecución''</b> no tienes 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="VcoRFVFechaEje" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaEje" Width="350px"></ajax:ValidatorCalloutExtender>
</div> </div>
<ajax:CalendarExtender runat="server" ID="CEFechaEje" TargetControlID="TxtFechaEjecucion" PopupButtonID="ImgCalendarFechaEje" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender> <ajax:CalendarExtender runat="server" ID="CEFechaEje" TargetControlID="TxtFechaEjecucion" PopupButtonID="ImgCalendarFechaEje" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaEje" runat="server" ControlToValidate="TxtFechaEjecucion" Display="None" ErrorMessage="El campo <b>''Fecha de Ejecución''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpEmitirImprimir"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVFechaEje" runat="server" ControlToValidate="TxtFechaEjecucion" Display="None" ErrorMessage="El campo <b>''Fecha de Ejecución''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpEmitirImprimir"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaEje" runat="server" ControlToValidate="TxtFechaEjecucion" Display="None" ErrorMessage="El campo <b>''Fecha Ejecución''</b> no tienes 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="VcoRFVFechaEje" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaEje" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VcoCVFechaEje" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaEje" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VcoCVFechaEje" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaEje" Width="350px"></ajax:ValidatorCalloutExtender>
&nbsp; &nbsp;
</td> </td>
@@ -4093,7 +4094,7 @@
</tr> </tr>
<tr align="left" id="TrObsMedico1" visible="false" runat="server"> <%--<tr align="left" id="TrObsMedico1" visible="false" runat="server">
<td>Médico:&nbsp;</td> <td>Médico:&nbsp;</td>
</tr> </tr>
<tr align="left" id="TrObsMedico2" visible="false" runat="server"> <tr align="left" id="TrObsMedico2" visible="false" runat="server">
@@ -4114,7 +4115,7 @@
<asp:ListItem Value="-1">Seleccione uno</asp:ListItem> <asp:ListItem Value="-1">Seleccione uno</asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</td> </td>
</tr> </tr>--%>
</table> </table>
@@ -8405,13 +8406,13 @@
<%--Tipo Venta--%> <%--Tipo Venta--%>
<div class="row" runat="server" visible="True" id="DvModalTipoVentaPasoTipo"> <div class="row" runat="server" visible="True" id="DvModalTipoVentaPasoTipo">
<div class="col-md-4"> <div class="col-md-3">
</div> </div>
<div class="col-md-4" style="text-align: left!important"> <div class="col-md-6" style="text-align: left!important">
<asp:RadioButtonList ID="RBLTipoVenta" DataTextField="TipoVenta" RepeatDirection="Vertical" DataValueField="CveTipoVenta" runat="server" AutoPostBack="true" OnSelectedIndexChanged="RBLTipoVenta_SelectedIndexChanged" Style="margin-top: 10px!important"> <asp:RadioButtonList ID="RBLTipoVenta" DataTextField="TipoVenta" RepeatDirection="Vertical" DataValueField="CveTipoVenta" runat="server" AutoPostBack="true" OnSelectedIndexChanged="RBLTipoVenta_SelectedIndexChanged" Style="margin-top: 10px!important">
</asp:RadioButtonList> </asp:RadioButtonList>
</div> </div>
<div class="col-md-4"> <div class="col-md-3">
</div> </div>
</div> </div>
@@ -8489,7 +8490,7 @@
<div runat="server" visible="False" id="DvModalTipoVentaPasoRequiereOS"> <div runat="server" visible="False" id="DvModalTipoVentaPasoRequiereOS">
<div class="row"> <div class="row">
<div class="form-group col-md-6 form-md-line-input input-iconright "> <div class="form-group col-md-6 form-md-line-input input-iconright ">
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlMedicoModal">Requiere Técnico:</asp:Label> <asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="ChkRequiereTecnicoModal">Requiere Técnico:</asp:Label>
<asp:CheckBox ID="ChkRequiereTecnicoModal" CssClass="chksino" runat="server" OnCheckedChanged="ChkRequiereTecnicoModal_CheckedChanged" AutoPostBack="true" Text="Requiere Técnico" /> <asp:CheckBox ID="ChkRequiereTecnicoModal" CssClass="chksino" runat="server" OnCheckedChanged="ChkRequiereTecnicoModal_CheckedChanged" AutoPostBack="true" Text="Requiere Técnico" />
</div> </div>
<div class="form-group col-md-6 form-md-line-input input-iconright " runat="server" id="DvModalRequiereOSFecha" visible="false"> <div class="form-group col-md-6 form-md-line-input input-iconright " runat="server" id="DvModalRequiereOSFecha" visible="false">
@@ -8545,6 +8546,40 @@
<script src="/Metronic/assets/global/scripts/jquery-sortable.js"></script> <script src="/Metronic/assets/global/scripts/jquery-sortable.js"></script>
<script type="text/javascript"> <script type="text/javascript">
function impresionDirecta(url){
var frame = document.createElement('iframe');
frame.setAttribute('src', url);
//must be in the DOM to work in Firefox/IE
document.body.appendChild(frame);
//since it's in the DOM we need to hide it (lest we ruin our page layout)
//can't use 'display:none' or 'visibility:hidden' because you can't get focus (needed for IE)
//'z-index:-1' & 'opacity:0' wont help if there is no background in the elements above it and someone clicks through to it
frame.style.position = 'absolute';
frame.style.left = '-9999px';
//when it is loaded, print it
function printFrame() {
//have to get focus in IE
frame.contentWindow.focus();
//print!
frame.contentWindow.print();
/* cant remove the element because print() is non-blocking in FF
* (I.e. it would remove the frame before it was printed!)
//cleanup
//document.body.removeChild(frame);*/
};
//if it was cached, it may already be done (onload wont fire, IE8)
if (frame.contentWindow && frame.contentDocument.readyState == 'complete')
printFrame();
else {
if (frame.addEventListener)
//W3C
frame.addEventListener('load', printFrame, false);
else
//IE<9
frame.attachEvent('onload', printFrame);
}
}
function pageLoad() function pageLoad()
{ {
//ABRIR EL DROPDOWN DE PS DESPUES DE ASIGNAR CANTIDAD //ABRIR EL DROPDOWN DE PS DESPUES DE ASIGNAR CANTIDAD

View File

@@ -2282,6 +2282,53 @@ Partial Class Ventas
End Set End Set
End Property End Property
#Region "VENTA MEDICA"
Property EsVentaMedica As Boolean
Get
If ViewState("EsVentaMedica") Is Nothing Then
ViewState("EsVentaMedica") = False
End If
Return Boolean.Parse(ViewState("EsVentaMedica").ToString)
End Get
Set(value As Boolean)
ViewState("EsVentaMedica") = value
End Set
End Property
Property SeEstaFActurandoVentaMedica As Boolean
Get
If ViewState("SeEstaFActurandoVentaMedica") Is Nothing Then
ViewState("SeEstaFActurandoVentaMedica") = False
End If
Return Boolean.Parse(ViewState("SeEstaFActurandoVentaMedica").ToString)
End Get
Set(value As Boolean)
ViewState("SeEstaFActurandoVentaMedica") = value
End Set
End Property
Public Property CveTipoVenta As Integer
Get
If ViewState("CveTipoVenta") Is Nothing Then
ViewState("CveTipoVenta") = -1
End If
Return ViewState("CveTipoVenta").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveTipoVenta") = value
End Set
End Property
#End Region
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
If Not IsPostBack Then If Not IsPostBack Then
@@ -5819,14 +5866,16 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
If DbRowVenta("CveMedico").ToString.ToEntero > 0 Then CveTipoVenta = If(DbRowVenta("CveTipoVenta").ToString.ToEntero > 0, DbRowVenta("CveTipoVenta").ToString.ToEntero, -1)
TrObsMedico1.Visible = True
TrObsMedico2.Visible = True
TrObsProcedimiento1.Visible = True
TrObsProcedimiento2.Visible = True
DdlMedicoObservaciones.SelectedValueExist(DbRowVenta("CveMedico").ToString) If DbRowVenta("CveMedico").ToString.ToEntero > 0 AndAlso CveTipoVenta.Contiene(1, 3, 5) Then
DdlProcedimientoObservaciones.SelectedValueExist(DbRowVenta("CveProcedimiento").ToString) TrVentasMedicas1.Visible = True
DdlMedico.SelectedValueExist(DbRowVenta("CveMedico").ToString)
DdlProcedimiento.SelectedValueExist(DbRowVenta("CveProcedimiento").ToString)
DdlMedico.Enabled = False
DdlProcedimiento.Enabled = False
End If End If
@@ -10528,6 +10577,10 @@ Partial Class Ventas
OnError("Ocurrió un error al limpiar los datos", ex) OnError("Ocurrió un error al limpiar los datos", ex)
End Try End Try
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
RegistraScript($"impresionDirecta('/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", CveVenta))}');", "Imprimir")
End If
Else Else
ObjVentas.RollBack() ObjVentas.RollBack()
@@ -11558,6 +11611,7 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso DvModalRequiereOSFecha.Visible Then If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso DvModalRequiereOSFecha.Visible Then
ObjFactura.Alfa1 = TxtFechaOS.Text.Trim ObjFactura.Alfa1 = TxtFechaOS.Text.Trim
ObjFactura.FechaEjecucion = TxtFechaOS.Text.Trim.ToDateTime ObjFactura.FechaEjecucion = TxtFechaOS.Text.Trim.ToDateTime
ObjFactura.FechaParaSurtir = TxtFechaOS.Text.Trim.ToDateTime
Else Else
ObjFactura.Alfa1 = TxtAlfa1.Text.Trim ObjFactura.Alfa1 = TxtAlfa1.Text.Trim
End If End If
@@ -13192,20 +13246,15 @@ Partial Class Ventas
Dim CveMedico As Integer = -1 Dim CveMedico As Integer = -1
Dim CveProcedimiento As Integer = -1 Dim CveProcedimiento As Integer = -1
Dim CveTipoVentaGuardar As Integer = -1
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
If SeEstaFActurandoVentaMedica Then CveMedico = DdlMedico.SelectedValue.ToEntero
CveMedico = DdlMedicoObservaciones.SelectedValue.ToEntero CveProcedimiento = DdlProcedimiento.SelectedValue.ToEntero
CveProcedimiento = DdlProcedimientoObservaciones.SelectedValue.ToEntero CveTipoVentaGuardar = If(SeEstaFActurandoVentaMedica, CveTipoVenta, RBLTipoVenta.SelectedValue.ToEntero)
Else
CveMedico = DdlMedico.SelectedValue.ToEntero
CveProcedimiento = DdlProcedimiento.SelectedValue.ToEntero
End If
End If End If
If Not ObjVentas.AddVenta(factura.TipoDocto, factura.Folio, factura.CveCliente, factura.CveClienteSucursal, factura.SubTotalTC, factura.DescuentoTC, If Not ObjVentas.AddVenta(factura.TipoDocto, factura.Folio, factura.CveCliente, factura.CveClienteSucursal, factura.SubTotalTC, factura.DescuentoTC,
factura.AmortizacionTC, factura.IVATC, factura.RetIVATC, factura.RetISRTC, factura.AmortizacionTC, factura.IVATC, factura.RetIVATC, factura.RetISRTC,
factura.TotalTC, factura.CveMoneda, factura.TipoCambio, factura.CveMetodoPago, factura.CondicionesPago, factura.FormaPago, factura.FechaPago, factura.Fecha, factura.MotivoDescuento, factura.TotalTC, factura.CveMoneda, factura.TipoCambio, factura.CveMetodoPago, factura.CondicionesPago, factura.FormaPago, factura.FechaPago, factura.Fecha, factura.MotivoDescuento,
@@ -13223,7 +13272,7 @@ Partial Class Ventas
Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=factura.CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text, Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=factura.CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text,
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:=RBLTipoVenta.SelectedValue.ToEntero, RequiereOS:=ChkRequiereTecnico.Checked) Then CveMedico:=CveMedico, CveProcedimiento:=CveProcedimiento, CveTipoVenta:=CveTipoVentaGuardar, RequiereOS:=ChkRequiereTecnico.Checked, FechaParaSurtir:=factura.FechaParaSurtir) 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
@@ -13333,13 +13382,16 @@ Partial Class Ventas
CargaNCDT(factura.CveVentaPadre, DdlTipoComprobante.SelectedValue, factura.Total, NuevaFactura:=NuevaFactura, ObjVentas:=ObjVentas) CargaNCDT(factura.CveVentaPadre, DdlTipoComprobante.SelectedValue, factura.Total, NuevaFactura:=NuevaFactura, ObjVentas:=ObjVentas)
End If End If
Dim EsatusAlmacen As Integer = If(RBLTipoVenta.SelectedValue = "5" AndAlso EsVentaMedica AndAlso DdlTipoComprobante.SelectedValue = "Ped", 1, 0) ', EstatusAlmacen:=EsatusAlmacen
'Se agregan los PS 'Se agregan los PS
For Each Row As DataRow In TmpDTDetalle.Rows For Each Row As DataRow In TmpDTDetalle.Rows
If Not ObjVentas.AddVentaDetalle(ObjVentas.CveVenta, Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDecimal, Row("CveUM").ToString().ToEntero(), If Not ObjVentas.AddVentaDetalle(ObjVentas.CveVenta, Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDecimal, Row("CveUM").ToString().ToEntero(),
Row("PU").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("ImporteIVA").ToString().ToDecimal, Math.Round((Row("Total").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)) * (1 + Row("PorcentajeIVA").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)))), 6), Row("PU").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("ImporteIVA").ToString().ToDecimal, Math.Round((Row("Total").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)) * (1 + Row("PorcentajeIVA").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)))), 6),
Row("Obs").ToString(), Row("Descuento").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("TipoDescuento").ToString().ToEntero(), Row("CveSubProyecto").ToString().ToEntero(), Row("CvePresupuestoIngreso").ToString().ToEntero(), TiempoEntrega:=Row("TiempoEntrega").ToString(), CveVentaDetallePadre:=Row("CveVentaDetalle").ToString().ToEntero(), Row("Obs").ToString(), Row("Descuento").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("TipoDescuento").ToString().ToEntero(), Row("CveSubProyecto").ToString().ToEntero(), Row("CvePresupuestoIngreso").ToString().ToEntero(), TiempoEntrega:=Row("TiempoEntrega").ToString(), CveVentaDetallePadre:=Row("CveVentaDetalle").ToString().ToEntero(),
CveContratoDetalle:=Row("CveContratoDetalle").ToString().ToEntero(), CvePromocionDetalle:=Row("CvePromocionDetalle").ToString().ToEntero(), IEPS:=Row("ImporteIEPS").ToString().ToDecimal, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString().ToEntero(), ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDecimal, ImporteRetISR:=Row("ImporteRetISR").ToString().ToDecimal, CveContratoDetalle:=Row("CveContratoDetalle").ToString().ToEntero(), CvePromocionDetalle:=Row("CvePromocionDetalle").ToString().ToEntero(), IEPS:=Row("ImporteIEPS").ToString().ToDecimal, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString().ToEntero(), ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDecimal, ImporteRetISR:=Row("ImporteRetISR").ToString().ToDecimal,
PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDecimal, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDecimal, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDecimal, CuentaPredial:=Row("CuentaPredial").ToString(), CvePrecioLista:=Row("CvePrecioLista").ToString().ToEntero(), CveActivoFijo:=Row("CveActivoFijo").ToString().ToEntero(), NumTurnos:=Row("NumTurnos").ToString().ToDecimal()) Then PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDecimal, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDecimal,
PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDecimal, CuentaPredial:=Row("CuentaPredial").ToString(), CvePrecioLista:=Row("CvePrecioLista").ToString().ToEntero(),
CveActivoFijo:=Row("CveActivoFijo").ToString().ToEntero(), NumTurnos:=Row("NumTurnos").ToString().ToDecimal(), EstatusAlmacen:=EsatusAlmacen) Then
ErrorList.Add("Ocurrió un error al agregar un Producto o Servicio a la Factura.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico") ErrorList.Add("Ocurrió un error al agregar un Producto o Servicio a la Factura.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Exit For Exit For
Else Else
@@ -16299,7 +16351,6 @@ Partial Class Ventas
End Function End Function
#End Region #End Region
#Region " BTN ELIMINAR " #Region " BTN ELIMINAR "
Protected Sub BtnEmitir_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnEmitir.Click Protected Sub BtnEmitir_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnEmitir.Click
@@ -16380,6 +16431,7 @@ Partial Class Ventas
Else Else
MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ") MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ")
End If End If
End If End If
'IMPRESION 'IMPRESION
@@ -16574,8 +16626,6 @@ Partial Class Ventas
End Sub End Sub
#End Region #End Region
#Region " VISTA PREVIA " #Region " VISTA PREVIA "
Protected Sub BtnVistaPrevia_Click(sender As Object, e As System.EventArgs) Handles BtnVistaPrevia.Click Protected Sub BtnVistaPrevia_Click(sender As Object, e As System.EventArgs) Handles BtnVistaPrevia.Click
VistaPreviaNew() VistaPreviaNew()
@@ -16584,195 +16634,6 @@ Partial Class Ventas
#End Region #End Region
#Region "I M A G E - B U T T O N S" #Region "I M A G E - B U T T O N S"
'Protected Function CancelarFactura(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjAC As ClsContPAQi, ByRef ObjBancos As ClsBancos) As Boolean
' Dim IDPoliza As Integer = -1
' Dim CvePrePoliza As Integer
' Dim CvePlantillaPoliza As Integer
' Dim ErrorCancelar As Boolean = False
' Dim Mensaje As String = ""
' Try
' ObjFacturaDevolucion.TipoDocto = ObjFactura.TipoDocto
' Dim TipoContable As Integer = -1
' If ObjFacturaDevolucion.TipoDocto.Contiene("Egs", "Dev") Then
' CvePlantillaPoliza = 7
' ElseIf ObjFacturaDevolucion.TipoDocto.Contiene("Ing", "Rem", "Ant") Then
' CvePlantillaPoliza = 4
' End If
' If UsuarioActual.Empresa.Funcionalidad(706) = "1" AndAlso Then
' End If
' CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardaEstatus", CvePlantillaPoliza, TxtTotal.Text.ToDouble, TxtTotal.Text.Replace(",", "").ToDouble, DdlMoneda.SelectedValue.ToEntero(), NowADS(), NombreCliente, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
' ObjFacturaDevolucion.CveVenta = CveVenta
' ObjFacturaDevolucion.CvePrePoliza = CvePrePoliza
' If NuevaFactura = 1 AndAlso UsuarioActual.TienePermisoProceso(222) Then
' If ObjVentas.GetVentaDetalle(ObjFacturaDevolucion.CveVenta) Then
' TmpDT = ObjVentas.DtResultados
' TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
' TmpDT.Columns.Add("TieneProntoPago", GetType(String))
' TmpDT.Columns.Add("ImporteProntoPago", GetType(Decimal))
' End If
' ErrorCancelar = ProcesoPrepolizas(ObjConta, ObjFacturaDevolucion, -1, TmpDT, ObjAC, -1, ObjBancos, ObjVentas)
' Else
' ErrorCancelar = ProcesoPrepolizas(ObjConta, ObjFacturaDevolucion, -1, TmpDT, ObjAC, -1, ObjBancos, ObjVentas)
' End If
' If Not ErrorCancelar Then
' ErrorCancelar = GuardarVentaImpuestosLocales(ObjVentas, ObjConta, ObjFacturaDevolucion, -1)
' End If
' If CveEstatus = 4 Then
' If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, "", NowADS(), CveVenta, IDPoliza) Then
' Mensaje = "El nuevo estatus se guardó correctamente"
' Else
' ErrorCancelar = True
' End If
' 'Si se está mandando a Cancelada SAT
' ElseIf CveEstatus = 5 Then
' Dim DT As DataTable = Nothing
' If FolioFiscal = "" Then
' Dim XmlDoc As New XmlDocument
' XmlDoc.Load(Ruta & "XML\" & DdlTipoComprobante.SelectedValue & "\" & VentaFolio & ".xml")
' ViewState("FolioFiscal") = XmlDoc.DocumentElement("cfdi:Complemento").FirstChild.Attributes("UUID").InnerText
' End If
' Dim ObjCancelacion As New Timbrado
' Dim Total As Decimal = TxtTotal.Text.ToDecimal
' Dim RFCReceptor As String = HdnRFCVenta.Value
' If Not ObjVentas.UpdateEstatusFactura(13, FolioFiscal, "", NowADS(), CveVenta, IDPoliza) Then 'Marcamos la factura como refacturada, si no se cancelo en el SAT el estatus nos dejara cancelarla despues
' ErrorCancelar = True
' End If
' Dim RespCancelacion = ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, UsuarioActual.Empresa.RFC)
' If RespCancelacion.Verificado Then
' 'falta verificar traer el acuse y reenviarlo
' If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
' Dim IDMPoliza As Modelos.RetornoPolizaConta = GenerarPolizaAC(ObjAC, ObjFacturaDevolucion, True)
' IDPoliza = IDMPoliza.IdPoliza
' If IDMPoliza.IdPoliza <= 0 Then
' Mensaje = "No se pudo generar la poliza"
' ErrorCancelar = True
' End If
' End If
' If Not ErrorCancelar Then
' If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, ObjCancelacion.CancelacionAcuse, NowADS(), CveVenta, IDPoliza, CvePAC:=UsuarioActual.Empresa.CvePAC) Then
' Mensaje = "El nuevo estatus se guardó correctamente"
' Else
' ErrorCancelar = True
' End If
' End If
' Else
' ErrorCancelar = True
' End If
' ObjCancelacion = Nothing
' End If
' Catch ex As Exception
' GuardaLog("CancelF." & ex.ToString())
' ErrorCancelar = True
' End Try
' Return Not ErrorCancelar
'End Function
'Protected Function CancelarFactura2(ObjVentas As ClsVentas, ObjConta As ClsContabilidad, ObjAC As ClsContPAQi, ObjBancos As ClsBancos) As Boolean
' Dim IDPoliza As Integer = -1
' Dim CvePrePoliza As Integer
' Dim CvePlantillaPoliza As Integer
' Dim ErrorCancelar As Boolean = False
' Dim Mensaje As String = ""
' CreaObjetosVenta()
' If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
' CvePlantillaPoliza = 7
' ElseIf ObjFactura.TipoDocto.Contiene("Ing", "Rem") Then
' CvePlantillaPoliza = 4
' End If
' CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardaEstatus", CvePlantillaPoliza, TxtTotal.Text.ToDouble, TxtTotal.Text.Replace(",", "").ToDouble, DdlMoneda.SelectedValue.ToEntero(), NowADS(), NombreCliente, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
' ObjFactura.CveVenta = CveVenta
' ObjFactura.CvePrePoliza = CvePrePoliza
' If HplSaldoAuxiliar.Text.ToDecimal > 0 Then
' ErrorCancelar = ProcesoPrepolizas(ObjConta, ObjFactura, -1, TmpDT, ObjAC, -1, ObjBancos, ObjVentas)
' End If
' If Not ErrorCancelar Then
' ErrorCancelar = GuardarVentaImpuestosLocales(ObjVentas, ObjConta, ObjFactura, -1)
' End If
' If CveEstatus = 4 Then
' If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, "", NowADS(), CveVenta, IDPoliza) Then
' Mensaje = "El nuevo estatus se guardó correctamente"
' Else
' ErrorCancelar = True
' End If
' 'Si se está mandando a Cancelada SAT
' ElseIf CveEstatus = 5 Then
' Dim DT As DataTable = Nothing
' If FolioFiscal = "" Then
' Dim XmlDoc As New XmlDocument
' XmlDoc.Load(Ruta & "XML\" & DdlTipoComprobante.SelectedValue & "\" & VentaFolio & ".xml")
' ViewState("FolioFiscal") = XmlDoc.DocumentElement("cfdi:Complemento").FirstChild.Attributes("UUID").InnerText
' End If
' 'Si es cancelar en el SAT:
' Dim CFDi As New ClbNegBICFDv3_2.ClsNegEDI
' Dim Respuesta As New ClbNegBICFDv3_2.ClsNegRespuesta
' Respuesta = CFDi.CancelaCFdi(UsuarioActual.Empresa.BIUsuario, UsuarioActual.Empresa.BIContraseña, Ruta & "Certificados\" & UsuarioActual.Empresa.ArchivoPfx, UsuarioActual.Empresa.ContraseñaKey, UsuarioActual.Empresa.RFC, FolioFiscal, "http://208.43.160.178/srvCFDi/service1.asmx")
' If Respuesta Is Nothing Then
' 'Alert("La factura no se pudo cancelar. <br />Posbiles causas:<br />&nbsp;&nbsp;- Los servicios del SAT están ocupados.<br />&nbsp;&nbsp;- El Folio Fiscal no ha quedado registrado.", TipoMensaje.MsgError)
' Me.GuardaLog(CFDi.MsgError)
' ErrorCancelar = True
' Mensaje = "La factura no se pudo cancelar. <br />Posbiles causas:<br />&nbsp;&nbsp;- Los servicios del SAT están ocupados.<br />&nbsp;&nbsp;- El Folio Fiscal no ha quedado registrado."
' ElseIf Respuesta.NoCertificadoSAT <> String.Empty Then
' If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
' Dim IDMPoliza As Modelos.RetornoPolizaConta = GenerarPolizaAC(ObjAC, ObjFacturaDevolucion, True)
' IDPoliza = IDMPoliza.IdPoliza
' If IDMPoliza.IdPoliza <= 0 Then
' Mensaje = "No se pudo generar la poliza"
' ErrorCancelar = True
' End If
' End If
' If Not ErrorCancelar Then
' If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, Respuesta.NoCertificadoSAT, Respuesta.FechaTimbrado, CveVenta, IDPoliza) Then
' Mensaje = "El nuevo estatus se guardó correctamente"
' Else
' ErrorCancelar = True
' End If
' End If
' End If
' End If
' Return Not ErrorCancelar
'End Function
Protected Sub ImgBtnAddC_Click(sender As Object, e As ImageClickEventArgs) Handles ImgBtnAddC.Click Protected Sub ImgBtnAddC_Click(sender As Object, e As ImageClickEventArgs) Handles ImgBtnAddC.Click
Dim Row As DataRow = Nothing Dim Row As DataRow = Nothing
Row = DTmpC.NewRow Row = DTmpC.NewRow
@@ -21702,7 +21563,6 @@ Partial Class Ventas
BtnEditarRemision.Visible = True BtnEditarRemision.Visible = True
BtnPermisoEditarRemision.Visible = False BtnPermisoEditarRemision.Visible = False
BtnCrearApartirDe.Visible = False BtnCrearApartirDe.Visible = False
DdlSucursalCliente.Enabled = True
TxtObsFact.Enabled = True TxtObsFact.Enabled = True
TxtOrdenCompra.Enabled = True TxtOrdenCompra.Enabled = True
TxtPedidoContrato.Enabled = True TxtPedidoContrato.Enabled = True
@@ -21713,12 +21573,18 @@ Partial Class Ventas
UPCondicionesPago.Update() UPCondicionesPago.Update()
If Me.PermiteCredito Then RBLPago.Enabled = True If Me.PermiteCredito Then RBLPago.Enabled = True
DdlVendedor.Enabled = True DdlVendedor.Enabled = True
DdlSucursalCliente.Enabled = True
ModalidadEdicion = True ModalidadEdicion = True
ViewState("CveClienteAnterior") = CveCliente ViewState("CveClienteAnterior") = CveCliente
DdlMedicoObservaciones.Enabled = True If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso CveTipoVenta.Contiene(1, 3, 5) Then
DdlProcedimientoObservaciones.Enabled = True TrVentasMedicas1.Visible = True
DdlMedico.Enabled = True
DdlProcedimiento.Enabled = True
End If
Dim CantidadFacturadaRemision As Decimal = 0 Dim CantidadFacturadaRemision As Decimal = 0
@@ -21767,6 +21633,7 @@ Partial Class Ventas
TxtPrecio.Enabled = True TxtPrecio.Enabled = True
End If End If
LbAgregar.Enabled = True LbAgregar.Enabled = True
ImgDescTotal.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '2'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = ''; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = 'none'; $get('BtnAplicarDescG').style.display = ''; $get('TrMotivoDescuento').style.display = '';") ImgDescTotal.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '2'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = ''; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = 'none'; $get('BtnAplicarDescG').style.display = ''; $get('TrMotivoDescuento').style.display = '';")
LblSubTotal1.Text = TxtSubTotal.Text LblSubTotal1.Text = TxtSubTotal.Text
@@ -21795,7 +21662,7 @@ Partial Class Ventas
Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero() Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero()
Dim TipoCambio As Decimal = TxtTipoCambio.Text.ToDecimal Dim TipoCambio As Decimal = TxtTipoCambio.Text.ToDecimal
EditoRemision = True EditoRemision = True
CveClienteSucursal = DdlSucursalCliente.SelectedValue.ToEntero CveClienteSucursal = DdlClienteSucursal.SelectedValue.ToEntero
Try Try
'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS 'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS
If DdlMoneda.SelectedValue.ToEntero() <> 2 AndAlso ChkConvertirDolares.Checked Then If DdlMoneda.SelectedValue.ToEntero() <> 2 AndAlso ChkConvertirDolares.Checked Then
@@ -21870,14 +21737,13 @@ Partial Class Ventas
Moneda = 1 Moneda = 1
End If End If
'Actualizo los parametros de la venta
If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal, TxtIVA.Text.ToDecimal, TxtIEPS.Text.ToDecimal, TxtTotal.Text.ToDecimal, Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim, If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal, TxtIVA.Text.ToDecimal, TxtIEPS.Text.ToDecimal, TxtTotal.Text.ToDecimal, Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim,
UsuarioActual.CveEmpresa, CveVenta, UsuarioActual.CveEmpresa, CveVenta,
Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1), Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1),
PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(),
CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:=DdlTipoComprobante.SelectedValue, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:=DdlTipoComprobante.SelectedValue, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal,
OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDecimal, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDecimal, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(),
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedicoObservaciones.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimientoObservaciones.SelectedValue.ToEntero) Then CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero) Then
OcurrioError = True OcurrioError = True
End If End If
@@ -30399,6 +30265,8 @@ Partial Class Ventas
Moneda = 1 Moneda = 1
End If End If
'ACTUALIZA VENTA
'ACTUALIZA VENTA 'ACTUALIZA VENTA
If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal(), TxtIVA.Text.ToDecimal(), TxtIEPS.Text.ToDecimal(), TxtTotal.Text.ToDecimal(), If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal(), TxtIVA.Text.ToDecimal(), TxtIEPS.Text.ToDecimal(), TxtTotal.Text.ToDecimal(),
Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim, Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim,
@@ -30411,6 +30279,8 @@ Partial Class Ventas
OcurrioError = True OcurrioError = True
End If End If
'ELIMINA DETALLES 'ELIMINA DETALLES
If Not ObjVentas.RemoveVentasDetalle(CveVenta) Then If Not ObjVentas.RemoveVentasDetalle(CveVenta) Then
MensajeError = "Ocurrió un error al actualizar las partidas de la cotización" MensajeError = "Ocurrió un error al actualizar las partidas de la cotización"
@@ -33676,9 +33546,10 @@ Partial Class Ventas
DdlUsoCFDI.Enabled = True DdlUsoCFDI.Enabled = True
End If End If
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso CveTipoVenta.Contiene(1, 3, 5) Then
DdlMedicoObservaciones.Enabled = True TrVentasMedicas1.Visible = True
DdlProcedimientoObservaciones.Enabled = True DdlMedico.Enabled = True
DdlProcedimiento.Enabled = True
End If End If
If UsuarioActual.TienePermisoProceso(289) Then If UsuarioActual.TienePermisoProceso(289) Then
@@ -33719,12 +33590,12 @@ Partial Class Ventas
Dim ObjVentas As New ClsVentas() Dim ObjVentas As New ClsVentas()
ObjVentas.IniciaTransacSQL() ObjVentas.IniciaTransacSQL()
DdlMedicoObservaciones.Enabled = True 'DdlMedicoObservaciones.Enabled = True
DdlProcedimientoObservaciones.Enabled = True 'DdlProcedimientoObservaciones.Enabled = True
If Not ObjVentas.UpdateObservacionesVenta(Me.CveVenta, UsuarioActual.CveEmpresa, DdlVendedor.SelectedValue.ToEntero(), TxtObsFact.Text, RblPaqueteria.SelectedValue.ToEntero(), TxtCorreoNotificaciones.Text, If Not ObjVentas.UpdateObservacionesVenta(Me.CveVenta, UsuarioActual.CveEmpresa, DdlVendedor.SelectedValue.ToEntero(), TxtObsFact.Text, RblPaqueteria.SelectedValue.ToEntero(), TxtCorreoNotificaciones.Text,
TxtObsAlmacen.Text, TxtPedidoContrato.Text, TxtOrdenCompra.Text, TxtFechaPago.Text, DdlUsoCFDI.SelectedValue.ToEntero, DescripcionVenta:=TxtDescripcionVenta.Text.Trim, TxtObsAlmacen.Text, TxtPedidoContrato.Text, TxtOrdenCompra.Text, TxtFechaPago.Text, DdlUsoCFDI.SelectedValue.ToEntero, DescripcionVenta:=TxtDescripcionVenta.Text.Trim,
CveMedico:=DdlMedicoObservaciones.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimientoObservaciones.SelectedValue.ToEntero) Then CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero) Then
TieneError = True TieneError = True
End If End If
@@ -35045,34 +34916,7 @@ Partial Class Ventas
End Set End Set
End Property End Property
Property EsVentaMedica As Boolean
Get
If ViewState("EsVentaMedica") Is Nothing Then
ViewState("EsVentaMedica") = False
End If
Return Boolean.Parse(ViewState("EsVentaMedica").ToString)
End Get
Set(value As Boolean)
ViewState("EsVentaMedica") = value
End Set
End Property
Property SeEstaFActurandoVentaMedica As Boolean
Get
If ViewState("SeEstaFActurandoVentaMedica") Is Nothing Then
ViewState("SeEstaFActurandoVentaMedica") = False
End If
Return Boolean.Parse(ViewState("SeEstaFActurandoVentaMedica").ToString)
End Get
Set(value As Boolean)
ViewState("SeEstaFActurandoVentaMedica") = value
End Set
End Property
@@ -36057,7 +35901,7 @@ Partial Class Ventas
RBLTipoVenta.DataSource = GlobalDTTipoVenta().FiltraParametros("Estatus = 'True' ") RBLTipoVenta.DataSource = GlobalDTTipoVenta().FiltraParametros("Estatus = 'True' ")
RBLTipoVenta.DataBind() RBLTipoVenta.DataBind()
RBLTipoVenta.Items.Add(New ListItem("Otros", "5")) RBLTipoVenta.Items.Add(New ListItem("Otros", "99"))
TrVentasMedicas1.Visible = True TrVentasMedicas1.Visible = True
TrVentasMedicas2.Visible = True TrVentasMedicas2.Visible = True
@@ -36076,8 +35920,7 @@ Partial Class Ventas
DdlProcedimientoModal.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ") DdlProcedimientoModal.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
DdlProcedimientoModal.DataBind() DdlProcedimientoModal.DataBind()
DdlProcedimientoObservaciones.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa)
DdlProcedimientoObservaciones.DataBind()
End Sub End Sub
@@ -36088,8 +35931,7 @@ Partial Class Ventas
DdlMedicoModal.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ") DdlMedicoModal.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
DdlMedicoModal.DataBind() DdlMedicoModal.DataBind()
DdlMedicoObservaciones.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa)
DdlMedicoObservaciones.DataBind()
End Sub End Sub
@@ -36140,7 +35982,11 @@ Partial Class Ventas
End Sub End Sub
Protected Sub ChkRequiereTecnico_CheckedChanged(sender As Object, e As EventArgs) Protected Sub ChkRequiereTecnico_CheckedChanged(sender As Object, e As EventArgs)
TdFechaOS2.Visible = ChkRequiereTecnicoModal.Checked
TdFechaOS1.Visible = ChkRequiereTecnico.Checked
TdFechaOS2.Visible = ChkRequiereTecnico.Checked
UpCliente.Update() UpCliente.Update()
End Sub End Sub
@@ -36167,7 +36013,7 @@ Partial Class Ventas
Select Case RBLTipoVenta.SelectedValue Select Case RBLTipoVenta.SelectedValue
Case "1" ' Fuera de linea Case "1", "5" '1 Fuera de linea || 5 Consignación - Uso material
ChkRequiereTecnicoModal.Checked = True ChkRequiereTecnicoModal.Checked = True
ChkRequiereTecnicoModal.Enabled = True ChkRequiereTecnicoModal.Enabled = True
DvModalRequiereOSFecha.Visible = True DvModalRequiereOSFecha.Visible = True
@@ -36181,13 +36027,13 @@ Partial Class Ventas
DvModalRequiereOSFecha.Visible = False DvModalRequiereOSFecha.Visible = False
DvModalTipoVentaPasoMedicoProcedimiento.Visible = False DvModalTipoVentaPasoMedicoProcedimiento.Visible = False
DVGvProductosProcedimiento.Visible = False DVGvProductosProcedimiento.Visible = False
Case "4" 'Consigna Case "4" 'Consignación
ChkRequiereTecnicoModal.Checked = False ChkRequiereTecnicoModal.Checked = False
DvModalTipoVentaPasoRequiereOS.Visible = False DvModalTipoVentaPasoRequiereOS.Visible = False
DvModalRequiereOSFecha.Visible = False DvModalRequiereOSFecha.Visible = False
DvModalTipoVentaPasoMedicoProcedimiento.Visible = False DvModalTipoVentaPasoMedicoProcedimiento.Visible = False
DVGvProductosProcedimiento.Visible = False DVGvProductosProcedimiento.Visible = False
Case "5" ' Otros Case "99" ' Otros
LnkDvModalTipoVentaAceptar.Visible = False LnkDvModalTipoVentaAceptar.Visible = False
UpDvModalTipoVenta.Update() UpDvModalTipoVenta.Update()
RegistraScript("$('#DvModalTipoVenta').modal('hide');") RegistraScript("$('#DvModalTipoVenta').modal('hide');")
@@ -36290,6 +36136,8 @@ Partial Class Ventas
Protected Sub LnkDvModalTipoVentaAceptar_Click(sender As Object, e As EventArgs) Protected Sub LnkDvModalTipoVentaAceptar_Click(sender As Object, e As EventArgs)
If DdlClienteSucursalCliente() > 0 Then If DdlClienteSucursalCliente() > 0 Then
ViewState("CveCliente") = DdlClienteSucursalCliente() ViewState("CveCliente") = DdlClienteSucursalCliente()
Else Else
@@ -36318,21 +36166,46 @@ Partial Class Ventas
DdlMedico.SelectedValueExist(DdlMedicoModal.SelectedValue) DdlMedico.SelectedValueExist(DdlMedicoModal.SelectedValue)
DdlProcedimiento.SelectedValueExist(DdlProcedimientoModal.SelectedValue) DdlProcedimiento.SelectedValueExist(DdlProcedimientoModal.SelectedValue)
'si es pago directo es factura
If RBLTipoVenta.SelectedValue.Contiene("2") Then ' Pago Directo If RBLTipoVenta.SelectedValue.Contiene("2") Then 'si es pago directo es factura
DdlTipoComprobante.SelectedValueExist("Ing") DdlTipoComprobante.SelectedValueExist("Ing")
TdRequiereTecnico1.Visible = True
TdRequiereTecnico2.Visible = True TrVentasMedicas1.Visible = True
ElseIf RBLTipoVenta.SelectedValue.Contiene("4") Then ' Consigna TrVentasMedicas2.Visible = True
DdlTipoComprobante.SelectedValueExist("Ing")
Else TdFechaOS1.Visible = True
TdFechaOS1.Visible = True TdFechaOS2.Visible = True
TdFechaOS2.Visible = True ChkRequiereTecnico.Checked = True
ChkRequiereTecnico.Checked = True ChkRequiereTecnico.Enabled = False
ChkRequiereTecnico.Enabled = False
DdlTipoComprobante.Items.Insert(DdlTipoComprobante.Items.Count, New ListItem("Pedido", "Ped")) ElseIf RBLTipoVenta.SelectedValue.Contiene("3") Then ' A vista
DdlTipoComprobante.SelectedValueExist("Ped") DdlTipoComprobante.Items.Insert(DdlTipoComprobante.Items.Count, New ListItem("Pedido", "Ped"))
End If DdlTipoComprobante.SelectedValueExist("Ped")
TrVentasMedicas1.Visible = False
TrVentasMedicas2.Visible = False
ChkRequiereTecnico.Enabled = True
ElseIf RBLTipoVenta.SelectedValue.Contiene("4") Then ' consignacion
DdlTipoComprobante.SelectedValueExist("Ing")
TrVentasMedicas1.Visible = False
TrVentasMedicas2.Visible = False
ChkRequiereTecnico.Enabled = True
Else
DdlTipoComprobante.Items.Insert(DdlTipoComprobante.Items.Count, New ListItem("Pedido", "Ped"))
DdlTipoComprobante.SelectedValueExist("Ped")
TrVentasMedicas1.Visible = True
TrVentasMedicas2.Visible = True
TdFechaOS1.Visible = True
TdFechaOS2.Visible = True
ChkRequiereTecnico.Enabled = True
ChkRequiereTecnico.Checked = ChkRequiereTecnicoModal.Checked
TdFechaOS1.Visible = ChkRequiereTecnicoModal.Checked
TdFechaOS2.Visible = ChkRequiereTecnicoModal.Checked
End If
DdlTipoComprobante.Enabled = False DdlTipoComprobante.Enabled = False
CargaCliente(CveCliente) CargaCliente(CveCliente)