This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2021-09-09 07:50:51 -07:00
32 changed files with 3119 additions and 2065 deletions

View File

@@ -235,7 +235,9 @@ End Class
<Serializable> <Serializable>
Public Class CFDIComplementos Public Class CFDIComplementos
Public Property ComercioExterior11 As CFDIComercioExterior11 Public Property ComercioExterior11 As CFDIComercioExterior11
Public Property CartaPorte As CFDICartaPorte
Sub New() Sub New()
ComercioExterior11 = New CFDIComercioExterior11 ComercioExterior11 = New CFDIComercioExterior11
@@ -568,4 +570,151 @@ Public Class CFDIComercioExterior11MercanciasDescripcionesEspecificas
Public Property Modelo As String = "" Public Property Modelo As String = ""
Public Property SubModelo As String = "" Public Property SubModelo As String = ""
Public Property NumeroSerie As String = "" Public Property NumeroSerie As String = ""
End Class End Class
<Serializable>
Public Class CFDICartaPorte
Public Property TranspInternac As String = ""
Public Property EntradaSalidaMercancia As String = ""
Public Property ViaEntradaSalida As String = ""
Public Property TotalDistanciaRecorrida As Double = 0
Public Property Ubicaciones As New List(Of CFDICartaPorteUbicaciones)
Public Property Mercancias As New CFDICartaPorteMercancias
Public Property FiguraTransporte As New CFDICartaPorteFiguraTransporte
End Class
<Serializable>
Public Class CFDICartaPorteUbicaciones
Public Property TipoEstacion As String = ""
Public Property DistanciaRecorrida As Double = 0
'Public Property Ubicacion As New CFDICartaPorteUbicacion
Public Property Origen As New CFDICartaPorteUbicacionOrigen
Public Property Destino As New CFDICartaPorteUbicacionDestino
End Class
<Serializable>
Public Class CFDICartaPorteAutoTransporteFederal
Public Property PermSCT As String = ""
Public Property NumPermisoSCT As String = ""
Public Property NombreAseg As String = ""
Public Property NumPolizaSeguro As String = ""
Public Property Vehiculo As New CFDICartaPorteIdentificacionVehicular
Public Property Remolques As New List(Of CFDICartaPorteRemolque)
End Class
<Serializable>
Public Class CFDICartaPorteUbicacionOrigen
Public Property IDOrigen As String = ""
Public Property RFCRemitente As String = ""
Public Property NombreRemitente As String = ""
Public Property NumRegIdTrib As String = ""
Public Property ResidenciaFiscal As String = ""
Public Property NumEstacion As String = ""
Public Property NombreEstacion As String = ""
Public Property NavegacionTrafico As String = ""
Public Property FechaHoraSalida As String = ""
Public Property Domicilio As New CFDICartaPorteDomicilio
End Class
<Serializable>
Public Class CFDICartaPorteUbicacionDestino
Public Property IDDestino As String = ""
Public Property RFCDestinatario As String = ""
Public Property NombreDestinatario As String = ""
Public Property NumRegIdTrib As String = ""
Public Property ResidenciaFiscal As String
Public Property NumEstacion As String
Public Property NombreEstacion As String
Public Property NavegacionTrafico As String
Public Property FechaHoraProgLlegada As String
Public Property Domicilio As New CFDICartaPorteDomicilio
End Class
<Serializable>
Public Class CFDICartaPorteDomicilio
Public Property Calle As String = ""
Public Property NumeroExterior As String = ""
Public Property NumeroInterior As String = ""
Public Property Colonia As String = ""
Public Property Localidad As String = ""
Public Property Referencia As String = ""
Public Property Municipio As String = ""
Public Property Estado As String = ""
Public Property Pais As String = ""
Public Property CP As String = ""
End Class
<Serializable>
Public Class CFDICartaPorteMercancias
Public Property PesoBrutoTotal As Double = 0
Public Property UnidadPeso As String = ""
Public ReadOnly Property PesoNetoTotal As Double
Get
Return Mercancias.Sum(Function(item) item.PesoenKg)
End Get
End Property
Public ReadOnly Property NumTotalMercancias As Integer
Get
'Return Mercancias.Sum(Function(item) item.Cantidad).ToEntero
Return Mercancias.Count
End Get
End Property
Public Property CargoporTasacion As Double = 0
Public Property Mercancias As New List(Of CFDICartaPorteMercancia)
End Class
<Serializable>
Public Class CFDICartaPorteMercancia
Public Property BienesTransp As String = ""
Public Property ClaveSTCC As String = ""
Public Property Descripción As String = ""
Public Property Cantidad As Decimal = 0
Public Property ClaveUnidad As String = ""
Public Property Unidad As String = ""
Public Property Dimensiones As String = ""
Public Property ClaveMaterialPeligroso As String = ""
Public Property MaterialPeligroso As String = ""
Public Property Embalaje As String = ""
Public Property DescripEmbalaje As String = ""
Public Property PesoenKg As Double
Public Property ValorMercancia As Double
Public Property Moneda As String = ""
Public Property FraccionArrancelaria As String = ""
Public Property UUIDComercioExt As String = ""
End Class
<Serializable>
Public Class CFDICartaPorteIdentificacionVehicular
Public Property ConfigVehicular As String = ""
Public Property PlacaVM As String = ""
Public Property AnioModeloVM As Integer = 0
End Class
<Serializable>
Public Class CFDICartaPorteRemolque
Public Property SubTipoRemolque As String = ""
Public Property Placa As String = ""
Public Property AnioModeloVM As String = ""
End Class
<Serializable>
Public Class CFDICartaPorteFiguraTransporte
Public Property ClaveTransporte As String = "01"
Public Property AutoTransporteFederal As New CFDICartaPorteAutoTransporteFederal
Public Property Operadores As New List(Of CFDICartaPorteOperador)
End Class
<Serializable>
Public Class CFDICartaPorteOperador
Public Property RFCOperador As String = ""
Public Property NumLicencia As String = ""
Public Property NombreOperador As String = ""
Public Property NumRegidTribOperador As String = ""
Public Property ResidenciaFiscalOperador As String = ""
Public Property Domicilio As New CFDICartaPorteDomicilio
End Class

View File

@@ -109,7 +109,8 @@ Public Class ClsAcarreos
#Region "Choferes" #Region "Choferes"
Public Function AddChofer(Chofer As String, CveUsuario As Integer, CveEmpresa As Integer, CveTransportista As Integer, Identificacion As String, Domicilio As String, Telefono As String, Ciudad As String, Licencia As String) As Boolean Public Function AddChofer(Chofer As String, CveUsuario As Integer, CveEmpresa As Integer, CveTransportista As Integer, Identificacion As String, Telefono As String, Licencia As String, RFC As String, Domicilio As String,
Optional NumeroExterior As String = "", Optional NumeroInterior As String = "", Optional Colonia As String = "", Optional Ciudad As String = "", Optional Estado As String = "", Optional CP As String = "") As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Acar_ChoferesAdd") DataAdapter("PA_Acar_ChoferesAdd")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -118,10 +119,16 @@ Public Class ClsAcarreos
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveTransportista", SqlDbType.Int).Value = CveTransportista .Add("@CveTransportista", SqlDbType.Int).Value = CveTransportista
.Add("@Identificacion", SqlDbType.VarChar).Value = Identificacion .Add("@Identificacion", SqlDbType.VarChar).Value = Identificacion
.Add("@Domicilio", SqlDbType.VarChar).Value = Domicilio
.Add("@Telefono", SqlDbType.VarChar).Value = Telefono .Add("@Telefono", SqlDbType.VarChar).Value = Telefono
.Add("@Ciudad", SqlDbType.VarChar).Value = Ciudad
.Add("@Licencia", SqlDbType.VarChar).Value = Licencia .Add("@Licencia", SqlDbType.VarChar).Value = Licencia
.Add("@RFC", SqlDbType.VarChar).Value = RFC
.Add("@Domicilio", SqlDbType.VarChar).Value = Domicilio
.Add("@NumeroExterior", SqlDbType.VarChar).Value = NumeroExterior
.Add("@NumeroInterior", SqlDbType.VarChar).Value = NumeroInterior
.Add("@Colonia", SqlDbType.VarChar).Value = Colonia
.Add("@Ciudad", SqlDbType.VarChar).Value = Ciudad
.Add("@Estado", SqlDbType.VarChar).Value = Estado
.Add("@CP", SqlDbType.VarChar).Value = CP
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)
@@ -133,7 +140,8 @@ Public Class ClsAcarreos
Return Retorno Return Retorno
End Function End Function
Public Function UpdateChofer(CveChofer As Integer, Chofer As String, CveUsuario As Integer, CveEmpresa As Integer, Estatus As Integer, CveTransportista As Integer, Identificacion As String, Domicilio As String, Telefono As String, Ciudad As String, Licencia As String) As Boolean Public Function UpdateChofer(CveChofer As Integer, Chofer As String, CveUsuario As Integer, CveEmpresa As Integer, Estatus As Integer, CveTransportista As Integer, Identificacion As String, Telefono As String, Licencia As String, RFC As String, Domicilio As String,
Optional NumeroExterior As String = "", Optional NumeroInterior As String = "", Optional Colonia As String = "", Optional Ciudad As String = "", Optional Estado As String = "", Optional CP As String = "") As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Acar_ChoferesUpdate") DataAdapter("PA_Acar_ChoferesUpdate")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -141,13 +149,19 @@ Public Class ClsAcarreos
.Add("@Chofer", SqlDbType.VarChar).Value = Chofer .Add("@Chofer", SqlDbType.VarChar).Value = Chofer
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Estatus", SqlDbType.Int).Value = Estatus
.Add("@CveTransportista", SqlDbType.Int).Value = CveTransportista .Add("@CveTransportista", SqlDbType.Int).Value = CveTransportista
.Add("@Identificacion", SqlDbType.VarChar).Value = Identificacion .Add("@Identificacion", SqlDbType.VarChar).Value = Identificacion
.Add("@Domicilio", SqlDbType.VarChar).Value = Domicilio
.Add("@Telefono", SqlDbType.VarChar).Value = Telefono .Add("@Telefono", SqlDbType.VarChar).Value = Telefono
.Add("@Ciudad", SqlDbType.VarChar).Value = Ciudad
.Add("@Licencia", SqlDbType.VarChar).Value = Licencia .Add("@Licencia", SqlDbType.VarChar).Value = Licencia
.Add("@RFC", SqlDbType.VarChar).Value = RFC
.Add("@Domicilio", SqlDbType.VarChar).Value = Domicilio
.Add("@NumeroExterior", SqlDbType.VarChar).Value = NumeroExterior
.Add("@NumeroInterior", SqlDbType.VarChar).Value = NumeroInterior
.Add("@Colonia", SqlDbType.VarChar).Value = Colonia
.Add("@Ciudad", SqlDbType.VarChar).Value = Ciudad
.Add("@Estado", SqlDbType.VarChar).Value = Estado
.Add("@CP", SqlDbType.VarChar).Value = CP
.Add("@Estatus", SqlDbType.Int).Value = Estatus
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -5774,7 +5774,7 @@ Public Class ClsContabilidad
Public Function AddCuentasAsignaciones(Optional CveConceptoContable As Integer = -1, Optional CveEmpresa As Integer = -1, Optional CveCuenta As Integer = -1, Optional IdCtaContable As Integer = -1, Public Function AddCuentasAsignaciones(Optional CveConceptoContable As Integer = -1, Optional CveEmpresa As Integer = -1, Optional CveCuenta As Integer = -1, Optional IdCtaContable As Integer = -1,
Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1,
Optional CveAlmacen As Integer = -1, Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1, Optional CveAlmacen As Integer = -1, Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1,
Optional CveSubProyecto As Integer = -1) As Boolean Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1) As Boolean
Dim Retorno = False Dim Retorno = False
DataAdapter("PA_Conta_CuentasAsignacionesAdd") DataAdapter("PA_Conta_CuentasAsignacionesAdd")
@@ -5793,6 +5793,7 @@ Public Class ClsContabilidad
.Add("@CveConceptoNomina", SqlDbType.Decimal).Value = CveConceptoNomina .Add("@CveConceptoNomina", SqlDbType.Decimal).Value = CveConceptoNomina
.Add("@CveBancoCuenta", SqlDbType.Int).Value = CveBancoCuenta .Add("@CveBancoCuenta", SqlDbType.Int).Value = CveBancoCuenta
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
End With End With
Try Try
@@ -5828,7 +5829,7 @@ Public Class ClsContabilidad
Optional IdCtaContable As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional IdCtaContable As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1,
Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveAlmacen As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveAlmacen As Integer = -1,
Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1, Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1,
Optional CveSubProyecto As Integer = -1) As Boolean Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1) As Boolean
Dim Retorno = False Dim Retorno = False
DataAdapter("PA_Conta_CuentasAsignacionesUpdate") DataAdapter("PA_Conta_CuentasAsignacionesUpdate")
@@ -5847,6 +5848,7 @@ Public Class ClsContabilidad
.Add("@CveConceptoNomina", SqlDbType.Decimal).Value = CveConceptoNomina .Add("@CveConceptoNomina", SqlDbType.Decimal).Value = CveConceptoNomina
.Add("@CveBancoCuenta", SqlDbType.Int).Value = CveBancoCuenta .Add("@CveBancoCuenta", SqlDbType.Int).Value = CveBancoCuenta
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
End With End With
Try Try

View File

@@ -2525,7 +2525,7 @@ Public Class ClsGenerales
Public Function GetHistorialBitacora(CveAcarreo As Integer, CveOrdenCompra As Integer, CveActivoFijo As Integer, Public Function GetHistorialBitacora(CveAcarreo As Integer, CveOrdenCompra As Integer, CveActivoFijo As Integer,
CveOS As Integer, CvePS As Integer, CveCompra As Integer, CveIE As Integer, CveOS As Integer, CvePS As Integer, CveCompra As Integer, CveIE As Integer,
CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional CvePersonal As Integer = -1, CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional CvePersonal As Integer = -1,
Optional IdPoliza As Integer = -1, Optional CvePrePoliza As Integer = -1, Optional CvePeriodo As Integer = -1, Optional CveConceptoNomina As Integer = -1) As Boolean Optional IdPoliza As Integer = -1, Optional CvePrePoliza As Integer = -1, Optional CvePeriodo As Integer = -1, Optional CveConceptoNomina As Integer = -1, Optional CvePromocion As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Gral_HistorialBitacoraGet") DataAdapter("PA_Gral_HistorialBitacoraGet")
@@ -2544,6 +2544,7 @@ Public Class ClsGenerales
.Add("@IdPoliza", SqlDbType.Int).Value = IdPoliza .Add("@IdPoliza", SqlDbType.Int).Value = IdPoliza
.Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo .Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo
.Add("@CveConceptoNomina", SqlDbType.Int).Value = CveConceptoNomina .Add("@CveConceptoNomina", SqlDbType.Int).Value = CveConceptoNomina
.Add("@CvePromocion", SqlDbType.Int).Value = CvePromocion
@@ -2586,7 +2587,7 @@ Public Class ClsGenerales
CveActivoFijo As Integer, CveOS As Integer, CvePS As Integer, CveCompra As Integer, CveActivoFijo As Integer, CveOS As Integer, CvePS As Integer, CveCompra As Integer,
CveIE As Integer, Actual As String, Anterior As String, CveUsuario As Integer, CveIE As Integer, Actual As String, Anterior As String, CveUsuario As Integer,
CveEmpresa As Integer, SeElimino As Integer, Descripcion As String, Tipo As String, CveEmpresa As Integer, SeElimino As Integer, Descripcion As String, Tipo As String,
Id_Clave As String, Optional IdPoliza As Integer = -1) As Boolean Id_Clave As String, Optional IdPoliza As Integer = -1, Optional CvePromocion As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Gral_HistorialBitacoraAdd") DataAdapter("PA_Gral_HistorialBitacoraAdd")
@@ -2608,6 +2609,7 @@ Public Class ClsGenerales
.Add("@Tipo", SqlDbType.VarChar).Value = Tipo .Add("@Tipo", SqlDbType.VarChar).Value = Tipo
.Add("@Id_Clave", SqlDbType.VarChar, 100).Value = Id_Clave .Add("@Id_Clave", SqlDbType.VarChar, 100).Value = Id_Clave
.Add("@IdPoliza", SqlDbType.Int).Value = IdPoliza .Add("@IdPoliza", SqlDbType.Int).Value = IdPoliza
.Add("@CvePromocion", SqlDbType.Int).Value = CvePromocion
End With End With
'SqlTypes.SqlDateTime.Null 'SqlTypes.SqlDateTime.Null

View File

@@ -2877,12 +2877,13 @@ Public Class ClsInventarios
#End Region #End Region
#Region "I N V E N T A R I O - F I S I C O - R E S U L T A D O" #Region "I N V E N T A R I O - F I S I C O - R E S U L T A D O"
Public Function AddInventarioFisicoResultados(CveInventarioFisico As Integer, CveUsuario As Integer) As Boolean Public Function AddInventarioFisicoResultados(CveInventarioFisico As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Inv_InventarioFisicoResultadoAdd") DataAdapter("PA_Inv_InventarioFisicoResultadoAdd")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)
@@ -5488,12 +5489,18 @@ Public Class ClsInventarios
End Try End Try
Return Retorno Return Retorno
End Function End Function
Public Function AddCamiones(Placa As String, Especificacion As String, CveEmpresa As Integer) As Boolean Public Function AddCamiones(Placa As String, Especificacion As String, CveEmpresa As Integer, Optional ConfigCartaPorte As String = "", Optional Anio As Integer = 0, Optional TipoPermisoSCT As String = "", Optional NumPermisoSCT As String = "", Optional NombreAseguradora As String = "", Optional NumPolizaSeguro As String = "") As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Inv_CamionesAdd") DataAdapter("PA_Inv_CamionesAdd")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@Placa", SqlDbType.VarChar).Value = Placa .Add("@Placa", SqlDbType.VarChar).Value = Placa
.Add("@Especificacion", SqlDbType.VarChar).Value = Especificacion .Add("@Especificacion", SqlDbType.VarChar).Value = Especificacion
.Add("@ConfigCartaPorte", SqlDbType.VarChar).Value = ConfigCartaPorte
.Add("@Anio", SqlDbType.Int).Value = Anio
.Add("@TipoPermisoSCT", SqlDbType.VarChar).Value = TipoPermisoSCT
.Add("@NumPermisoSCT", SqlDbType.VarChar).Value = NumPermisoSCT
.Add("@NombreAseguradora", SqlDbType.VarChar).Value = NombreAseguradora
.Add("@NumPolizaSeguro", SqlDbType.VarChar).Value = NumPolizaSeguro
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With End With
Try Try
@@ -5518,13 +5525,19 @@ Public Class ClsInventarios
End Try End Try
Return Retorno Return Retorno
End Function End Function
Public Function UpdateCamiones(CveCamion As Integer, Placa As String, Especificacion As String) As Boolean Public Function UpdateCamiones(CveCamion As Integer, Placa As String, Especificacion As String, Optional ConfigCartaPorte As String = "", Optional Anio As Integer = 0, Optional TipoPermisoSCT As String = "", Optional NumPermisoSCT As String = "", Optional NombreAseguradora As String = "", Optional NumPolizaSeguro As String = "") As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Inv_CamionesUpdate") DataAdapter("PA_Inv_CamionesUpdate")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveCamion", SqlDbType.Int).Value = CveCamion .Add("@CveCamion", SqlDbType.Int).Value = CveCamion
.Add("@Placa", SqlDbType.VarChar).Value = Placa .Add("@Placa", SqlDbType.VarChar).Value = Placa
.Add("@Especificacion", SqlDbType.VarChar).Value = Especificacion .Add("@Especificacion", SqlDbType.VarChar).Value = Especificacion
.Add("@ConfigCartaPorte", SqlDbType.VarChar).Value = ConfigCartaPorte
.Add("@Anio", SqlDbType.Int).Value = Anio
.Add("@TipoPermisoSCT", SqlDbType.VarChar).Value = TipoPermisoSCT
.Add("@NumPermisoSCT", SqlDbType.VarChar).Value = NumPermisoSCT
.Add("@NombreAseguradora", SqlDbType.VarChar).Value = NombreAseguradora
.Add("@NumPolizaSeguro", SqlDbType.VarChar).Value = NumPolizaSeguro
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -1273,7 +1273,7 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function UpdateVentaDetalleRemision(CveVenta As Integer, CvePS As Integer, Cantidad As Decimal, PU As Decimal, IEPS As Decimal, PorcentajeIEPS As Decimal, IVA As Decimal, PorcentajeIVA As Decimal, Observaciones As String, Optional CveUsuarioModifico As Integer = -1) As Boolean Public Function UpdateVentaDetalleRemision(CveVenta As Integer, CvePS As Integer, Cantidad As Decimal, PU As Decimal, IEPS As Decimal, PorcentajeIEPS As Decimal, IVA As Decimal, PorcentajeIVA As Decimal, Descuento As Decimal, Observaciones As String, Optional CveUsuarioModifico As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_VentasDetalleRemisionUpdate") DataAdapter("PA_VentasDetalleRemisionUpdate")
@@ -1286,6 +1286,7 @@ Public Class ClsVentas
.Add("@PorcentajeIEPS", SqlDbType.Decimal).Value = PorcentajeIEPS .Add("@PorcentajeIEPS", SqlDbType.Decimal).Value = PorcentajeIEPS
.Add("@IVA", SqlDbType.Decimal).Value = IVA .Add("@IVA", SqlDbType.Decimal).Value = IVA
.Add("@PorcentajeIVA", SqlDbType.Decimal).Value = PorcentajeIVA .Add("@PorcentajeIVA", SqlDbType.Decimal).Value = PorcentajeIVA
.Add("@Descuento", SqlDbType.Decimal).Value = Descuento
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
End With End With
@@ -2561,13 +2562,13 @@ Public Class ClsVentas
#End Region #End Region
#Region " I M P U E S T O S L O C A L E S" #Region " I M P U E S T O S L O C A L E S"
Public Function AddImpuestosLocales(ImpuestoLocal As String, Porcentaje As Double, Orden As Integer, TipoImpuesto As Integer, Estatus As Integer, IdCtaContable As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Public Function AddImpuestosLocales(ImpuestoLocal As String, Porcentaje As Decimal, Orden As Integer, TipoImpuesto As Integer, Estatus As Integer, IdCtaContable As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ImpuestosLocalesAdd") DataAdapter("PA_Vta_ImpuestosLocalesAdd")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@ImpuestoLocal", SqlDbType.VarChar).Value = ImpuestoLocal .Add("@ImpuestoLocal", SqlDbType.VarChar).Value = ImpuestoLocal
.Add("@Porcentaje", SqlDbType.SmallMoney).Value = Porcentaje .Add("@Porcentaje", SqlDbType.Decimal).Value = Porcentaje
.Add("@Orden", SqlDbType.Int).Value = Orden .Add("@Orden", SqlDbType.Int).Value = Orden
.Add("@TipoImpuesto", SqlDbType.Int).Value = TipoImpuesto .Add("@TipoImpuesto", SqlDbType.Int).Value = TipoImpuesto
.Add("@Estatus", SqlDbType.Bit).Value = Estatus .Add("@Estatus", SqlDbType.Bit).Value = Estatus
@@ -2603,14 +2604,14 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function UpdateImpuestosLocales(CveImpuestoLocal As Integer, ImpuestoLocal As String, Porcentaje As Double, Orden As Integer, TipoImpuesto As Integer, Estatus As Integer, IdCtaContable As Integer) As Boolean Public Function UpdateImpuestosLocales(CveImpuestoLocal As Integer, ImpuestoLocal As String, Porcentaje As Decimal, Orden As Integer, TipoImpuesto As Integer, Estatus As Integer, IdCtaContable As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ImpuestosLocalesUpdate") DataAdapter("PA_Vta_ImpuestosLocalesUpdate")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveImpuestoLocal", SqlDbType.Int).Value = CveImpuestoLocal .Add("@CveImpuestoLocal", SqlDbType.Int).Value = CveImpuestoLocal
.Add("@ImpuestoLocal", SqlDbType.VarChar).Value = ImpuestoLocal .Add("@ImpuestoLocal", SqlDbType.VarChar).Value = ImpuestoLocal
.Add("@Porcentaje", SqlDbType.SmallMoney).Value = Porcentaje .Add("@Porcentaje", SqlDbType.Decimal).Value = Porcentaje
.Add("@TipoImpuesto", SqlDbType.Int).Value = TipoImpuesto .Add("@TipoImpuesto", SqlDbType.Int).Value = TipoImpuesto
.Add("@Orden", SqlDbType.Int).Value = Orden .Add("@Orden", SqlDbType.Int).Value = Orden
.Add("@Estatus", SqlDbType.Bit).Value = Estatus .Add("@Estatus", SqlDbType.Bit).Value = Estatus

View File

@@ -4615,10 +4615,6 @@ Namespace Modelos
'1 NORMAL, 2 CON PAGOS '1 NORMAL, 2 CON PAGOS
Dim ModalidadRefacturacion As Integer = UsuarioActual.Empresa.Funcionalidad(586).ToEntero() Dim ModalidadRefacturacion As Integer = UsuarioActual.Empresa.Funcionalidad(586).ToEntero()
If UsuarioActual.CveUsuario = 1719 Then
ModalidadRefacturacion = 2
End If
If EsRefacturacion AndAlso ModalidadRefacturacion <= 0 Then If EsRefacturacion AndAlso ModalidadRefacturacion <= 0 Then
Retorno.Mensaje = "La factura no se puede refacturar debido a que la empresa no tiene asignada una modalidad de refacturación." Retorno.Mensaje = "La factura no se puede refacturar debido a que la empresa no tiene asignada una modalidad de refacturación."
Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia
@@ -9902,6 +9898,7 @@ Namespace Modelos
Public Property EsDistribuidor As Boolean Public Property EsDistribuidor As Boolean
Public Property CorreoCotizacion As String Public Property CorreoCotizacion As String
Public Property ImprimeNombreSucursal As Integer Public Property ImprimeNombreSucursal As Integer
Public Property CobranzaCorreo As String
End Class End Class
<Serializable> <Serializable>

View File

@@ -1723,7 +1723,7 @@ Public Class Timbrado
If Ventas.CveVenta > 0 Then If Ventas.CveVenta > 0 Then
Dim ObjVentas As New ClsVentas() Dim ObjVentas As New ClsVentas()
If ObjVentas.UpdateEstatusFactura(3, FolioFiscal, "", ObjCFDITimbre.Comprobante.Fecha, Ventas.CveVenta, CvePAC:=UsuarioActual.Empresa.CvePAC) Then If ObjVentas.UpdateEstatusFactura(3, FolioFiscal, "", ObjCFDITimbre.Comprobante.Fecha, Ventas.CveVenta, CvePAC:=UsuarioActual.Empresa.CvePAC, RFCReceptor:=ObjCFDITimbre.Receptor.RFC) Then
Retorno = "" Retorno = ""
Else Else
Retorno = "Error" Retorno = "Error"
@@ -2125,6 +2125,77 @@ Public Class Timbrado
End If End If
#Region "C O M P L E M E N T O C A R T A P O R T E"
If ObjCFDITimbre.Complementos.CartaPorte IsNot Nothing Then
If ObjCFDITimbre.Complementos.CartaPorte IsNot Nothing Then
Dim Carta As CFDICartaPorte = ObjCFDITimbre.Complementos.CartaPorte
''DATOS GENERALES
cfdi.CartaPorte(Carta.TranspInternac, Carta.EntradaSalidaMercancia, Carta.ViaEntradaSalida, Carta.TotalDistanciaRecorrida)
'UBICACIONES
If Carta.Ubicaciones IsNot Nothing AndAlso Carta.Ubicaciones.Count > 0 Then
For Each ubica As CFDICartaPorteUbicaciones In Carta.Ubicaciones
'origen
cfdi.CartaPorteUbicacion(ubica.TipoEstacion, ubica.DistanciaRecorrida)
cfdi.CartaPorteOrigen(ubica.Origen.IDOrigen, ubica.Origen.RFCRemitente, ubica.Origen.NombreRemitente, ubica.Origen.NumRegIdTrib, ubica.Origen.ResidenciaFiscal, ubica.Origen.NumEstacion, ubica.Origen.NombreEstacion, ubica.Origen.NavegacionTrafico, ubica.Origen.FechaHoraSalida)
cfdi.CartaPorteDomicilio(ubica.Origen.Domicilio.Calle, ubica.Origen.Domicilio.NumeroExterior, ubica.Origen.Domicilio.NumeroInterior, ubica.Origen.Domicilio.Colonia, ubica.Origen.Domicilio.Localidad, ubica.Origen.Domicilio.Referencia, ubica.Origen.Domicilio.Municipio, ubica.Origen.Domicilio.Estado, ubica.Origen.Domicilio.Pais, ubica.Origen.Domicilio.CP)
'destino
cfdi.CartaPorteUbicacion(ubica.TipoEstacion, ubica.DistanciaRecorrida)
cfdi.CartaPorteDestino(ubica.Destino.IDDestino, ubica.Destino.RFCDestinatario, ubica.Destino.NombreDestinatario, ubica.Destino.NumRegIdTrib, ubica.Destino.ResidenciaFiscal, ubica.Destino.NumEstacion, ubica.Destino.NombreEstacion, ubica.Destino.NavegacionTrafico, ubica.Destino.FechaHoraProgLlegada)
cfdi.CartaPorteDomicilio(ubica.Destino.Domicilio.Calle, ubica.Destino.Domicilio.NumeroExterior, ubica.Destino.Domicilio.NumeroInterior, ubica.Destino.Domicilio.Colonia, ubica.Destino.Domicilio.Localidad, ubica.Destino.Domicilio.Referencia, ubica.Destino.Domicilio.Municipio, ubica.Destino.Domicilio.Estado, ubica.Destino.Domicilio.Pais, ubica.Destino.Domicilio.CP)
Next
End If
'MERCANCIAS
If Carta.Mercancias IsNot Nothing Then
cfdi.CartaPorteMercancias(Carta.Mercancias.PesoBrutoTotal, Carta.Mercancias.UnidadPeso, Carta.Mercancias.PesoNetoTotal, Carta.Mercancias.NumTotalMercancias, Carta.Mercancias.CargoporTasacion)
If Carta.Mercancias IsNot Nothing AndAlso Carta.Mercancias.Mercancias.Count > 0 Then
For Each concep As CFDICartaPorteMercancia In Carta.Mercancias.Mercancias
cfdi.CartaPorteMercancia(concep.BienesTransp, concep.ClaveSTCC, concep.Descripción, concep.Cantidad, concep.ClaveUnidad, concep.Unidad, concep.Dimensiones, concep.MaterialPeligroso, concep.ClaveMaterialPeligroso, concep.Embalaje, concep.DescripEmbalaje, concep.PesoenKg, concep.ValorMercancia, concep.Moneda, concep.FraccionArrancelaria, concep.UUIDComercioExt)
Next
End If
End If
'
If Carta.FiguraTransporte IsNot Nothing Then
If Carta.FiguraTransporte.AutoTransporteFederal IsNot Nothing Then
cfdi.CartaPorteAutotransporteFederal(Carta.FiguraTransporte.AutoTransporteFederal.PermSCT, Carta.FiguraTransporte.AutoTransporteFederal.NumPermisoSCT, Carta.FiguraTransporte.AutoTransporteFederal.NombreAseg, Carta.FiguraTransporte.AutoTransporteFederal.NumPolizaSeguro)
cfdi.CartaPorteIdentificacionVehicular(Carta.FiguraTransporte.AutoTransporteFederal.Vehiculo.ConfigVehicular, Carta.FiguraTransporte.AutoTransporteFederal.Vehiculo.PlacaVM, Carta.FiguraTransporte.AutoTransporteFederal.Vehiculo.AnioModeloVM)
If Carta.FiguraTransporte.AutoTransporteFederal.Remolques IsNot Nothing AndAlso Carta.FiguraTransporte.AutoTransporteFederal.Remolques.Count > 0 Then
For Each concep As CFDICartaPorteRemolque In Carta.FiguraTransporte.AutoTransporteFederal.Remolques
cfdi.CartaPorteRemolque(concep.SubTipoRemolque, concep.Placa)
Next
End If
End If
cfdi.CartaPorteFiguraTransporte(Carta.FiguraTransporte.ClaveTransporte)
If Carta.FiguraTransporte.Operadores IsNot Nothing AndAlso Carta.FiguraTransporte.Operadores.Count > 0 Then
For Each concep As CFDICartaPorteOperador In Carta.FiguraTransporte.Operadores
cfdi.CartaPorteOperador(concep.RFCOperador, concep.NumLicencia, concep.NombreOperador, concep.NumRegidTribOperador, concep.ResidenciaFiscalOperador)
Next
End If
End If
End If
End If
#End Region
#Region "Complemento Pago" #Region "Complemento Pago"
If ObjCFDITimbre.Comprobante.TipoComprobante = "P" Then If ObjCFDITimbre.Comprobante.TipoComprobante = "P" Then
@@ -2344,7 +2415,7 @@ Public Class Timbrado
Using ObjVentas As New ClsVentas() Using ObjVentas As New ClsVentas()
If ObjVentas.UpdateEstatusFactura(3, FolioFiscal, "", ObjCFDITimbre.Comprobante.Fecha, Ventas.CveVenta, CvePAC:=CvePACEspecial) Then If ObjVentas.UpdateEstatusFactura(3, FolioFiscal, "", ObjCFDITimbre.Comprobante.Fecha, Ventas.CveVenta, CvePAC:=CvePACEspecial, RFCReceptor:=ObjCFDITimbre.Receptor.RFC) Then
Retorno = "" Retorno = ""
Else Else
Retorno = "Error" Retorno = "Error"
@@ -3132,6 +3203,7 @@ Public Class Timbrado
Dim NombreArchivoXML As String = $"{ObjCFDITimbre.Comprobante.SerieFolio}" Dim NombreArchivoXML As String = $"{ObjCFDITimbre.Comprobante.SerieFolio}"
Dim SubTotal As Decimal = 0 Dim SubTotal As Decimal = 0
Dim AmbienteProductivo As Boolean = True Dim AmbienteProductivo As Boolean = True
Dim NumDecimalesImporte As Integer = 2
If Not Directory.Exists(RutaArchivo) Then Directory.CreateDirectory(RutaArchivo) If Not Directory.Exists(RutaArchivo) Then Directory.CreateDirectory(RutaArchivo)
If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1 Then If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1 Then
@@ -3220,19 +3292,19 @@ Public Class Timbrado
comprobante.Version = "3.3" comprobante.Version = "3.3"
comprobante.Fecha = ObjCFDITimbre.Comprobante.Fecha comprobante.Fecha = ObjCFDITimbre.Comprobante.Fecha
comprobante.FormaPago = ObjCFDITimbre.Comprobante.FormadePago comprobante.FormaPago = ObjCFDITimbre.Comprobante.FormadePago
If ObjCFDITimbre.Comprobante.TipoComprobante <> "P" Then comprobante.CondicionesDePago = ObjCFDITimbre.Comprobante.CondicionesdePago If ObjCFDITimbre.Comprobante.TipoComprobante.Contiene("I", "E", "N") Then comprobante.CondicionesDePago = ObjCFDITimbre.Comprobante.CondicionesdePago
comprobante.SubTotal = ObjCFDITimbre.Comprobante.Subtotal comprobante.SubTotal = ObjCFDITimbre.Comprobante.Subtotal.RoundSQL(NumDecimalesImporte)
If ObjCFDITimbre.Comprobante.TipoComprobante <> "P" Then If ObjCFDITimbre.Comprobante.TipoComprobante.Contiene("I", "E", "N") Then
If ObjCFDITimbre.Comprobante.Descuentos > 0 Then If ObjCFDITimbre.Comprobante.Descuentos > 0 Then
comprobante.DescuentoSpecified = True comprobante.DescuentoSpecified = True
comprobante.Descuento = ObjCFDITimbre.Comprobante.Descuentos comprobante.Descuento = ObjCFDITimbre.Comprobante.Descuentos.RoundSQL(NumDecimalesImporte)
End If End If
End If End If
comprobante.Moneda = ObjCFDITimbre.Comprobante.Moneda comprobante.Moneda = ObjCFDITimbre.Comprobante.Moneda
comprobante.TipoCambio = ObjCFDITimbre.Comprobante.TipoCambio.ToDecimal comprobante.TipoCambio = ObjCFDITimbre.Comprobante.TipoCambio.ToDecimal
comprobante.TipoCambioSpecified = If(ObjCFDITimbre.Comprobante.Moneda <> "XXX", True, False) comprobante.TipoCambioSpecified = If(ObjCFDITimbre.Comprobante.Moneda <> "XXX", True, False)
comprobante.Total = ObjCFDITimbre.Comprobante.Total comprobante.Total = ObjCFDITimbre.Comprobante.Total.RoundSQL(NumDecimalesImporte)
comprobante.TipoDeComprobante = ObjCFDITimbre.Comprobante.TipoComprobante comprobante.TipoDeComprobante = ObjCFDITimbre.Comprobante.TipoComprobante
comprobante.FormaPagoSpecified = If(ObjCFDITimbre.Comprobante.FormadePago <> "", True, False) comprobante.FormaPagoSpecified = If(ObjCFDITimbre.Comprobante.FormadePago <> "", True, False)
comprobante.MetodoPago = ObjCFDITimbre.Comprobante.MetodoPago comprobante.MetodoPago = ObjCFDITimbre.Comprobante.MetodoPago
@@ -3274,7 +3346,7 @@ Public Class Timbrado
comprobante.Conceptos(i).ClaveUnidad = concep.ClaveUnidad comprobante.Conceptos(i).ClaveUnidad = concep.ClaveUnidad
comprobante.Conceptos(i).Descripcion = concep.Descripcion comprobante.Conceptos(i).Descripcion = concep.Descripcion
comprobante.Conceptos(i).ValorUnitario = concep.ValorUnitario comprobante.Conceptos(i).ValorUnitario = concep.ValorUnitario
comprobante.Conceptos(i).Importe = concep.Importe comprobante.Conceptos(i).Importe = concep.Importe.RoundSQL(NumDecimalesImporte)
comprobante.Conceptos(i).ClaveProdServ = concep.ClaveProdServ comprobante.Conceptos(i).ClaveProdServ = concep.ClaveProdServ
If ObjCFDITimbre.Comprobante.TipoComprobante <> "P" Then If ObjCFDITimbre.Comprobante.TipoComprobante <> "P" Then
@@ -3310,7 +3382,7 @@ Public Class Timbrado
comprobante.Conceptos(i).Impuestos.Traslados(j).Base = imp.Base comprobante.Conceptos(i).Impuestos.Traslados(j).Base = imp.Base
comprobante.Conceptos(i).Impuestos.Traslados(j).Impuesto = imp.Impuesto comprobante.Conceptos(i).Impuestos.Traslados(j).Impuesto = imp.Impuesto
comprobante.Conceptos(i).Impuestos.Traslados(j).TipoFactor = imp.TipoFactor comprobante.Conceptos(i).Impuestos.Traslados(j).TipoFactor = imp.TipoFactor
comprobante.Conceptos(i).Impuestos.Traslados(j).Importe = imp.Importe comprobante.Conceptos(i).Impuestos.Traslados(j).Importe = imp.Importe.RoundSQL(NumDecimalesImporte)
comprobante.Conceptos(i).Impuestos.Traslados(j).ImporteSpecified = True comprobante.Conceptos(i).Impuestos.Traslados(j).ImporteSpecified = True
comprobante.Conceptos(i).Impuestos.Traslados(j).TasaOCuota = imp.TasaOCuota.FormatoNumero(6) comprobante.Conceptos(i).Impuestos.Traslados(j).TasaOCuota = imp.TasaOCuota.FormatoNumero(6)
comprobante.Conceptos(i).Impuestos.Traslados(j).TasaOCuotaSpecified = True comprobante.Conceptos(i).Impuestos.Traslados(j).TasaOCuotaSpecified = True
@@ -3320,7 +3392,7 @@ Public Class Timbrado
comprobante.Conceptos(i).Impuestos.Retenciones(k).Base = imp.Base comprobante.Conceptos(i).Impuestos.Retenciones(k).Base = imp.Base
comprobante.Conceptos(i).Impuestos.Retenciones(k).Impuesto = imp.Impuesto comprobante.Conceptos(i).Impuestos.Retenciones(k).Impuesto = imp.Impuesto
comprobante.Conceptos(i).Impuestos.Retenciones(k).TipoFactor = imp.TipoFactor comprobante.Conceptos(i).Impuestos.Retenciones(k).TipoFactor = imp.TipoFactor
comprobante.Conceptos(i).Impuestos.Retenciones(k).Importe = imp.Importe comprobante.Conceptos(i).Impuestos.Retenciones(k).Importe = imp.Importe.RoundSQL(NumDecimalesImporte)
comprobante.Conceptos(i).Impuestos.Retenciones(k).TasaOCuota = imp.TasaOCuota.ToString.ToDecimal comprobante.Conceptos(i).Impuestos.Retenciones(k).TasaOCuota = imp.TasaOCuota.ToString.ToDecimal
k += 1 k += 1
End If End If
@@ -3597,7 +3669,7 @@ Public Class Timbrado
ComPag.Pago(0).FechaPago = ObjCFDITimbre.ComplementoPagos.FechaPago.ToString("yyyy-MM-ddTHH:mm:ss").ToDate() ComPag.Pago(0).FechaPago = ObjCFDITimbre.ComplementoPagos.FechaPago.ToString("yyyy-MM-ddTHH:mm:ss").ToDate()
ComPag.Pago(0).FormaDePagoP = ObjCFDITimbre.ComplementoPagos.FormaDePagoP ComPag.Pago(0).FormaDePagoP = ObjCFDITimbre.ComplementoPagos.FormaDePagoP
ComPag.Pago(0).MonedaP = ObjCFDITimbre.ComplementoPagos.MonedaP ComPag.Pago(0).MonedaP = ObjCFDITimbre.ComplementoPagos.MonedaP
ComPag.Pago(0).TipoCadPagoSpecified = If(ObjCFDITimbre.ComplementoPagos.MonedaP = "MXN", False, True) ComPag.Pago(0).TipoCambioPSpecified = If(ObjCFDITimbre.ComplementoPagos.MonedaP = "MXN", False, True)
ComPag.Pago(0).TipoCambioP = ObjCFDITimbre.ComplementoPagos.TipoCambioP.ToDecimal ComPag.Pago(0).TipoCambioP = ObjCFDITimbre.ComplementoPagos.TipoCambioP.ToDecimal
ComPag.Pago(0).Monto = ObjCFDITimbre.ComplementoPagos.Monto.ToDecimal ComPag.Pago(0).Monto = ObjCFDITimbre.ComplementoPagos.Monto.ToDecimal
If ObjCFDITimbre.ComplementoPagos.NumOperacion <> "" Then If ObjCFDITimbre.ComplementoPagos.NumOperacion <> "" Then
@@ -3618,7 +3690,11 @@ Public Class Timbrado
If ObjCFDITimbre.ComplementoPagos.CtaBeneficiario <> "" Then If ObjCFDITimbre.ComplementoPagos.CtaBeneficiario <> "" Then
ComPag.Pago(0).CtaBeneficiario = ObjCFDITimbre.ComplementoPagos.CtaBeneficiario ComPag.Pago(0).CtaBeneficiario = ObjCFDITimbre.ComplementoPagos.CtaBeneficiario
End If End If
ComPag.Pago(0).TipoCadPago = ObjCFDITimbre.ComplementoPagos.TipoCadPago If ObjCFDITimbre.ComplementoPagos.TipoCadPago <> "" Then
ComPag.Pago(0).TipoCadPagoSpecified = True
ComPag.Pago(0).TipoCadPago = ObjCFDITimbre.ComplementoPagos.TipoCadPago
End If
If ObjCFDITimbre.ComplementoPagos.CertPago <> "" Then If ObjCFDITimbre.ComplementoPagos.CertPago <> "" Then
ComPag.Pago(0).CertPago = System.Text.Encoding.Default.GetBytes(ObjCFDITimbre.ComplementoPagos.CertPago).ToString ComPag.Pago(0).CertPago = System.Text.Encoding.Default.GetBytes(ObjCFDITimbre.ComplementoPagos.CertPago).ToString
End If End If
@@ -3868,191 +3944,191 @@ Public Class Timbrado
#End Region #End Region
#Region "Detallista" '#Region "Detallista"
If Ventas.Cliente.AplicaDetallista Then ' If Ventas.Cliente.AplicaDetallista Then
Dim detallista As Profact.TimbraCFDI33.Complementos.Detallista.detallista = New Profact.TimbraCFDI33.Complementos.Detallista.detallista ' Dim detallista As Profact.TimbraCFDI33.Complementos.Detallista.detallista = New Profact.TimbraCFDI33.Complementos.Detallista.detallista
detallista.type = "SimpleInvoiceType" ' detallista.type = "SimpleInvoiceType"
detallista.contentVersion = "1.3.1" ' detallista.contentVersion = "1.3.1"
detallista.documentStructureVersion = "AMC8.1" ' detallista.documentStructureVersion = "AMC8.1"
detallista.documentStatus = Profact.TimbraCFDI33.Complementos.Detallista.detallistaDocumentStatus.ORIGINAL ' detallista.documentStatus = Profact.TimbraCFDI33.Complementos.Detallista.detallistaDocumentStatus.ORIGINAL
detallista.DeliveryNote = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaDeliveryNote ' detallista.DeliveryNote = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaDeliveryNote
detallista.DeliveryNote.referenceIdentification = New String((1)) {} ' detallista.DeliveryNote.referenceIdentification = New String((1)) {}
detallista.DeliveryNote.referenceIdentification(0) = "1" ' detallista.DeliveryNote.referenceIdentification(0) = "1"
detallista.DeliveryNote.ReferenceDate = New DateTime ' detallista.DeliveryNote.ReferenceDate = New DateTime
detallista.DeliveryNote.ReferenceDate = comprobante.Fecha ' detallista.DeliveryNote.ReferenceDate = comprobante.Fecha
detallista.DeliveryNote.ReferenceDateSpecified = True ' detallista.DeliveryNote.ReferenceDateSpecified = True
detallista.requestForPaymentIdentification = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaRequestForPaymentIdentification ' detallista.requestForPaymentIdentification = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaRequestForPaymentIdentification
detallista.requestForPaymentIdentification.entityType = Profact.TimbraCFDI33.Complementos.Detallista.detallistaRequestForPaymentIdentificationEntityType.INVOICE ' detallista.requestForPaymentIdentification.entityType = Profact.TimbraCFDI33.Complementos.Detallista.detallistaRequestForPaymentIdentificationEntityType.INVOICE
detallista.specialInstruction = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaSpecialInstruction((1)) {} ' detallista.specialInstruction = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaSpecialInstruction((1)) {}
detallista.specialInstruction(0) = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaSpecialInstruction ' detallista.specialInstruction(0) = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaSpecialInstruction
detallista.specialInstruction(0).code = Profact.TimbraCFDI33.Complementos.Detallista.detallistaSpecialInstructionCode.ZZZ ' detallista.specialInstruction(0).code = Profact.TimbraCFDI33.Complementos.Detallista.detallistaSpecialInstructionCode.ZZZ
Dim TotalTexto = New String() {Ventas.TotalTC.ToString.ToDouble.Texto2Letras.ToUpper()} ' Dim TotalTexto = New String() {Ventas.TotalTC.ToString.ToDouble.Texto2Letras.ToUpper()}
Dim propertyInfo = detallista.specialInstruction(0).GetType().GetProperty("text") ' Dim propertyInfo = detallista.specialInstruction(0).GetType().GetProperty("text")
propertyInfo.SetValue(detallista.specialInstruction(0), Convert.ChangeType(TotalTexto, propertyInfo.PropertyType), Nothing) ' propertyInfo.SetValue(detallista.specialInstruction(0), Convert.ChangeType(TotalTexto, propertyInfo.PropertyType), Nothing)
detallista.orderIdentification = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaOrderIdentification ' detallista.orderIdentification = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaOrderIdentification
detallista.orderIdentification.referenceIdentification = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaOrderIdentificationReferenceIdentification((1)) {} ' detallista.orderIdentification.referenceIdentification = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaOrderIdentificationReferenceIdentification((1)) {}
detallista.orderIdentification.referenceIdentification(0) = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaOrderIdentificationReferenceIdentification ' detallista.orderIdentification.referenceIdentification(0) = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaOrderIdentificationReferenceIdentification
detallista.orderIdentification.referenceIdentification(0).type = Profact.TimbraCFDI33.Complementos.Detallista.detallistaOrderIdentificationReferenceIdentificationType.ON ' detallista.orderIdentification.referenceIdentification(0).type = Profact.TimbraCFDI33.Complementos.Detallista.detallistaOrderIdentificationReferenceIdentificationType.ON
detallista.orderIdentification.referenceIdentification(0).Value = Ventas.Det_OrdenCompra ' detallista.orderIdentification.referenceIdentification(0).Value = Ventas.Det_OrdenCompra
detallista.orderIdentification.ReferenceDateSpecified = True ' detallista.orderIdentification.ReferenceDateSpecified = True
detallista.orderIdentification.ReferenceDate = Ventas.Det_FechaOrdenCompra.ToDate() ' detallista.orderIdentification.ReferenceDate = Ventas.Det_FechaOrdenCompra.ToDate()
detallista.AdditionalInformation = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaReferenceIdentification((1)) {} ' detallista.AdditionalInformation = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaReferenceIdentification((1)) {}
detallista.AdditionalInformation(0) = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaReferenceIdentification ' detallista.AdditionalInformation(0) = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaReferenceIdentification
detallista.AdditionalInformation(0).type = Profact.TimbraCFDI33.Complementos.Detallista.detallistaReferenceIdentificationType.ATZ ' detallista.AdditionalInformation(0).type = Profact.TimbraCFDI33.Complementos.Detallista.detallistaReferenceIdentificationType.ATZ
detallista.AdditionalInformation(0).Value = Ventas.Det_ContraRecibo ' detallista.AdditionalInformation(0).Value = Ventas.Det_ContraRecibo
detallista.DeliveryNote = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaDeliveryNote ' detallista.DeliveryNote = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaDeliveryNote
detallista.DeliveryNote.ReferenceDate = Ventas.Det_FechaOrdenCompra.ToDate ' detallista.DeliveryNote.ReferenceDate = Ventas.Det_FechaOrdenCompra.ToDate
detallista.DeliveryNote.referenceIdentification = New String((1)) {} ' detallista.DeliveryNote.referenceIdentification = New String((1)) {}
detallista.DeliveryNote.referenceIdentification(0) = Ventas.Det_ContraRecibo ' detallista.DeliveryNote.referenceIdentification(0) = Ventas.Det_ContraRecibo
detallista.buyer = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaBuyer ' detallista.buyer = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaBuyer
detallista.buyer.gln = Ventas.Cliente.Detallista_GLNComprador ' detallista.buyer.gln = Ventas.Cliente.Detallista_GLNComprador
detallista.buyer.contactInformation = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaBuyerContactInformation ' detallista.buyer.contactInformation = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaBuyerContactInformation
detallista.buyer.contactInformation.personOrDepartmentName = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaBuyerContactInformationPersonOrDepartmentName ' detallista.buyer.contactInformation.personOrDepartmentName = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaBuyerContactInformationPersonOrDepartmentName
detallista.buyer.contactInformation.personOrDepartmentName.text = Ventas.Cliente.Detallista_Departamento ' detallista.buyer.contactInformation.personOrDepartmentName.text = Ventas.Cliente.Detallista_Departamento
detallista.seller = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaSeller ' detallista.seller = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaSeller
detallista.seller.gln = Ventas.Cliente.Detallista_GLNVendedor ' detallista.seller.gln = Ventas.Cliente.Detallista_GLNVendedor
detallista.seller.alternatePartyIdentification = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaSellerAlternatePartyIdentification ' detallista.seller.alternatePartyIdentification = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaSellerAlternatePartyIdentification
detallista.seller.alternatePartyIdentification.type = Profact.TimbraCFDI33.Complementos.Detallista.detallistaSellerAlternatePartyIdentificationType.SELLER_ASSIGNED_IDENTIFIER_FOR_A_PARTY ' detallista.seller.alternatePartyIdentification.type = Profact.TimbraCFDI33.Complementos.Detallista.detallistaSellerAlternatePartyIdentificationType.SELLER_ASSIGNED_IDENTIFIER_FOR_A_PARTY
detallista.seller.alternatePartyIdentification.Value = Ventas.Cliente.Detallista_NumProveedor ' detallista.seller.alternatePartyIdentification.Value = Ventas.Cliente.Detallista_NumProveedor
'detallista.shipTo = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaShipTo ' 'detallista.shipTo = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaShipTo
'detallista.shipTo.gln = "0000000000000" ' 'detallista.shipTo.gln = "0000000000000"
'detallista.shipTo.nameAndAddress = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaShipToNameAndAddress ' 'detallista.shipTo.nameAndAddress = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaShipToNameAndAddress
'detallista.shipTo.nameAndAddress.name = New String((1)) {} ' 'detallista.shipTo.nameAndAddress.name = New String((1)) {}
'detallista.shipTo.nameAndAddress.name(0) = Ventas.Cliente.Direccion ' 'detallista.shipTo.nameAndAddress.name(0) = Ventas.Cliente.Direccion
'detallista.shipTo.nameAndAddress.streetAddressOne = New String((1)) {} ' 'detallista.shipTo.nameAndAddress.streetAddressOne = New String((1)) {}
'detallista.shipTo.nameAndAddress.streetAddressOne(0) = Ventas.Cliente.NoInt ' 'detallista.shipTo.nameAndAddress.streetAddressOne(0) = Ventas.Cliente.NoInt
'detallista.shipTo.nameAndAddress.city = New String((1)) {} ' 'detallista.shipTo.nameAndAddress.city = New String((1)) {}
'detallista.shipTo.nameAndAddress.city(0) = Ventas.Cliente.Ciudad ' 'detallista.shipTo.nameAndAddress.city(0) = Ventas.Cliente.Ciudad
'detallista.shipTo.nameAndAddress.postalCode = New String((1)) {} ' 'detallista.shipTo.nameAndAddress.postalCode = New String((1)) {}
'detallista.shipTo.nameAndAddress.postalCode(0) = Ventas.Cliente.CP ' 'detallista.shipTo.nameAndAddress.postalCode(0) = Ventas.Cliente.CP
detallista.paymentTerms = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaPaymentTerms ' detallista.paymentTerms = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaPaymentTerms
detallista.paymentTerms.netPayment = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaPaymentTermsNetPayment ' detallista.paymentTerms.netPayment = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaPaymentTermsNetPayment
detallista.paymentTerms.netPayment.paymentTimePeriod = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaPaymentTermsNetPaymentPaymentTimePeriod ' detallista.paymentTerms.netPayment.paymentTimePeriod = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaPaymentTermsNetPaymentPaymentTimePeriod
detallista.paymentTerms.netPayment.paymentTimePeriod.timePeriodDue = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaPaymentTermsNetPaymentPaymentTimePeriodTimePeriodDue ' detallista.paymentTerms.netPayment.paymentTimePeriod.timePeriodDue = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaPaymentTermsNetPaymentPaymentTimePeriodTimePeriodDue
detallista.paymentTerms.netPayment.paymentTimePeriod.timePeriodDue.timePeriod = Profact.TimbraCFDI33.Complementos.Detallista.detallistaPaymentTermsNetPaymentPaymentTimePeriodTimePeriodDueTimePeriod.DAYS ' detallista.paymentTerms.netPayment.paymentTimePeriod.timePeriodDue.timePeriod = Profact.TimbraCFDI33.Complementos.Detallista.detallistaPaymentTermsNetPaymentPaymentTimePeriodTimePeriodDueTimePeriod.DAYS
detallista.paymentTerms.netPayment.paymentTimePeriod.timePeriodDue.value = "0" ' detallista.paymentTerms.netPayment.paymentTimePeriod.timePeriodDue.value = "0"
detallista.paymentTerms.discountPayment = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaPaymentTermsDiscountPayment ' detallista.paymentTerms.discountPayment = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaPaymentTermsDiscountPayment
detallista.paymentTerms.discountPayment.percentage = If(Ventas.DescuentoTC > 0 AndAlso Ventas.SubTotalTC > 0, (Ventas.DescuentoTC * 100) / Ventas.SubTotalTC, 0).ToString().FormatoNumero() ' detallista.paymentTerms.discountPayment.percentage = If(Ventas.DescuentoTC > 0 AndAlso Ventas.SubTotalTC > 0, (Ventas.DescuentoTC * 100) / Ventas.SubTotalTC, 0).ToString().FormatoNumero()
detallista.currency = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaCurrency((1)) {} ' detallista.currency = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaCurrency((1)) {}
detallista.currency(0) = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaCurrency ' detallista.currency(0) = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaCurrency
detallista.currency(0).currencyISOCode = If(Ventas.CveMoneda = 1, Profact.TimbraCFDI33.Complementos.Detallista.detallistaCurrencyCurrencyISOCode.MXN, Profact.TimbraCFDI33.Complementos.Detallista.detallistaCurrencyCurrencyISOCode.USD) ' detallista.currency(0).currencyISOCode = If(Ventas.CveMoneda = 1, Profact.TimbraCFDI33.Complementos.Detallista.detallistaCurrencyCurrencyISOCode.MXN, Profact.TimbraCFDI33.Complementos.Detallista.detallistaCurrencyCurrencyISOCode.USD)
detallista.currency(0).currencyFunction = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaCurrencyCurrencyFunction((1)) {} ' detallista.currency(0).currencyFunction = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaCurrencyCurrencyFunction((1)) {}
detallista.currency(0).currencyFunction(0) = Profact.TimbraCFDI33.Complementos.Detallista.detallistaCurrencyCurrencyFunction.BILLING_CURRENCY ' detallista.currency(0).currencyFunction(0) = Profact.TimbraCFDI33.Complementos.Detallista.detallistaCurrencyCurrencyFunction.BILLING_CURRENCY
detallista.currency(0).rateOfChangeSpecified = True ' detallista.currency(0).rateOfChangeSpecified = True
detallista.currency(0).rateOfChange = 1 ' detallista.currency(0).rateOfChange = 1
detallista.allowanceCharge = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaAllowanceCharge(1) {} ' detallista.allowanceCharge = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaAllowanceCharge(1) {}
detallista.allowanceCharge(0) = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaAllowanceCharge ' detallista.allowanceCharge(0) = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaAllowanceCharge
detallista.allowanceCharge(0).monetaryAmountOrPercentage = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaAllowanceChargeMonetaryAmountOrPercentage ' detallista.allowanceCharge(0).monetaryAmountOrPercentage = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaAllowanceChargeMonetaryAmountOrPercentage
detallista.allowanceCharge(0).monetaryAmountOrPercentage.rate = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaAllowanceChargeMonetaryAmountOrPercentageRate ' detallista.allowanceCharge(0).monetaryAmountOrPercentage.rate = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaAllowanceChargeMonetaryAmountOrPercentageRate
detallista.allowanceCharge(0).monetaryAmountOrPercentage.rate.base = Profact.TimbraCFDI33.Complementos.Detallista.detallistaAllowanceChargeMonetaryAmountOrPercentageRateBase.INVOICE_VALUE ' detallista.allowanceCharge(0).monetaryAmountOrPercentage.rate.base = Profact.TimbraCFDI33.Complementos.Detallista.detallistaAllowanceChargeMonetaryAmountOrPercentageRateBase.INVOICE_VALUE
detallista.allowanceCharge(0).monetaryAmountOrPercentage.rate.percentage = If(Ventas.DescuentoTC > 0 AndAlso Ventas.SubTotalTC > 0, (Ventas.DescuentoTC * 100) / Ventas.SubTotalTC, 0) ' detallista.allowanceCharge(0).monetaryAmountOrPercentage.rate.percentage = If(Ventas.DescuentoTC > 0 AndAlso Ventas.SubTotalTC > 0, (Ventas.DescuentoTC * 100) / Ventas.SubTotalTC, 0)
Dim articuloCounter As Integer = 0 ' Dim articuloCounter As Integer = 0
For Each concepto As Profact.TimbraCFDI33.ComprobanteConcepto In comprobante.Conceptos ' For Each concepto As Profact.TimbraCFDI33.ComprobanteConcepto In comprobante.Conceptos
articuloCounter = (articuloCounter + 1) ' articuloCounter = (articuloCounter + 1)
Next ' Next
detallista.lineItem = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItem((articuloCounter)) {} ' detallista.lineItem = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItem((articuloCounter)) {}
Dim counter As Integer = 0 ' Dim counter As Integer = 0
For Each concepto As Profact.TimbraCFDI33.ComprobanteConcepto In comprobante.Conceptos ' For Each concepto As Profact.TimbraCFDI33.ComprobanteConcepto In comprobante.Conceptos
detallista.lineItem(counter) = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItem ' detallista.lineItem(counter) = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItem
detallista.lineItem(counter).type = "SimpleInvoiceLineItemType" ' detallista.lineItem(counter).type = "SimpleInvoiceLineItemType"
detallista.lineItem(counter).number = (counter + 1).ToString ' detallista.lineItem(counter).number = (counter + 1).ToString
detallista.lineItem(counter).tradeItemIdentification = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemTradeItemIdentification ' detallista.lineItem(counter).tradeItemIdentification = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemTradeItemIdentification
detallista.lineItem(counter).tradeItemIdentification.gtin = comprobante.Conceptos(counter).NoIdentificacion ' detallista.lineItem(counter).tradeItemIdentification.gtin = comprobante.Conceptos(counter).NoIdentificacion
detallista.lineItem(counter).alternateTradeItemIdentification = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemAlternateTradeItemIdentification(1) {} ' detallista.lineItem(counter).alternateTradeItemIdentification = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemAlternateTradeItemIdentification(1) {}
detallista.lineItem(counter).alternateTradeItemIdentification(0) = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemAlternateTradeItemIdentification ' detallista.lineItem(counter).alternateTradeItemIdentification(0) = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemAlternateTradeItemIdentification
detallista.lineItem(counter).alternateTradeItemIdentification(0).type = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemAlternateTradeItemIdentificationType ' detallista.lineItem(counter).alternateTradeItemIdentification(0).type = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemAlternateTradeItemIdentificationType
detallista.lineItem(counter).alternateTradeItemIdentification(0).type = Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemAlternateTradeItemIdentificationType.BUYER_ASSIGNED ' detallista.lineItem(counter).alternateTradeItemIdentification(0).type = Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemAlternateTradeItemIdentificationType.BUYER_ASSIGNED
detallista.lineItem(counter).tradeItemDescriptionInformation = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemTradeItemDescriptionInformation ' detallista.lineItem(counter).tradeItemDescriptionInformation = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemTradeItemDescriptionInformation
If (comprobante.Conceptos(counter).Descripcion.Length > 34) Then ' If (comprobante.Conceptos(counter).Descripcion.Length > 34) Then
detallista.lineItem(counter).tradeItemDescriptionInformation.longText = comprobante.Conceptos(counter).Descripcion.Substring(0, 34) ' detallista.lineItem(counter).tradeItemDescriptionInformation.longText = comprobante.Conceptos(counter).Descripcion.Substring(0, 34)
Else ' Else
detallista.lineItem(counter).tradeItemDescriptionInformation.longText = comprobante.Conceptos(counter).Descripcion ' detallista.lineItem(counter).tradeItemDescriptionInformation.longText = comprobante.Conceptos(counter).Descripcion
End If ' End If
detallista.lineItem(counter).invoicedQuantity = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemInvoicedQuantity ' detallista.lineItem(counter).invoicedQuantity = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemInvoicedQuantity
detallista.lineItem(counter).invoicedQuantity.unitOfMeasure = comprobante.Conceptos(counter).Unidad ' detallista.lineItem(counter).invoicedQuantity.unitOfMeasure = comprobante.Conceptos(counter).Unidad
detallista.lineItem(counter).invoicedQuantity.Text = New String((1)) {} ' detallista.lineItem(counter).invoicedQuantity.Text = New String((1)) {}
detallista.lineItem(counter).invoicedQuantity.Text(0) = comprobante.Conceptos(counter).Cantidad.ToString ' detallista.lineItem(counter).invoicedQuantity.Text(0) = comprobante.Conceptos(counter).Cantidad.ToString
detallista.lineItem(counter).aditionalQuantity = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemAditionalQuantity(1) {} ' detallista.lineItem(counter).aditionalQuantity = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemAditionalQuantity(1) {}
detallista.lineItem(counter).aditionalQuantity(0) = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemAditionalQuantity ' detallista.lineItem(counter).aditionalQuantity(0) = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemAditionalQuantity
detallista.lineItem(counter).aditionalQuantity(0).QuantityType = Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemAditionalQuantityQuantityType.NUM_CONSUMER_UNITS ' detallista.lineItem(counter).aditionalQuantity(0).QuantityType = Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemAditionalQuantityQuantityType.NUM_CONSUMER_UNITS
detallista.lineItem(counter).aditionalQuantity(0).Text = New String((1)) {} ' detallista.lineItem(counter).aditionalQuantity(0).Text = New String((1)) {}
detallista.lineItem(counter).aditionalQuantity(0).Text(0) = "1" ' detallista.lineItem(counter).aditionalQuantity(0).Text(0) = "1"
detallista.lineItem(counter).grossPrice = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemGrossPrice ' detallista.lineItem(counter).grossPrice = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemGrossPrice
detallista.lineItem(counter).grossPrice.Amount = comprobante.Conceptos(counter).ValorUnitario ' detallista.lineItem(counter).grossPrice.Amount = comprobante.Conceptos(counter).ValorUnitario
detallista.lineItem(counter).netPrice = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemNetPrice ' detallista.lineItem(counter).netPrice = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemNetPrice
detallista.lineItem(counter).netPrice.Amount = comprobante.Conceptos(counter).ValorUnitario ' detallista.lineItem(counter).netPrice.Amount = comprobante.Conceptos(counter).ValorUnitario
detallista.lineItem(counter).AdditionalInformation = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemAdditionalInformation ' detallista.lineItem(counter).AdditionalInformation = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemAdditionalInformation
detallista.lineItem(counter).AdditionalInformation.referenceIdentification = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemAdditionalInformationReferenceIdentification ' detallista.lineItem(counter).AdditionalInformation.referenceIdentification = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemAdditionalInformationReferenceIdentification
detallista.lineItem(counter).AdditionalInformation.referenceIdentification.type = Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemAdditionalInformationReferenceIdentificationType.ON ' detallista.lineItem(counter).AdditionalInformation.referenceIdentification.type = Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemAdditionalInformationReferenceIdentificationType.ON
detallista.lineItem(counter).AdditionalInformation.referenceIdentification.Value = "1587" ' detallista.lineItem(counter).AdditionalInformation.referenceIdentification.Value = "1587"
'Impuestos ' 'Impuestos
Dim tasa As Decimal = 0 ' Dim tasa As Decimal = 0
Dim importeImp As Decimal = 0 ' Dim importeImp As Decimal = 0
Try ' Try
If (Not (comprobante.Impuestos.Traslados) Is Nothing) Then ' If (Not (comprobante.Impuestos.Traslados) Is Nothing) Then
For Each traslado As Profact.TimbraCFDI33.ComprobanteImpuestosTraslado In comprobante.Impuestos.Traslados ' For Each traslado As Profact.TimbraCFDI33.ComprobanteImpuestosTraslado In comprobante.Impuestos.Traslados
tasa = Decimal.Parse(traslado.TasaOCuota) ' tasa = Decimal.Parse(traslado.TasaOCuota)
importeImp = (comprobante.Conceptos(counter).Importe * (tasa / 100)) ' importeImp = (comprobante.Conceptos(counter).Importe * (tasa / 100))
Next ' Next
End If ' End If
Catch ex As System.Exception ' Catch ex As System.Exception
End Try ' End Try
detallista.lineItem(counter).tradeItemTaxInformation = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemTradeItemTaxInformation(1) {} ' detallista.lineItem(counter).tradeItemTaxInformation = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemTradeItemTaxInformation(1) {}
detallista.lineItem(counter).tradeItemTaxInformation(0) = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemTradeItemTaxInformation ' detallista.lineItem(counter).tradeItemTaxInformation(0) = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemTradeItemTaxInformation
detallista.lineItem(counter).tradeItemTaxInformation(0).taxTypeDescription = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemTradeItemTaxInformationTaxTypeDescription ' detallista.lineItem(counter).tradeItemTaxInformation(0).taxTypeDescription = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemTradeItemTaxInformationTaxTypeDescription
detallista.lineItem(counter).tradeItemTaxInformation(0).taxTypeDescription = Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemTradeItemTaxInformationTaxTypeDescription.VAT ' detallista.lineItem(counter).tradeItemTaxInformation(0).taxTypeDescription = Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemTradeItemTaxInformationTaxTypeDescription.VAT
detallista.lineItem(counter).tradeItemTaxInformation(0).tradeItemTaxAmount = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemTradeItemTaxInformationTradeItemTaxAmount ' detallista.lineItem(counter).tradeItemTaxInformation(0).tradeItemTaxAmount = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemTradeItemTaxInformationTradeItemTaxAmount
detallista.lineItem(counter).tradeItemTaxInformation(0).tradeItemTaxAmount.taxPercentage = tasa ' detallista.lineItem(counter).tradeItemTaxInformation(0).tradeItemTaxAmount.taxPercentage = tasa
detallista.lineItem(counter).tradeItemTaxInformation(0).tradeItemTaxAmount.taxAmount = importeImp ' detallista.lineItem(counter).tradeItemTaxInformation(0).tradeItemTaxAmount.taxAmount = importeImp
detallista.lineItem(counter).totalLineAmount = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemTotalLineAmount ' detallista.lineItem(counter).totalLineAmount = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemTotalLineAmount
detallista.lineItem(counter).totalLineAmount.grossAmount = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemTotalLineAmountGrossAmount ' detallista.lineItem(counter).totalLineAmount.grossAmount = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemTotalLineAmountGrossAmount
detallista.lineItem(counter).totalLineAmount.grossAmount.Amount = comprobante.Conceptos(counter).Importe ' detallista.lineItem(counter).totalLineAmount.grossAmount.Amount = comprobante.Conceptos(counter).Importe
detallista.lineItem(counter).totalLineAmount.netAmount = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemTotalLineAmountNetAmount ' detallista.lineItem(counter).totalLineAmount.netAmount = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaLineItemTotalLineAmountNetAmount
detallista.lineItem(counter).totalLineAmount.netAmount.Amount = comprobante.Conceptos(counter).Importe ' detallista.lineItem(counter).totalLineAmount.netAmount.Amount = comprobante.Conceptos(counter).Importe
counter = (counter + 1) ' counter = (counter + 1)
Next ' Next
detallista.totalAmount = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaTotalAmount ' detallista.totalAmount = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaTotalAmount
detallista.totalAmount.Amount = comprobante.SubTotal ' detallista.totalAmount.Amount = comprobante.SubTotal
detallista.TotalAllowanceCharge = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaTotalAllowanceCharge(1) {} ' detallista.TotalAllowanceCharge = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaTotalAllowanceCharge(1) {}
detallista.TotalAllowanceCharge(0) = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaTotalAllowanceCharge ' detallista.TotalAllowanceCharge(0) = New Profact.TimbraCFDI33.Complementos.Detallista.detallistaTotalAllowanceCharge
detallista.TotalAllowanceCharge(0).allowanceOrChargeType = Profact.TimbraCFDI33.Complementos.Detallista.detallistaTotalAllowanceChargeAllowanceOrChargeType.ALLOWANCE ' detallista.TotalAllowanceCharge(0).allowanceOrChargeType = Profact.TimbraCFDI33.Complementos.Detallista.detallistaTotalAllowanceChargeAllowanceOrChargeType.ALLOWANCE
detallista.TotalAllowanceCharge(0).Amount = Ventas.DescuentoTC ' detallista.TotalAllowanceCharge(0).Amount = Ventas.DescuentoTC
Dim nombres As System.Xml.Serialization.XmlSerializerNamespaces = New System.Xml.Serialization.XmlSerializerNamespaces ' Dim nombres As System.Xml.Serialization.XmlSerializerNamespaces = New System.Xml.Serialization.XmlSerializerNamespaces
nombres.Add("detallista", "http://www.sat.gob.mx/detallista") ' nombres.Add("detallista", "http://www.sat.gob.mx/detallista")
Dim xmlDetallista As String = Profact.TimbraCFDI.XMLUtilerias.SerializaObjeto(detallista, GetType(Profact.TimbraCFDI33.Complementos.Detallista.detallista), nombres) ' Dim xmlDetallista As String = Profact.TimbraCFDI.XMLUtilerias.SerializaObjeto(detallista, GetType(Profact.TimbraCFDI33.Complementos.Detallista.detallista), nombres)
Dim docDetallista As XmlDocument = New XmlDocument ' Dim docDetallista As XmlDocument = New XmlDocument
docDetallista.LoadXml(xmlDetallista) ' docDetallista.LoadXml(xmlDetallista)
comprobante.DetallistaSpecified = True ' comprobante.DetallistaSpecified = True
LXmlComplementos.Add(docDetallista.DocumentElement) ' LXmlComplementos.Add(docDetallista.DocumentElement)
TieneComplemento = True ' TieneComplemento = True
End If ' End If
#End Region '#End Region
If TieneComplemento Then If TieneComplemento Then
comprobante.Complemento = New Profact.TimbraCFDI33.ComprobanteComplemento comprobante.Complemento = New Profact.TimbraCFDI33.ComprobanteComplemento
@@ -4109,7 +4185,7 @@ Public Class Timbrado
Dim ObjVentas As New ClsVentas() Dim ObjVentas As New ClsVentas()
If ObjVentas.UpdateEstatusFactura(3, FolioFiscal, "", Now, Ventas.CveVenta, CvePAC:=UsuarioActual.Empresa.CvePAC) Then If ObjVentas.UpdateEstatusFactura(3, FolioFiscal, "", Now, Ventas.CveVenta, CvePAC:=UsuarioActual.Empresa.CvePAC, RFCReceptor:=ObjCFDITimbre.Receptor.RFC) Then
Retorno = "" Retorno = ""
Else Else
Retorno = "Error" Retorno = "Error"
@@ -4133,7 +4209,7 @@ Public Class Timbrado
resultadoTimbre.GuardaCodigoBidimensional(RutaCBB, NombreCBB) resultadoTimbre.GuardaCodigoBidimensional(RutaCBB, NombreCBB)
'Genero la addenda Ford 'Genero la addenda Ford
If Ventas.Cliente.Ford_GSDB <> "" Then If Ventas.Cliente IsNot Nothing AndAlso Ventas.Cliente.Ford_GSDB <> "" Then
Dim RutaCadena As String = String.Format("{0}{1}.xml", RutaArchivo, NombreArchivoXML) 'If(UsuarioActual.Empresa.FacturaProduccion, String.Format("{0}XML\{1}\{2}.xml", Ruta, Ventas.SerieFolio), String.Format("{0}XML\{1}\{2}.xml", Ruta, Ventas.TipoDocto, Ventas.SerieFolio)) Dim RutaCadena As String = String.Format("{0}{1}.xml", RutaArchivo, NombreArchivoXML) 'If(UsuarioActual.Empresa.FacturaProduccion, String.Format("{0}XML\{1}\{2}.xml", Ruta, Ventas.SerieFolio), String.Format("{0}XML\{1}\{2}.xml", Ruta, Ventas.TipoDocto, Ventas.SerieFolio))

View File

@@ -20,10 +20,12 @@ Public Class TareasProgramadas : Implements IHttpHandler
Dim retorno As String = "no se encontro la variable" Dim retorno As String = "no se encontro la variable"
Try Try
Dim metodo As String = "" Dim metodo As String = ""
If context.Request("var") IsNot Nothing Then If context.Request("var") IsNot Nothing Then
URLParametros = Parametros(context.Request("var")) URLParametros = Parametros(context.Request("var"))
metodo = URLParametros("metodo") metodo = URLParametros("metodo")
ElseIf context.Request.Headers("Content-Type") IsNot Nothing AndAlso context.Request.Headers("Content-Type").Contains("json") AndAlso context.Request.InputStream IsNot Nothing Then 'SI TRAE UN JSON COMO PARAMETRO
ElseIf context.Request.Headers("Content-Type") IsNot Nothing AndAlso context.Request.Headers("Content-Type").Contains("json") AndAlso context.Request.InputStream IsNot Nothing AndAlso (context.Request("var") Is Nothing AndAlso context.Request("metodo") IsNot Nothing) Then
context.Response.ContentType = "application/json" context.Response.ContentType = "application/json"
Using reader As New StreamReader(context.Request.InputStream) Using reader As New StreamReader(context.Request.InputStream)
Dim json = reader.ReadToEnd() Dim json = reader.ReadToEnd()
@@ -32,6 +34,8 @@ Public Class TareasProgramadas : Implements IHttpHandler
metodo = JsonRequest("Metodo").ToString metodo = JsonRequest("Metodo").ToString
End If End If
End Using End Using
ElseIf context.Request("metodo") IsNot Nothing Then
metodo = context.Request("metodo").ToString()
End If End If
Select Case metodo Select Case metodo
@@ -282,9 +286,13 @@ Public Class TareasProgramadas : Implements IHttpHandler
Retorno.Add(obj) Retorno.Add(obj)
Next Next
DtEmpresas.Dispose()
End If End If
context.Response.Write(Retorno.ToString()) GuardaLogEdoCuenta(Retorno.ToString())
context.Response.Write("True")
End Sub End Sub
@@ -324,7 +332,8 @@ Public Class TareasProgramadas : Implements IHttpHandler
Private Function EjecutarEnvioEstadoCuenta(UsuarioActual As Usuario, Optional pCveCliente As Integer = -1) As JObject Private Function EjecutarEnvioEstadoCuenta(UsuarioActual As Usuario, Optional pCveCliente As Integer = -1) As JObject
Dim ClientesSinEnviar As New JArray() Dim ClientesSinEnviar As New JArray()
Dim ClientesEdoEnviado As New JArray()
Dim Json As New JObject( Dim Json As New JObject(
New JProperty("Empresa", UsuarioActual.Empresa.Empresa), New JProperty("Empresa", UsuarioActual.Empresa.Empresa),
@@ -333,37 +342,80 @@ Public Class TareasProgramadas : Implements IHttpHandler
) )
Dim DTClientes As DataTable = Nothing Dim DTClientes As DataTable = Nothing
Using ObjCliente As New ClsClientes 'Using ObjCliente As New ClsClientes
If ObjCliente.GetClientes(pCveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, TipoCliente:=-1, Estatus:=1) Then ' If ObjCliente.GetClientes(pCveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, TipoCliente:=-1, Estatus:=1) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then ' If ObjCliente.DtResultados.Rows.Count > 0 Then
DTClientes = ObjCliente.DtResultados.Copy() ' DTClientes = ObjCliente.DtResultados.Copy()
End If ' End If
' End If
'End Using
Using ObjMov As New ClsMovimientos
Dim FechaI As String = "-1"
Dim FechaF As String = "-1"
Dim FechaVI As String = "-1"
Dim FechaVF As String = "-1"
Dim TCEspecifico = -1
Dim CveCobranzaEstatus As Integer = -1
Dim CveClienteClasificacion As Integer = -1
Dim CveCliente As Integer = -1
Dim AplicaAnticipos As Integer = 0
Dim CveSubProyecto As Integer = -1
Dim CveVendedor As Integer = -1
Dim Grupo As Integer = 5
Dim TipoCambio As Integer = 1
Dim TipoDocto As String = "-1"
Dim FechaCorte As DateTime = New DateTime(Now.Year, 12, 31)
If ObjMov.GetCxC(FechaI, FechaF, CveCliente, CveSubProyecto, CveVendedor, -1, -1, "-1", UsuarioActual.CveEmpresa, Grupo, -1, TipoCambio, TCEspecifico, TipoDocto, FechaVI, FechaVF, FechaCorte:=FechaCorte,
EstatusCliente:=1, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveCobranzaEstatus:=CveCobranzaEstatus, CveClienteClasificacion:=-1, TipoCliente:=-1, AplicaAnticiposPagados:=AplicaAnticipos) Then
DTClientes = ObjMov.DtResultados.FiltraParametros("CveCliente > 0", DistinctColumns:={"CveCliente"})
End If End If
End Using End Using
If DTClientes IsNot Nothing Then If DTClientes IsNot Nothing Then
For Each RowCliente As DataRow In DTClientes.Rows
Dim CveCliente As Integer = RowCliente("CveCliente").ToString().ToEntero()
Dim Correo As String = RowCliente("CobranzaCorreo").ToString()
'DTClientes = DTClientes.FiltraParametros("CveCliente IN (227289,227429,227733,227838,228181,228544,229176,229481,230029,230432,230860,230911,230918,231197,231576,232173,232185,233055,233295,233357,233588,236379,236460,237161,237635,238285,238530,238622,238724,239033,239099,239865,239895,239903,240202,240235,240236,240238,240303,240340,262404,262517,264765,264806,264825,264848,264930,265063,265180,265213,265214,265236,265344,265492,265555,265669,265797,265952,265963,266156,266182,268346,268396,268488,268535,268539,268558,268562,268706,268726,268787,268868,268889,268910,268925,269023,269081,269089,272066,272070,272657,273080,273084,275627,276259,276587,281115,283110,284664,285392,287653,288711,291374,292444,295578,296375,296598,302728,303936,306897,307183,311007,320060,320685,320800,323520,323772,325237,326996,327801,330630,331741,332118,337105,340502,341796,342807,343858,355862,358123,365794,371524,375391,377122,377948,378267,380167,381210,381878,383098,383250,383339,383650,384472,385321,385585,386630,387114,388987,396341,396405,396541,401995,404175,408306,416386,416819,420275,438732,447566,447636,450284,464150,464376,468051,475172,475932,476984,477997,478426)")
For Each RowCliente As DataRow In DTClientes.Rows
Dim CveCliente As Integer = RowCliente("CveCliente").ToString().ToEntero()
Dim Cliente As New Modelos.ClienteModel(CveCliente, UsuarioActual.CveEmpresa) Dim Cliente As New Modelos.ClienteModel(CveCliente, UsuarioActual.CveEmpresa)
Dim Envio = EnviarEstadoCuenta(UsuarioActual, Correo, Cliente) If Cliente IsNot Nothing Then
Dim Correo As String = Cliente.CobranzaCorreo '"japmx95@gmail.com" 'RowCliente("CobranzaCorreo").ToString()
If Envio Then Dim Envio As Boolean = False
Using ObjBitacora As New ClsOIEventos If Not String.IsNullOrEmpty(Correo) Then
ObjBitacora.AddEventoBitacora("Se envió correo con el estado de cuenta del cliente", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCliente:=Cliente.CveCliente) Envio = EnviarEstadoCuenta(UsuarioActual, Correo, Cliente)
End Using End If
Else
ClientesSinEnviar.Add(New JObject( If Envio Then
New JProperty("CveCliente", Cliente.CveCliente),
New JProperty("Cliente", Cliente.Nombre) ClientesEdoEnviado.Add(New JObject(
)) New JProperty("CveCliente", Cliente.CveCliente),
End If New JProperty("Cliente", Cliente.Nombre)
))
Using ObjBitacora As New ClsOIEventos
ObjBitacora.AddEventoBitacora("Se envió correo con el estado de cuenta del cliente", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCliente:=Cliente.CveCliente)
End Using
Else
ClientesSinEnviar.Add(New JObject(
New JProperty("CveCliente", Cliente.CveCliente),
New JProperty("Cliente", Cliente.Nombre)
))
End If
End If
Next Next
DTClientes.Dispose() DTClientes.Dispose()
End If End If
Json.Add(New JProperty("ClientesSinEnviar", ClientesSinEnviar)) Json.Add(New JProperty("ClientesSinEnviar", ClientesSinEnviar))
Json.Add(New JProperty("ClientesEdoEnviado", ClientesEdoEnviado))
Return Json Return Json
End Function End Function
@@ -616,10 +668,12 @@ Public Class TareasProgramadas : Implements IHttpHandler
<br /> <br />
<b>ESTE CORREO SE GENERO EN FORMA AUTOMATICA.</b>", Cliente.NombreComercial, UsuarioActual.Empresa.Empresa) <b>ESTE CORREO SE GENERO EN FORMA AUTOMATICA.</b>", Cliente.NombreComercial, UsuarioActual.Empresa.Empresa)
Retorno = MandaCorreo(ArchivoPDF, Correo, $"Estado Actual de Cartera {UsuarioActual.Empresa.Empresa}", Cuerpo) Dim Hilo As New System.Threading.Thread(Sub() MandaCorreo(ArchivoPDF, Correo, $"Estado Actual de Cartera {UsuarioActual.Empresa.Empresa}", Cuerpo))
Hilo.Start()
Retorno = True
Catch ex As Exception Catch ex As Exception
Retorno = False Retorno = False
OnError("Ocurrió un error al enviar el correo", ex) OnError("Ocurrió error al mandar el correo de estado de cuenta", ex)
End Try End Try
Else Else
Retorno = False Retorno = False
@@ -683,17 +737,47 @@ Public Class TareasProgramadas : Implements IHttpHandler
Return Bytes Return Bytes
End Function End Function
Private Function MandaCorreo(File As Byte(), Para As String, Asunto As String, Body As String) As Boolean Private Function MandaCorreo(File As Byte(), Para As String, Asunto As String, Body As String) As Boolean
'Para = "japmx95@gmail.com"
Try
Dim a As String = String.Format("{0} -- {1} ---- -->", Asunto, Para)
'a.GuardaLog()
Dim Mail As New ClsSisMail()
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = File, .NombreArchivo = "EstadoDeCuenta.pdf"})
Return Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=LSRutasMail)
Catch ex As Exception
OnError("Ocurrió un error al enviar el correo de edo cuenta", ex)
Return False
End Try
Dim a As String = String.Format("{0} -- {1} ---- -->", Asunto, Para)
'a.GuardaLog()
Dim Mail As New ClsSisMail()
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = File, .NombreArchivo = "EstadoDeCuenta.pdf"})
Return Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=LSRutasMail)
End Function End Function
Public Sub GuardaLogEdoCuenta(Str As String)
Dim ArchivoW As StreamWriter
Dim strLineaTMP As String
' strLineaTMP = Chr(13) & Chr(10) & Day(Now) & "/" & Month(Now) & "/" & Year(Now) & " " & Hour(Now) & ":" & Minuto & ". " & Str & Chr(13) & Chr(10)
strLineaTMP = String.Format("{0}{1}Log: {2}{3}:{4}", Chr(13), Chr(10), Str, DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString)
Try
ArchivoW = New StreamWriter(String.Format("{0}\Log\LogEdoCuenta.txt", ModExtensiones.DirectorioBaseEmpresas), True, System.Text.Encoding.UTF8)
Catch ex As UnauthorizedAccessException
'Alert("No hay permisos para guardar en el Log.", Extensiones.TipoMensaje.MsgError)
Exit Sub
Catch ex As Exception
Exit Sub
End Try
Try
ArchivoW.WriteLine(strLineaTMP)
Catch
End Try
ArchivoW.Close()
ArchivoW.Dispose()
End Sub
#End Region #End Region
End Class End Class

View File

@@ -304,17 +304,20 @@ Partial Class Bancos_DepositosCaja
End If End If
'Asignamos la cuenta Deposito 'Asignamos la cuenta Deposito
If Not OcurrioError AndAlso Not ObjBancos.UpdateBancos_IECuentaDeposito(CveIEDestino, CveIE) Then If Not OcurrioError AndAlso Not ObjBancos.UpdateBancos_IECuentaDeposito(CveIEOrigen, CveIE) Then
OcurrioError = True OcurrioError = True
Exit For Exit For
End If End If
Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEDestino}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}")
'documentos += String.Format("<a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir {1}</a> <br/><br/> ", StrEncript, SerieFolio)
End If End If
Next Next
Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEOrigen}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}")
documentos += String.Format("<br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir {1}</a> <br/><br/> ", StrEncript, "Depósito Bancario")
If OcurrioError Then If OcurrioError Then
ObjContabilidad.RollBack() ObjContabilidad.RollBack()

View File

@@ -44,7 +44,7 @@
<asp:LinkButton ID="LnkChqDevuelto" runat="server" Visible="false" OnClick="LnkChqDevuelto_Click" Style="color: #686868;"><i class="fa fa-ban" style="color:#686868;"></i> Cheque Devuelto</asp:LinkButton> <asp:LinkButton ID="LnkChqDevuelto" runat="server" Visible="false" OnClick="LnkChqDevuelto_Click" Style="color: #686868;"><i class="fa fa-ban" style="color:#686868;"></i> Cheque Devuelto</asp:LinkButton>
</li> </li>
<li> <li>
<asp:LinkButton ID="LnkCancelar" runat="server" Visible="false" OnClick="LnkCancelar_Click" Style="color: #686868;"><i class="fa fa-ban" style="color:#686868;"></i> Cancelar Movimiento</asp:LinkButton> <asp:LinkButton ID="LnkCancelar" runat="server" Visible="false" OnClick="LnkCancelar_Click" Style="color: #686868;" data-toggle="tooltip" data-placement="left" title="Cancelar Movimiento" ><i class="fa fa-ban" style="color:#686868;"></i> Cancelar Movimiento</asp:LinkButton>
</li> </li>
<li> <li>
<asp:LinkButton ID="LnkEliminar" runat="server" Visible="false" OnClientClick="return confirm('¿Está seguro de eliminar el documento?');" Style="color: #686868;"><i class="fa fa-minus" style="color: #686868;"></i> Eliminar Movimiento</asp:LinkButton> <asp:LinkButton ID="LnkEliminar" runat="server" Visible="false" OnClientClick="return confirm('¿Está seguro de eliminar el documento?');" Style="color: #686868;"><i class="fa fa-minus" style="color: #686868;"></i> Eliminar Movimiento</asp:LinkButton>
@@ -53,7 +53,7 @@
<asp:LinkButton ID="LnkCancelarComplemento" OnClick="LnkCancelarComplemento_Click" runat="server" Visible="false" Style="color: #686868;"><i class="fa fa-ban" style="color: #686868;"></i> Refacturar Complemento</asp:LinkButton> <asp:LinkButton ID="LnkCancelarComplemento" OnClick="LnkCancelarComplemento_Click" runat="server" Visible="false" Style="color: #686868;"><i class="fa fa-ban" style="color: #686868;"></i> Refacturar Complemento</asp:LinkButton>
</li> </li>
<li> <li>
<asp:LinkButton ID="LnkCancelarComplementoImporte" OnClick="LnkCancelarComplementoImporte_Click" runat="server" Visible="false" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea cancelar el movimiento y complemento?" data-btn-ok-label="si" Style="color: #686868;"> <i class="fa fa-pencil"></i> Cancelar</asp:LinkButton> <asp:LinkButton ID="LnkCancelarComplementoImporte" OnClick="LnkCancelarComplementoImporte_Click" runat="server" Visible="false" data-btn-ok-label="si" Style="color: #686868;" data-toggle="tooltip" data-placement="left" title="Cancelar Movimiento y Complemento" > <i class="fa fa-pencil"></i> Cancelar Movimiento y Complemento</asp:LinkButton>
<%-- data-original-title="¿Está seguro que desea cancelar el documento?" data-btn-ok-label="si" Style="color: #686868;"><i class="fa fa-pencil"--%> <%-- data-original-title="¿Está seguro que desea cancelar el documento?" data-btn-ok-label="si" Style="color: #686868;"><i class="fa fa-pencil"--%>

View File

@@ -709,9 +709,10 @@ Partial Class Bancos_PopIEVentas
End If End If
Else Else
'no se pudo validar, pero ya tuvo la primera vuelta de validacion 'no se pudo validar, pero ya tuvo la primera vuelta de validacion
Alert("La factura no se pudo validar.") Alert("La factura no se pudo validar.", TipoMensaje.MsgAdvertencia)
Validada = False Validada = False
BtnGuardar.Visible = False BtnGuardar.Enabled = False
BtnGuardar.ToolTip = "La factura no se pudo validar"
End If End If
Valida.Dispose() Valida.Dispose()
Else Else

View File

@@ -12413,8 +12413,9 @@ Partial Class Compras_Compras
dr1("Cantidad") = (dr1("Cantidad").ToString.ToDouble - Cantidad.ToDouble) dr1("Cantidad") = (dr1("Cantidad").ToString.ToDouble - Cantidad.ToDouble)
dr1("Total") = dr1("PU").ToString.ToDouble * dr1("Cantidad").ToString.ToDecimal dr1("Total") = dr1("PU").ToString.ToDouble * dr1("Cantidad").ToString.ToDecimal
dr1("Importe") = dr1("Total")
dr1("IVA") = Math.Round(dr1("IVAPorcentaje").ToString.ToDecimal * dr1("Total").ToString.ToDecimal, 6) dr1("IVA") = Math.Round(dr1("IVAPorcentaje").ToString.ToDecimal * dr1("Total").ToString.ToDecimal, 6)
dr1("IEPSPS") = Math.Round(dr1("IEPSPSPorcentaje").ToString.ToDecimal * dr1("Total").ToString.ToDecimal, 6)
TmpDT.AcceptChanges() TmpDT.AcceptChanges()
@@ -12423,8 +12424,9 @@ Partial Class Compras_Compras
dr("CodAF") = "" dr("CodAF") = ""
dr("Cantidad") = Cantidad.ToDecimal dr("Cantidad") = Cantidad.ToDecimal
dr("Total") = dr("PU").ToString.ToDecimal * Cantidad.ToDecimal dr("Total") = dr("PU").ToString.ToDecimal * Cantidad.ToDecimal
dr("Importe") = dr("Total") 'dr("Importe") = dr("Total")
dr("IVA") = Math.Round(dr("IVAPorcentaje").ToString.ToDecimal * dr("Total").ToString.ToDecimal, 6) dr("IVA") = Math.Round(dr("IVAPorcentaje").ToString.ToDecimal * dr("Total").ToString.ToDecimal, 6)
dr("IEPSPS") = Math.Round(dr("IEPSPSPorcentaje").ToString.ToDecimal * dr("Total").ToString.ToDecimal, 6)
TmpDT.Rows.InsertAt(dr, Index + 1) TmpDT.Rows.InsertAt(dr, Index + 1)

View File

@@ -2448,7 +2448,11 @@ Partial Class PopUpVerFactura
Dim ClienteNombre = "", EnvioContacto = "", EnvioDireccion = "", EnvioColonia = "", EnvioCiudad = "", EnvioEstado = "", ClientePais = "", EnvioCP = "", Contrato = "", Dim ClienteNombre = "", EnvioContacto = "", EnvioDireccion = "", EnvioColonia = "", EnvioCiudad = "", EnvioEstado = "", ClientePais = "", EnvioCP = "", Contrato = "",
Paqueteria = "", NumContrato = "", Guia = "" Paqueteria = "", NumContrato = "", Guia = ""
Dim CveContrato As Integer = DtMovimientos(0)("CveContrato").ToString.ToEntero Dim CveContrato As Integer = 0
If DtMovimientos IsNot Nothing AndAlso DtMovimientos.Rows.Count > 0 Then
CveContrato = DtMovimientos(0)("CveContrato").ToString.ToEntero
End If
If CveContrato > 0 Then If CveContrato > 0 Then
Contrato = GlobalDTContratos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("DescripcionContrato", $"CveContrato={CveContrato} AND CveEmpresa = {UsuarioActual.CveEmpresa}") Contrato = GlobalDTContratos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("DescripcionContrato", $"CveContrato={CveContrato} AND CveEmpresa = {UsuarioActual.CveEmpresa}")
NumContrato = GlobalDTContratos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("NumeroContrato", $"CveContrato={CveContrato} AND CveEmpresa = {UsuarioActual.CveEmpresa}") NumContrato = GlobalDTContratos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("NumeroContrato", $"CveContrato={CveContrato} AND CveEmpresa = {UsuarioActual.CveEmpresa}")

View File

@@ -93,9 +93,9 @@
<table class="table table-striped Widthall"> <table class="table table-striped Widthall">
<tr> <tr>
<th style=""></th> <th style=""></th>
<th style="width: 100px;"></th> <th style="width: 80px;"></th>
<th style="width: 100px;"></th> <th style="width: 60px;"></th>
<th style="width: 100px;"></th> <th style="width: 80px;"></th>
<th style="width: 120px;"></th> <th style="width: 120px;"></th>
<th style="width: 120px;"></th> <th style="width: 120px;"></th>
<th style="width: 120px;"></th> <th style="width: 120px;"></th>
@@ -132,7 +132,7 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="UM" ItemStyle-Width="60px"> <asp:TemplateField HeaderText="UM" ItemStyle-Width="50px">
<ItemTemplate> <ItemTemplate>
<span><%# Eval("Abreviatura")%></span> <span><%# Eval("Abreviatura")%></span>
</ItemTemplate> </ItemTemplate>
@@ -356,7 +356,7 @@
var cantidad = parseFloat(txtCantidad.val()); var cantidad = parseFloat(txtCantidad.val());
debugger;
if (!Math.round10) { if (!Math.round10) {
Math.round10 = function (value, exp) { Math.round10 = function (value, exp) {
@@ -364,13 +364,14 @@
}; };
} }
if (opcion == 2) { if (opcion == 2) { //editar importe
if (txtimporte.val().toString().length > 0) { if (txtimporte.val().toString().length > 0) {
var importe = parseFloat(txtimporte.val()); var importe = parseFloat(txtimporte.val());
cantidad = parseFloat(importe / pu); cantidad = parseFloat(importe / pu);
txtCantidad.val(cantidad); txtCantidad.val(cantidad);
txtPorcentaje.val(Math.round10(cantidad * 100 / max, -2));
}else{ }else{
cantidad = 0.0 cantidad = 0.0
@@ -379,12 +380,13 @@
} }
} }
if (opcion == 3) { if (opcion == 3) { //editar porcentaje
if (txtPorcentaje.val().toString().length > 0) { if (txtPorcentaje.val().toString().length > 0) {
var porcentaje = parseFloat(txtPorcentaje.val()); var porcentaje = parseFloat(txtPorcentaje.val());
cantidad = (porcentaje * max / 100); cantidad = (porcentaje * max / 100);
txtCantidad.val(cantidad); txtCantidad.val(cantidad);
txtimporte.val((cantidad * pu).toFixed(2));
} else { } else {
cantidad = 0; cantidad = 0;
txtCantidad.val(''); txtCantidad.val('');
@@ -401,13 +403,13 @@
} }
if (cantidad > 0) { //if (cantidad > 0) {
txtimporte.val(cantidad * pu); // txtimporte.val((cantidad * pu).toFixed(2));
txtPorcentaje.val(Math.round10(cantidad * 100 / max, -2)); // txtPorcentaje.val(Math.round10(cantidad * 100 / max, -2));
} else { //} else {
txtimporte.val(''); // txtimporte.val('');
txtPorcentaje.val(''); // txtPorcentaje.val('');
} //}
} }

File diff suppressed because it is too large Load Diff

View File

@@ -569,7 +569,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
Dim Inventarios As New ClsInventarios Dim Inventarios As New ClsInventarios
Inventarios.IniciaTransacSQL() Inventarios.IniciaTransacSQL()
If Inventarios.AddInventarioFisicoResultados(CveInventarioFisico, UsuarioActual.CveUsuario) Then If Inventarios.AddInventarioFisicoResultados(CveInventarioFisico, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
If Inventarios.UpdateInventarioFisicoEstatus(CveInventarioFisico, 3, UsuarioActual.CveEmpresa) Then If Inventarios.UpdateInventarioFisicoEstatus(CveInventarioFisico, 3, UsuarioActual.CveEmpresa) Then
Dim url As String = ("/Inventarios/RepAnomalias.aspx?CveInventarioFisico=" + CveInventarioFisico.ToString) Dim url As String = ("/Inventarios/RepAnomalias.aspx?CveInventarioFisico=" + CveInventarioFisico.ToString)
Alert("Ha finalizado el Inventario Físico. Sera enviado al reporte de anomalías", TipoMensaje.MsgInformacion, " window.location=""" + url + """") Alert("Ha finalizado el Inventario Físico. Sera enviado al reporte de anomalías", TipoMensaje.MsgInformacion, " window.location=""" + url + """")
@@ -779,9 +779,9 @@ Partial Class Inventarios_InventarioFisicoDetalle
End If End If
Dim serie As String = IIf(TxtSerieLote.Text.ToString = "", "-1", TxtSerieLote.Text.ToString) Dim serie As String = IIf(TxtSerieLote.Text.ToString = "", "-1", TxtSerieLote.Text.ToString)
Dim Lote As String = IIf(TxtLoteEdit.Text.ToString = "", "-1", TxtLoteEdit.Text.ToString) Dim Lote As String = IIf(TxtLoteEdit.Text.ToString = "", "-1", TxtLoteEdit.Text.ToString)
Dim FechaCaducida As Date = IIf(TxtFechaCaducida.Text.ToString = "", MinFecha, TxtFechaCaducida.Text.ToString.ToDate) Dim FechaCaducidad As Date = IIf(TxtFechaCaducida.Text.ToString = "", MinFecha, TxtFechaCaducida.Text.ToString.ToDate)
If objInventario.UpdateInventarioFisicoDetalles(HfCveInventarioFisicoDetalle.Value.ToEntero, HfCvePS.Value.ToEntero, HfCveUM.Value.ToEntero, TxtCantidad.Text.ToEntero, serie, Lote, FechaCaducida) Then If objInventario.UpdateInventarioFisicoDetalles(HfCveInventarioFisicoDetalle.Value.ToEntero, HfCvePS.Value.ToEntero, HfCveUM.Value.ToEntero, TxtCantidad.Text.ToDecimal, serie, Lote, FechaCaducidad) Then
If objInventario.GetInventarioFisicoDetalle(CveInventarioFisico, ddlUsuario.SelectedValue.ToString.ToEntero) Then If objInventario.GetInventarioFisicoDetalle(CveInventarioFisico, ddlUsuario.SelectedValue.ToString.ToEntero) Then
GvIFD.DataSource = objInventario.DtResultados GvIFD.DataSource = objInventario.DtResultados
End If End If

View File

@@ -2322,7 +2322,7 @@ Partial Class Inventarios_RecepcionAlmacen
Dim tCveConcepto As Integer = 69 Dim tCveConcepto As Integer = 69
For Each RowInv As DataRow In tmpCostos.Rows For Each RowInv As DataRow In tmpCostos.Rows
ValorInventario = DtCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundSQL
If tCveConcepto = 69 Then If tCveConcepto = 69 Then
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
End If End If
@@ -2532,7 +2532,7 @@ Partial Class Inventarios_RecepcionAlmacen
ElseIf DtDetalleLote.Rows.Count > 0 Then ElseIf DtDetalleLote.Rows.Count > 0 Then
Dim ContDt As Integer = 0 Dim ContDt As Integer = 0
' por redondeo ' por redondeo
If gvr.FCTextBox("TbCantidadF").Text.ToDouble = 1 Then PU = PU.RoundAD If gvr.FCTextBox("TbCantidadF").Text.ToDouble = 1 Then PU = PU.RoundSQL
For Each Dr As DataRow In DtDetalleLote.Rows For Each Dr As DataRow In DtDetalleLote.Rows
SumaTotal += Dr("Cantidad").ToString.ToDecimal * (PU + CostoIndirecto) SumaTotal += Dr("Cantidad").ToString.ToDecimal * (PU + CostoIndirecto)
If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso ContDt + 1 = DtDetalleLote.Rows.Count AndAlso (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL <> SumaTotal Then If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso ContDt + 1 = DtDetalleLote.Rows.Count AndAlso (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL <> SumaTotal Then
@@ -2633,7 +2633,7 @@ Partial Class Inventarios_RecepcionAlmacen
ElseIf DtDetalleLote.Rows.Count > 0 Then ElseIf DtDetalleLote.Rows.Count > 0 Then
Dim ContDt As Integer = 0 Dim ContDt As Integer = 0
' por redondeo ' por redondeo
If gvr.FCTextBox("TbCantidadF").Text.ToDouble = 1 Then PU = PU.RoundAD If gvr.FCTextBox("TbCantidadF").Text.ToDouble = 1 Then PU = PU.RoundSQL
For Each Dr As DataRow In DtDetalleLote.Rows For Each Dr As DataRow In DtDetalleLote.Rows
SumaTotal += Dr("Cantidad").ToString.ToDecimal * (PU + CostoIndirecto) SumaTotal += Dr("Cantidad").ToString.ToDecimal * (PU + CostoIndirecto)
If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso ContDt + 1 = DtDetalleLote.Rows.Count AndAlso (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL <> SumaTotal Then If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso ContDt + 1 = DtDetalleLote.Rows.Count AndAlso (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL <> SumaTotal Then
@@ -2650,7 +2650,7 @@ Partial Class Inventarios_RecepcionAlmacen
Next Next
Else Else
' por redondeo ' por redondeo
If gvr.FCTextBox("TbCantidadF").Text.ToDouble = 1 Then PU = PU.RoundAD If gvr.FCTextBox("TbCantidadF").Text.ToDouble = 1 Then PU = PU.RoundSQL
SumaTotal += gvr.FCTextBox("TbCantidadF").Text.ToDecimal * (PU + CostoIndirecto) ' considerar el costo indirecto para el ajuste SumaTotal += gvr.FCTextBox("TbCantidadF").Text.ToDecimal * (PU + CostoIndirecto) ' considerar el costo indirecto para el ajuste
If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL <> SumaTotal.RoundSQL Then If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL <> SumaTotal.RoundSQL Then
Dim tTotal As Decimal = gvr.FCTextBox("TbCantidadF").Text.ToDecimal * (PU) Dim tTotal As Decimal = gvr.FCTextBox("TbCantidadF").Text.ToDecimal * (PU)
@@ -3159,7 +3159,7 @@ Partial Class Inventarios_RecepcionAlmacen
Dim ValorInventario As Decimal = 0 Dim ValorInventario As Decimal = 0
DtCostos = ObjInventario.DtResultados DtCostos = ObjInventario.DtResultados
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL
Dim TotalCostoExtranjero As Decimal = DtCostos.SUM("TotalExtranjero").ToDecimal Dim TotalCostoExtranjero As Decimal = DtCostos.SUMD("TotalExtranjero")
'VARIABLES 'VARIABLES
Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero
@@ -4195,7 +4195,7 @@ Partial Class Inventarios_RecepcionAlmacen
For Each Dr As DataRow In DtInv.Rows For Each Dr As DataRow In DtInv.Rows
Dr("PU") = Dr("PUExtranjero") Dr("PU") = Dr("PUExtranjero")
Dr("Total") = Dr("PU").ToString.ToDouble * Dr("Cantidad").ToString.ToDouble Dr("Total") = Dr("PU").ToString.ToDecimal * Dr("Cantidad").ToString.ToDecimal
Dr("CostoIndirecto") = Dr("CostoIndirectoExtranjero") Dr("CostoIndirecto") = Dr("CostoIndirectoExtranjero")
Next Next
@@ -4222,9 +4222,9 @@ Partial Class Inventarios_RecepcionAlmacen
End If End If
For Each Dr As DataRow In DtInv.Rows For Each Dr As DataRow In DtInv.Rows
Dr("PU") = Dr("PUExtranjero").ToString.ToDouble * TipoCambio Dr("PU") = Dr("PUExtranjero").ToString.ToDecimal * TipoCambio
Dr("Total") = Dr("PU").ToString.ToDouble * Dr("CantidadC").ToString.ToDouble Dr("Total") = Dr("PU").ToString.ToDecimal * Dr("CantidadC").ToString.ToDecimal
Dr("CostoIndirecto") = Dr("CostoIndirectoExtranjero").ToString.ToDouble * TipoCambio Dr("CostoIndirecto") = Dr("CostoIndirectoExtranjero").ToString.ToDecimal * TipoCambio
Next Next
DtInv.AcceptChanges() DtInv.AcceptChanges()
End Sub End Sub

View File

@@ -198,7 +198,7 @@ Partial Class Inventarios_RepAnomalias
If (GvF.Rows.Count > 0) Then If (GvF.Rows.Count > 0) Then
GvF.UseAccessibleHeader = True GvF.UseAccessibleHeader = True
GvF.HeaderRow.TableSection = TableRowSection.TableHeader GvF.HeaderRow.TableSection = TableRowSection.TableHeader
Script = "OrdenarGVF();"
divRegistradosFaltan.Visible = True divRegistradosFaltan.Visible = True
LtlTotalRegistrosFaltan.Text = GvF.Rows.Count.ToString LtlTotalRegistrosFaltan.Text = GvF.Rows.Count.ToString
End If End If
@@ -206,7 +206,7 @@ Partial Class Inventarios_RepAnomalias
If (GvS.Rows.Count > 0) Then If (GvS.Rows.Count > 0) Then
GvS.UseAccessibleHeader = True GvS.UseAccessibleHeader = True
GvS.HeaderRow.TableSection = TableRowSection.TableHeader GvS.HeaderRow.TableSection = TableRowSection.TableHeader
Script += "OrdenarGVS();"
divRegistradosSobran.Visible = True divRegistradosSobran.Visible = True
LtlTotalRegistrosSobran.Text = GvS.Rows.Count.ToString LtlTotalRegistrosSobran.Text = GvS.Rows.Count.ToString
End If End If
@@ -214,7 +214,7 @@ Partial Class Inventarios_RepAnomalias
If (GvC.Rows.Count > 0) Then If (GvC.Rows.Count > 0) Then
GvC.UseAccessibleHeader = True GvC.UseAccessibleHeader = True
GvC.HeaderRow.TableSection = TableRowSection.TableHeader GvC.HeaderRow.TableSection = TableRowSection.TableHeader
Script += "OrdenarGVS();"
divRegistradosCoinciden.Visible = True divRegistradosCoinciden.Visible = True
LtlCoincidentes.Text = GvC.Rows.Count.ToString LtlCoincidentes.Text = GvC.Rows.Count.ToString
End If End If
@@ -233,7 +233,7 @@ Partial Class Inventarios_RepAnomalias
Protected Sub btnFin_Click(sender As Object, e As EventArgs) Handles btnFin.Click Protected Sub btnFin_Click(sender As Object, e As EventArgs) Handles btnFin.Click
Dim Inventarios As New ClsInventarios Dim Inventarios As New ClsInventarios
Inventarios.IniciaTransacSQL() Inventarios.IniciaTransacSQL()
If Inventarios.AddInventarioFisicoResultados(CveInventarioFisico, UsuarioActual.CveUsuario) Then If Inventarios.AddInventarioFisicoResultados(CveInventarioFisico, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
If Inventarios.UpdateInventarioFisicoEstatus(CveInventarioFisico, 3, UsuarioActual.CveEmpresa) Then If Inventarios.UpdateInventarioFisicoEstatus(CveInventarioFisico, 3, UsuarioActual.CveEmpresa) Then
Dim url As String = ("/Inventarios/RepAnomalias.aspx?CveInventarioFisico=" + CveInventarioFisico.ToString) Dim url As String = ("/Inventarios/RepAnomalias.aspx?CveInventarioFisico=" + CveInventarioFisico.ToString)
Alert("Ha finalizado el Inventario Físico. Sera enviado al reporte de anomalías", TipoMensaje.MsgInformacion, " window.location=""" + url + """") Alert("Ha finalizado el Inventario Físico. Sera enviado al reporte de anomalías", TipoMensaje.MsgInformacion, " window.location=""" + url + """")

View File

@@ -2583,12 +2583,11 @@ Partial Class Inventarios_TraspasoAlmacen
ObjFactura.Version = "3.3" ObjFactura.Version = "3.3"
ObjFactura.CveUsuario = UsuarioActual.CveUsuario ObjFactura.CveUsuario = UsuarioActual.CveUsuario
ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa
ObjFactura.TipoCambio = 0 'ObjFactura.TipoCambio = 1
ObjFactura.ConvertirPesos = False ObjFactura.ConvertirPesos = False
ObjFactura.TipoCambio = 0
ObjFactura.CveMoneda = 1 ObjFactura.CveMoneda = 1
ObjFactura.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {ObjFactura.CveMoneda} ") ObjFactura.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {ObjFactura.CveMoneda} ")
ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", "CveMoneda = 1") ObjFactura.MonedaSAT = "XXX" 'GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", "CveMoneda = 1")
ObjFactura.MonedaAbreviatura = GlobalDTMonedas.FiltroPrimeroValor("Abreviatura", $"CveMoneda = {ObjFactura.CveMoneda} ") ObjFactura.MonedaAbreviatura = GlobalDTMonedas.FiltroPrimeroValor("Abreviatura", $"CveMoneda = {ObjFactura.CveMoneda} ")
ObjFactura.TipoDocto = "Tra" ObjFactura.TipoDocto = "Tra"
ObjFactura.RefDocto = "" ObjFactura.RefDocto = ""
@@ -2656,23 +2655,22 @@ Partial Class Inventarios_TraspasoAlmacen
ObjFactura.Inv_CveMovimiento = CveMovimientoTimbrado ObjFactura.Inv_CveMovimiento = CveMovimientoTimbrado
ObjFactura.Timbre = PreParaTimbre(ObjFactura) ObjFactura.Timbre = PreParaTimbreCartaPorte(ObjFactura)
End Sub End Sub
Private Function PreParaTimbre(Obj As Modelos.Factura) As CFDITimbre Private Function PreParaTimbreCartaPorte(Obj As Modelos.Factura) As CFDITimbre
Dim Timbre As New CFDITimbre Dim Timbre As New CFDITimbre
Timbre.Comprobante.TipoComprobante = "T" Timbre.Comprobante.TipoComprobante = "T"
Timbre.Comprobante.Folio = Obj.Folio.ToString Timbre.Comprobante.Folio = Obj.Folio.ToString
Timbre.Comprobante.Serie = Obj.Serie Timbre.Comprobante.Serie = Obj.Serie
Timbre.Comprobante.Fecha = Obj.Fecha Timbre.Comprobante.Fecha = Obj.Fecha
Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33 Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33
Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33 Timbre.Comprobante.CondicionesdePago = ""
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
Timbre.Comprobante.Moneda = Obj.MonedaSAT Timbre.Comprobante.Moneda = "XXX"
Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString) Timbre.Comprobante.TipoCambio = "" ' CONDICIÓN SI LA MONEDA ES 'XXX'
Timbre.Comprobante.Total = Obj.Total
Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP
Timbre.Comprobante.Confirmacion = "" Timbre.Comprobante.Confirmacion = ""
@@ -2690,7 +2688,75 @@ Partial Class Inventarios_TraspasoAlmacen
'DETALLES 'DETALLES
Dim tPS As String = "" Dim tPS As String = ""
Dim CartaPorte As New CFDICartaPorte
CartaPorte.TranspInternac = "No"
CartaPorte.EntradaSalidaMercancia = ""
CartaPorte.ViaEntradaSalida = ""
CartaPorte.TotalDistanciaRecorrida = 12
CartaPorte.Mercancias.PesoBrutoTotal = 0
CartaPorte.Mercancias.UnidadPeso = ""
CartaPorte.Mercancias.CargoporTasacion = 0
CartaPorte.FiguraTransporte.AutoTransporteFederal.PermSCT = "TPAF01"
CartaPorte.FiguraTransporte.AutoTransporteFederal.NumPermisoSCT = "1234567890"
CartaPorte.FiguraTransporte.AutoTransporteFederal.NombreAseg = "GNP"
CartaPorte.FiguraTransporte.AutoTransporteFederal.NumPolizaSeguro = "P123"
CartaPorte.FiguraTransporte.AutoTransporteFederal.Vehiculo.ConfigVehicular = "C2"
CartaPorte.FiguraTransporte.AutoTransporteFederal.Vehiculo.PlacaVM = "WTF757A"
CartaPorte.FiguraTransporte.AutoTransporteFederal.Vehiculo.AnioModeloVM = 2007
Dim DomOrigen As New CFDICartaPorteDomicilio With {.Calle = "calle",
.Colonia = "",
.CP = "45200",
.Estado = "JAL",
.Pais = "MEX",
.Localidad = ""}
Dim DomDestino As New CFDICartaPorteDomicilio With {.Calle = "calle destino",
.Colonia = "",
.CP = "45200",
.Estado = "JAL",
.Pais = "MEX",
.Localidad = ""}
Dim Ubica As New CFDICartaPorteUbicaciones
Ubica.TipoEstacion = "01"
Ubica.DistanciaRecorrida = 6
Ubica.Origen = New CFDICartaPorteUbicacionOrigen With {.RFCRemitente = "CAMJ841219I33",
.FechaHoraSalida = "2021-08-23T11:13:01",
.NombreRemitente = "Empresa",
.Domicilio = DomOrigen}
Ubica.Destino = New CFDICartaPorteUbicacionDestino With {.RFCDestinatario = "CAMJ841219I33",
.FechaHoraProgLlegada = "2021-08-23T11:13:01",
.NombreDestinatario = "Empresa dest",
.Domicilio = DomDestino}
CartaPorte.Ubicaciones.Add(Ubica)
CartaPorte.FiguraTransporte.ClaveTransporte = "01"
CartaPorte.FiguraTransporte.Operadores.Add(New CFDICartaPorteOperador With {.RFCOperador = "CAMJ841219I33",
.Domicilio = Nothing,
.NombreOperador = "juan Perez",
.NumLicencia = "Num Lic",
.NumRegidTribOperador = "",
.ResidenciaFiscalOperador = ""})
'concepto único
Dim concepto As New CFDIConceptos With {.Cantidad = 1,
.Descripcion = "Flete",
.ValorUnitario = 0,
.Importe = 0,
.Descuento = 0L,
.Unidad = "Servicio",
.ClaveUnidad = "E48",
.ClaveProdServ = "78101802",
.Noidentificacion = "",
.CuentaPredial = ""}
Timbre.Conceptos.Add(concepto)
For Each drr As DataRow In Obj.DtDetalle.Rows For Each drr As DataRow In Obj.DtDetalle.Rows
If drr("PS").ToString.Length = 1 Then If drr("PS").ToString.Length = 1 Then
tPS = drr("Obs").ToString tPS = drr("Obs").ToString
Else Else
@@ -2700,32 +2766,32 @@ Partial Class Inventarios_TraspasoAlmacen
tPS = String.Format("{0} {1}", drr("PS"), drr("Obs")) tPS = String.Format("{0} {1}", drr("PS"), drr("Obs"))
End If End If
End If End If
Dim conceptoCarta As New CFDICartaPorteMercancia With {
.BienesTransp = drr("SATClaveProdServ").ToString,
.ClaveSTCC = "01334",
.Cantidad = drr("Cantidad").ToString.ToDecimal,
.Descripción = tPS,
.ClaveUnidad = drr("SATClaveUM").ToString,
.Unidad = drr("UM").ToString,
.Dimensiones = "",
.MaterialPeligroso = "",
.Embalaje = "",
.DescripEmbalaje = "",
.PesoenKg = 203,
.ValorMercancia = drr("PU").ToString.ToDecimal,
.Moneda = "MXN", 'tempral
.FraccionArrancelaria = "",
.UUIDComercioExt = ""
}
'CONDICIONANTE, ESPECIAL
If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" 'LES COMENTAN QUE NO DEBE IR LA ETIQUETA DE LA UNIDAD EN EL PRODUCTO
Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString.ToDecimal,
.Descripcion = tPS,
.ValorUnitario = drr("PU").ToString.ToDecimal,
.Importe = drr("TotalImporte").ToString.ToDecimal,
.Descuento = drr("Descuento").ToString.ToDecimal,
.Unidad = drr("UM").ToString,
.ClaveUnidad = drr("SATClaveUM").ToString,
.ClaveProdServ = drr("SATClaveProdServ").ToString,
.Noidentificacion = drr("Noidentificacion").ToString,
.CuentaPredial = drr("CuentaPredial").ToString}
'VERIFICA SUMA SUBTOTALES
If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'PROCESO DE AJUSTA DE DECIMALES
concepto.Importe = totSubTotal
End If
totSubTotal = totSubTotal - concepto.Importe totSubTotal = totSubTotal - concepto.Importe
CartaPorte.Mercancias.Mercancias.Add(conceptoCarta)
'SIEMPRE ESTAMOS AGREGANDO EL IVA
'concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIVA").ToString.ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString.ToDecimal})
Timbre.Conceptos.Add(concepto)
i += 1 i += 1
Next Next
Timbre.Complementos.CartaPorte = CartaPorte
Return Timbre Return Timbre
End Function End Function
@@ -2783,6 +2849,11 @@ Partial Class Inventarios_TraspasoAlmacen
Dim TmpDTComplementosTimbrado As New DataTable Dim TmpDTComplementosTimbrado As New DataTable
PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado) PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado)
MensajeAlert.Append("<br/><br/>") MensajeAlert.Append("<br/><br/>")
'If TimbrarFacturaGoCFDIv33(ObjFactura, UsuarioActual, 4) <> "" Then
' MensajeAlert.AppendFormat("<ul><li>-- no timbró-{0}</li></ul>", MensajeErrorCFDI)
'End If
If ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) Then If ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) Then
MensajeAlert.Append("Emitido con exito.") MensajeAlert.Append("Emitido con exito.")
'XML 'XML
@@ -2800,7 +2871,7 @@ Partial Class Inventarios_TraspasoAlmacen
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar Carta Porte</a></li></ul>", Encripta(String.Format("OP=CARPO&CVEMOV={0}", CveMovimientoTimbrado))) MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar Carta Porte</a></li></ul>", Encripta(String.Format("OP=CARPO&CVEMOV={0}", CveMovimientoTimbrado)))
Else Else
MensajeAlert.AppendFormat(ObjTimbrado.MensajeErrorCFDI) MensajeAlert.AppendFormat("<ul><li>{0}</li></ul>", ObjTimbrado.MensajeErrorCFDI)
End If End If
End Sub End Sub
@@ -3010,54 +3081,6 @@ Partial Class Inventarios_TraspasoAlmacen
End If End If
End Sub End Sub
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath)
Dim unnamed As Integer = 0
Dim cols As Integer
Dim columns As String()
Dim curRow As Integer = 0
Dim curCol As Integer = 0
Dim dataTable As DataTable = New DataTable()
Dim worksheet As ExcelWorksheet = excelFile.Worksheets(0)
For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1
If firstRowHasHeaders Then
If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then
dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString())
Else
dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed)))
End If
curRow = 1
Else
dataTable.Columns.Add("Column " & (cols + 1))
End If
Next
While curRow < worksheet.Rows.Count
columns = New String(cols - 1) {}
For curCol = 0 To cols - 1
If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then
columns(curCol) = ""
Else
columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString()
End If
Next
dataTable.Rows.Add(columns)
curRow += 1
End While
Return dataTable
End Function
Public Sub CargarCamiones() Public Sub CargarCamiones()
DdlUnidadCamion.Items.Clear() DdlUnidadCamion.Items.Clear()
Dim ObjInventarios As New ClsInventarios Dim ObjInventarios As New ClsInventarios
@@ -3151,4 +3174,5 @@ Partial Class Inventarios_TraspasoAlmacen
UpDatos.Update() UpDatos.Update()
End If End If
End Sub End Sub
End Class End Class

View File

@@ -3754,8 +3754,12 @@ Partial Class OC
e.Row.FCDropDownList("DdlPS").Enabled = False e.Row.FCDropDownList("DdlPS").Enabled = False
e.Row.FCDropDownList("DdlClasificacion").Enabled = False e.Row.FCDropDownList("DdlClasificacion").Enabled = False
e.Row.FCDropDownList("CboUnidadMedidaEdit").Enabled = False e.Row.FCDropDownList("CboUnidadMedidaEdit").Enabled = False
e.Row.FCTextBox("TxtImporteEdit").Enabled = False 'que tenga el permiso que no bloquee
e.Row.FCTextBox("TxtDescuentoEdit").Enabled = False If Not UsuarioActual.TienePermisoProceso(329) AndAlso e.Row.DBCampo("CantidadVinculadaCompra").ToDouble = 0 Then 'permite editar pu, aun estando recibida
e.Row.FCTextBox("TxtImporteEdit").Enabled = False
e.Row.FCTextBox("TxtDescuentoEdit").Enabled = False
End If
End If End If
'DDL PS 'DDL PS

View File

@@ -19,6 +19,16 @@
<li> <li>
<asp:HyperLink ID="HlAgregarExcel" NavigateUrl="#" Visible="True" data-toggle="modal" data-target="#DivCargaExcel" runat="server"><i class='fa fa-server'></i> Importar Listado</asp:HyperLink> <asp:HyperLink ID="HlAgregarExcel" NavigateUrl="#" Visible="True" data-toggle="modal" data-target="#DivCargaExcel" runat="server"><i class='fa fa-server'></i> Importar Listado</asp:HyperLink>
</li> </li>
<li>
<asp:UpdatePanel ID="UpExportarExcel" runat="server">
<ContentTemplate>
<asp:LinkButton ID="LnkExportarExcel" Text="<i class='fa fa-file-excel-o'></i> ExportarExcel" runat="server" OnClick="LnkExportarExcel_Click"></asp:LinkButton>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkExportarExcel"/>
</Triggers>
</asp:UpdatePanel>
</li>
</asp:Content> </asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server"> <asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">

View File

@@ -5,7 +5,8 @@ Option Strict On
Imports Extensiones Imports Extensiones
Imports System.Data Imports System.Data
Imports GemBox.Spreadsheet Imports GemBox.Spreadsheet
Imports System.IO
Partial Class Ventas_ActualizarPrecios Partial Class Ventas_ActualizarPrecios
Inherits ClsPaginas Inherits ClsPaginas
@@ -17,6 +18,16 @@ Partial Class Ventas_ActualizarPrecios
ViewState("DtSubProyectos") = value ViewState("DtSubProyectos") = value
End Set End Set
End Property End Property
Private Property DtDatosPrecios As DataTable
Get
Return If(IsNothing(ViewState("DtDatosPrecios")), Nothing, CType(ViewState("DtDatosPrecios"), DataTable))
End Get
Set(value As DataTable)
ViewState("DtDatosPrecios") = value
End Set
End Property
Private Property CveSucursal As Integer Private Property CveSucursal As Integer
Get Get
If ViewState("CveSucursal") Is Nothing Then If ViewState("CveSucursal") Is Nothing Then
@@ -145,7 +156,7 @@ Partial Class Ventas_ActualizarPrecios
End Sub End Sub
Private Sub CargarModelos() Private Sub CargarModelos()
If UsuarioActual.Empresa.Funcionalidad(558).ToString = "1" Then If UsuarioActual.Empresa.Funcionalidad(558).ToString = "1" Then
lblModelo.visible = True lblModelo.Visible = True
DdlModelo.Visible = True DdlModelo.Visible = True
Dim ObjGeneral As New ClsGenerales Dim ObjGeneral As New ClsGenerales
If ObjGeneral.GetModelos(UsuarioActual.CveEmpresa) Then If ObjGeneral.GetModelos(UsuarioActual.CveEmpresa) Then
@@ -173,7 +184,8 @@ Partial Class Ventas_ActualizarPrecios
If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, DdlPrecioLista.SelectedValue.ToEntero, DDlClasificacion.SelectedValue.ToEntero, CvePS, If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, DdlPrecioLista.SelectedValue.ToEntero, DDlClasificacion.SelectedValue.ToEntero, CvePS,
CveProveedor:=CveProveedor, Estado:=DdlEstado.SelectedValue.ToEntero, Marcas:=Marcas, CveModelo:=DdlModelo.SelectedValue.ToEntero) Then CveProveedor:=CveProveedor, Estado:=DdlEstado.SelectedValue.ToEntero, Marcas:=Marcas, CveModelo:=DdlModelo.SelectedValue.ToEntero) Then
GVPrecios.DataSource = objPS.DtResultados DtDatosPrecios = objPS.DtResultados
GVPrecios.DataSource = DtDatosPrecios
End If End If
objPS.Dispose() objPS.Dispose()
@@ -246,8 +258,8 @@ Partial Class Ventas_ActualizarPrecios
TxtImporte.Text = "" TxtImporte.Text = ""
TxtPrecio.Text = "" TxtPrecio.Text = ""
TxtPorcentaje.Text = "" TxtPorcentaje.Text = ""
End Sub End Sub
#Region "MODAL PRECIOS MINIMOS" #Region "MODAL PRECIOS MINIMOS"
Public Sub LnkPrecioMinActual_Click(sender As Object, e As EventArgs) Public Sub LnkPrecioMinActual_Click(sender As Object, e As EventArgs)
@@ -305,10 +317,10 @@ Partial Class Ventas_ActualizarPrecios
ObjProductosServicios.Dispose() ObjProductosServicios.Dispose()
End Sub End Sub
#End Region #End Region
#Region "C A R G A R E X C E L " #Region "C A R G A R E X C E L "
Private Sub BtnDescargarFormato_Click(sender As Object, e As EventArgs) Handles BtnDescargarFormato.Click Private Sub BtnDescargarFormato_Click(sender As Object, e As EventArgs) Handles BtnDescargarFormato.Click
@@ -544,9 +556,9 @@ Partial Class Ventas_ActualizarPrecios
End While End While
Return dataTable Return dataTable
End Function End Function
#End Region #End Region
Protected Sub gvSucursal_RowDataBound(sender As Object, e As GridViewRowEventArgs) Protected Sub gvSucursal_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCTextBox("TxtPrecioMinimo").Attributes.Add("onKeyUp", String.Format("FncSeleccionaChk({0});", e.Row.FCCheckBox("chkSucursal").ClientID)) e.Row.FCTextBox("TxtPrecioMinimo").Attributes.Add("onKeyUp", String.Format("FncSeleccionaChk({0});", e.Row.FCCheckBox("chkSucursal").ClientID))
@@ -592,5 +604,200 @@ Partial Class Ventas_ActualizarPrecios
Return True Return True
End If End If
End Function End Function
Protected Sub LnkExportarExcel_Click(sender As Object, e As EventArgs)
Dim DtExcel As New DataTable("Precios")
DtExcel.Columns.Add(New DataColumn("Código", GetType(String)))
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'Empresa Acumuladores
DtExcel.Columns.Add(New DataColumn("Código CPK", GetType(String)))
End If
DtExcel.Columns.Add(New DataColumn("Producto/Servicio", GetType(String)))
DtExcel.Columns.Add(New DataColumn("Clasificación", GetType(String)))
DtExcel.Columns.Add(New DataColumn("Importe", GetType(Decimal)))
DtExcel.Columns.Add(New DataColumn("Precio Mínimo", GetType(Decimal)))
DtExcel.Columns.Add(New DataColumn("U.M.", GetType(String)))
DtExcel.Columns.Add(New DataColumn("Moneda", GetType(String)))
If UsuarioActual.CveEmpresa = 153 Then 'Empresa servec
DtExcel.Columns.Add(New DataColumn("C. Promedio", GetType(Decimal)))
End If
DtExcel.Columns.Add(New DataColumn("E. Mínimo", GetType(Decimal)))
DtExcel.Columns.Add(New DataColumn("Importe Anterior", GetType(Decimal)))
DtExcel.Columns.Add(New DataColumn("Precio Mínimo Anterior", GetType(Decimal)))
DtExcel.Columns.Add(New DataColumn("Fecha Modificación", GetType(DateTime)))
DtExcel.Columns.Add(New DataColumn("Usuario Modificó", GetType(String)))
DtExcel.Columns.Add(New DataColumn("Porcentaje", GetType(Decimal)))
DtExcel.Columns.Add(New DataColumn("Fecha Ingreso", GetType(Decimal)))
DtExcel.Columns.Add(New DataColumn("Usuario Ingresó", GetType(String)))
If DtDatosPrecios IsNot Nothing Then
For Each Row As DataRow In DtDatosPrecios.Rows
Dim NewRow As DataRow = DtExcel.NewRow()
NewRow("Código") = Row("Codigo")
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'Empresa Acumuladores
NewRow("Código CPK") = Row("Codigo2")
End If
NewRow("Producto/Servicio") = Row("PS")
NewRow("Clasificación") = Row("Clasificacion")
NewRow("Importe") = Row("PrecioLista")
NewRow("Precio Mínimo") = Row("PrecioMinimo")
NewRow("U.M.") = Row("UnidadMedida")
NewRow("Moneda") = Row("Moneda")
If UsuarioActual.CveEmpresa = 153 Then 'Empresa servec
NewRow("C. Promedio") = Row("CostoPromedio")
End If
NewRow("E. Mínimo") = Row("VentaMinima")
NewRow("Importe Anterior") = Row("ImporteAnterior")
NewRow("Precio Mínimo Anterior") = Row("PrecioMinimoAnterior")
NewRow("Fecha Modificación") = Row("FechaModificacion")
NewRow("Usuario Modificó") = Row("UsuarioModifico")
NewRow("Porcentaje") = Row("Porcentaje")
NewRow("Fecha Ingreso") = Row("FechaIng")
NewRow("Usuario Ingresó") = Row("Usuario")
DtExcel.Rows.Add(NewRow)
Next
End If
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim FileExcel As New ExcelFile()
Dim worksheet = FileExcel.Worksheets.Add(DtExcel.TableName)
worksheet.InsertDataTable(DtExcel, New InsertDataTableOptions() With
{
.ColumnHeaders = True,
.StartRow = 0,
.StartColumn = 0
})
worksheet.Rows(0).Style.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(75, 119, 190), SpreadsheetColor.FromArgb(255, 255, 255))
worksheet.Rows(0).Style.Font.Color = SpreadsheetColor.FromArgb(255, 255, 255)
Dim columnCount = worksheet.CalculateMaxUsedColumns()
For i = 0 To columnCount
worksheet.Columns(i).AutoFit(1, worksheet.Rows(0), worksheet.Rows(worksheet.Rows.Count - 1))
Next
Dim FechaIMes As String = "", FechaFMes As String = "", Titulo As String = "LISTADO DE PRECIOS", ListaPrecios As String = DdlPrecioLista.SelectedItem.Text, Divisor As Integer = 1, AlturaImagen As Double = 100, AnchoImagen As Double = 100, DatoTituloExtra As String = ""
Dim TotalRowHeader As Integer = 8
Dim TotalRowFooter As Integer = 2
worksheet.Rows.InsertEmpty(0, TotalRowHeader)
Dim celdasConTexto = worksheet.GetUsedCellRange(True)
celdasConTexto.Style.Font.Name = "Calibri Light"
Dim RangoNombreEmpresa = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex)
RangoNombreEmpresa.Merged = True
RangoNombreEmpresa.Value = UsuarioActual.Empresa.Empresa
RangoNombreEmpresa.Style.Font.Size = 20 * 20
RangoNombreEmpresa.Style.Font.Name = "Calibri Light"
RangoNombreEmpresa.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoNombreEmpresa.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
Dim RangoTitulo = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex)
RangoTitulo.Merged = True
RangoTitulo.Value = Titulo
RangoTitulo.Style.Font.Size = 17 * 20
RangoTitulo.Style.Font.Name = "Calibri Light"
RangoTitulo.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
'If FechaIMes.Trim.Length > 0 And FechaFMes.Trim.Length > 0 Then
' Dim RangoFechas = worksheet.Cells.GetSubrangeAbsolute(4, celdasConTexto.FirstColumnIndex, 4, celdasConTexto.LastColumnIndex)
' RangoFechas.Merged = True
' RangoFechas.Value = $"Fechas: {FechaIMes} a {FechaFMes}"
' RangoFechas.Style.Font.Size = 15 * 20
' RangoFechas.Style.Font.Name = "Calibri Light"
' RangoFechas.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
' RangoFechas.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
'End If
If ListaPrecios.Length > 0 Then
Dim RangoSubProyecto = worksheet.Cells.GetSubrangeAbsolute(5, celdasConTexto.FirstColumnIndex, 5, celdasConTexto.LastColumnIndex)
RangoSubProyecto.Merged = True
RangoSubProyecto.Value = $"Lista de precio: {ListaPrecios}"
RangoSubProyecto.Style.Font.Size = 14 * 20
RangoSubProyecto.Style.Font.Name = "Calibri Light"
RangoSubProyecto.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoSubProyecto.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
End If
For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
worksheet.Rows(8).Cells(i).Style.Font.Size = 12 * 20
worksheet.Rows(8).Cells(i).Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
worksheet.Rows(8).Cells(i).Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
worksheet.Rows(8).Cells(i).Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
worksheet.Rows(8).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)
If i > 0 Then
Try
worksheet.Columns(i).AutoFit(1)
Catch ex As Exception
End Try
End If
Next
Dim IndexEndTable As Integer = DtExcel.Rows.Count + TotalRowHeader + TotalRowFooter
worksheet.Rows(IndexEndTable).Cells(0).Value = "Usuario Imprimió"
worksheet.Rows(IndexEndTable + 1).Cells(0).Value = UsuarioActual.Nombre
worksheet.Rows(IndexEndTable).Cells(2).Value = "Fecha Impresión"
worksheet.Rows(IndexEndTable + 1).Cells(2).Value = DateTime.Now.ToString("dd/MM/yyyy")
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
If Imagen.Exists Then
Dim Ruta As String = String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)
Using sr As New StreamReader(Ruta)
Dim ms As New MemoryStream()
sr.BaseStream.CopyTo(ms)
worksheet.Pictures.Add(ms, ExcelPictureFormat.Png, "A1", AnchoImagen, AlturaImagen, LengthUnit.Pixel)
End Using
End If
For I = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
If I > 0 Then
If Divisor = 1 Then
worksheet.Columns(I + 1).Style.NumberFormat = "#,##0.00"
Else
worksheet.Columns(I + 1).Style.NumberFormat = "#,##"
End If
Try
worksheet.Columns(I).AutoFit(1)
Catch ex As Exception
End Try
End If
Next
FileExcel.Save(Response, "Precios.xlsx", SaveOptions.XlsxDefault)
End Sub
End Class End Class

View File

@@ -85,7 +85,7 @@ Partial Class Ventas_CatImpuestosLocales
Dim TieneError = False Dim TieneError = False
Dim CveImpuestoLocal As Integer = GvImpuestos.Rows(e.RowIndex).DataKey("CveImpuestoLocal").ToEntero Dim CveImpuestoLocal As Integer = GvImpuestos.Rows(e.RowIndex).DataKey("CveImpuestoLocal").ToEntero
Dim Impuesto As String = GvImpuestos.Rows(e.RowIndex).FCTextBox("TxtImpuestoLocal").Text.Trim Dim Impuesto As String = GvImpuestos.Rows(e.RowIndex).FCTextBox("TxtImpuestoLocal").Text.Trim
Dim Porcentaje As Double = GvImpuestos.Rows(e.RowIndex).FCTextBox("TxtVentaPorcentaje").Text.ToDouble Dim Porcentaje As Decimal = GvImpuestos.Rows(e.RowIndex).FCTextBox("TxtVentaPorcentaje").Text.ToDecimal
Dim Orden = GvImpuestos.Rows(e.RowIndex).FCTextBox("TxtOrdenImpuesto").Text.ToEntero Dim Orden = GvImpuestos.Rows(e.RowIndex).FCTextBox("TxtOrdenImpuesto").Text.ToEntero
Dim TipoImpuesto = GvImpuestos.Rows(e.RowIndex).FCDropDownList("DdlTipoImpuestoEdit").SelectedValue.ToEntero Dim TipoImpuesto = GvImpuestos.Rows(e.RowIndex).FCDropDownList("DdlTipoImpuestoEdit").SelectedValue.ToEntero
Dim IdCtaContable = GvImpuestos.Rows(e.RowIndex).FCDropDownList("DdlCuentasContables").SelectedValue.ToEntero Dim IdCtaContable = GvImpuestos.Rows(e.RowIndex).FCDropDownList("DdlCuentasContables").SelectedValue.ToEntero
@@ -199,7 +199,7 @@ Partial Class Ventas_CatImpuestosLocales
If CveImpuestoLocal = -1 Then If CveImpuestoLocal = -1 Then
If ChkEstatus.Checked Then Estatus = 1 If ChkEstatus.Checked Then Estatus = 1
If ObjVentas.AddImpuestosLocales(TxtImpuesto.Text.Trim, TxtPorcentaje.Text.ToDouble, TxtOrden.Text.ToEntero, DdlTipoImpuesto.SelectedValue.ToEntero, Estatus, DdlCuentasContables.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then If ObjVentas.AddImpuestosLocales(TxtImpuesto.Text.Trim, TxtPorcentaje.Text.ToDecimal, TxtOrden.Text.ToEntero, DdlTipoImpuesto.SelectedValue.ToEntero, Estatus, DdlCuentasContables.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
CargaDatos() CargaDatos()
End If End If
TxtImpuesto.Text = "" TxtImpuesto.Text = ""
@@ -210,7 +210,7 @@ Partial Class Ventas_CatImpuestosLocales
If CveImpuestoLocal <> -1 Then If CveImpuestoLocal <> -1 Then
Dim TieneError = False Dim TieneError = False
Dim Impuesto As String = TxtImpuesto.Text.Trim Dim Impuesto As String = TxtImpuesto.Text.Trim
Dim Porcentaje As Double = TxtPorcentaje.Text.ToDouble Dim Porcentaje As Decimal = TxtPorcentaje.Text.ToDecimal
Dim Orden = TxtOrden.Text.ToEntero Dim Orden = TxtOrden.Text.ToEntero
Dim TipoImpuesto = DdlTipoImpuesto.SelectedValue.ToEntero Dim TipoImpuesto = DdlTipoImpuesto.SelectedValue.ToEntero
Dim IdCtaContable = DdlCuentasContables.SelectedValue.ToEntero Dim IdCtaContable = DdlCuentasContables.SelectedValue.ToEntero

View File

@@ -1584,6 +1584,12 @@
<asp:Label ID="LblAmort" runat="server" ClientIDMode="Static" Text="0.00" Style="display: none;"></asp:Label> <asp:Label ID="LblAmort" runat="server" ClientIDMode="Static" Text="0.00" Style="display: none;"></asp:Label>
</td> </td>
</tr> </tr>
<tr id="TrDescuentoIncluido" runat="server" visible="false">
<td>Descuento Incluido:</td>
<td>
<asp:Label ID="LblDescuentoIncluido" runat="server" ClientIDMode="Static" Text="0.00"></asp:Label>
</td>
</tr>
<tr> <tr>
<td>Por Porcentaje</td> <td>Por Porcentaje</td>
<td> <td>
@@ -1604,6 +1610,12 @@
&nbsp;($) &nbsp;($)
</td> </td>
</tr> </tr>
<tr id="TrDescuentoAdicional" runat="server" visible="false">
<td>Descuento Adicional:</td>
<td>
<asp:Label ID="LblDescuentoAdicional" runat="server" ClientIDMode="Static" Text="0.00"></asp:Label>
</td>
</tr>
<tr> <tr>
<td> <td>
<b> <b>
@@ -2846,6 +2858,7 @@
<asp:CustomValidator ID="CVDescuento" runat="server" ClientValidationFunction="ValidaDecimal6digits" ControlToValidate="TxtDescuento" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descuento''</b> no tiene el formato correcto. Por favor rectifique y vuelva a intentar." ValidateEmptyText="True" ValidationGroup="GrpAddVenta"></asp:CustomValidator> <asp:CustomValidator ID="CVDescuento" runat="server" ClientValidationFunction="ValidaDecimal6digits" ControlToValidate="TxtDescuento" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descuento''</b> no tiene el formato correcto. Por favor rectifique y vuelva a intentar." ValidateEmptyText="True" ValidationGroup="GrpAddVenta"></asp:CustomValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender6" runat="server" HighlightCssClass="vco" TargetControlID="CVDescuento" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender6" runat="server" HighlightCssClass="vco" TargetControlID="CVDescuento" Width="300px"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtDescuento.ClientID.ToString()%>">Descuento:</label> <label for="<%= TxtDescuento.ClientID.ToString()%>">Descuento:</label>
<asp:HiddenField ID="HdnDescuentoOriginal" runat="server" Value="0" ClientIDMode="Static" />
</div> </div>
</div> </div>
<div class="col-md-1"> <div class="col-md-1">
@@ -3374,6 +3387,68 @@
} }
function CalculaDescuentoAdicional() {
if ($get("TxtPorDescP").value != "0" && $get("TxtPorDescP").value != "") {
var MontoOriginal = ToDouble($get("HdnDescuentoOriginal").value);
var Monto = 0;
var TipoDescuento = $get("HdnTipoDescuento").value;
if (TipoDescuento == 0) {
Monto = parseFloat($get("LblPrecio1").innerText.replace(",", "").replace(",", ""));
}
else if (TipoDescuento == 1) {
Monto = parseFloat($get("LblTotalPS1").innerText.replace(",", "").replace(",", ""));
}
else if (TipoDescuento == 2) {
Monto = parseFloat($get("LblSubTotal1").innerText.replace(",", "").replace(",", ""));
}
else if (TipoDescuento == 3) {
Monto = parseFloat($get("LblSubTotal1").innerText.replace(",", "").replace(",", ""));
}
if (MontoOriginal > 0) {
Monto = Monto - MontoOriginal;
}
var Descuento = parseFloat($get("TxtPorDescP").value);
var PorcentajeDescuentoMaximo = parseFloat($get("HdnPorcentajeDescuentoMaximo").value);
if (PorcentajeDescuentoMaximo > 0 && Descuento > PorcentajeDescuentoMaximo) {
$get("TxtDescP").value = "0";
$get("TxtPorDescP").value = "0";
$get("LblDescuentoAdicional").innerText = "0.00";
Descuento = 0;
alert("No puede exceder el descuento maximo autorizado.");
}
$get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 2, '.', ',');
$get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ',');
var Total = (Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", ""))) ;
$get("LblDescuentoAdicional").innerText = formato_numero(Total, 2, '.', ',');
//SUMA EL DESCUENTO YA EXISTENTE AL ORIGINAL
Total = Total + MontoOriginal;
$get("LblDescuento").innerText = formato_numero(Total, 2, '.', ',');
$get("TxtDescuento").value = formato_numero(Total, 2, '.', ',');
$get("TxtDescP").value = formato_numero(0, 2, '.', ',');
$get("HdnDescuento").value = Total;
if (TipoDescuento == 2) {
$get("LblDescuentos").innerText = formato_numero(Total, 2, '.', ',');
}
}
else {
$get("LblPrecioFinal").innerText = "0.00";
$get("LblDescuento").innerText = "0.00";
$get("HdnDescuento").value = "0.00";
$get("LblDescuentoAdicional").innerText = "0.00";
}
}
function CalculaDescuentoMonto() { function CalculaDescuentoMonto() {
if ($get("TxtDescP").value != "0" && $get("TxtDescP").value) { if ($get("TxtDescP").value != "0" && $get("TxtDescP").value) {
@@ -3423,6 +3498,69 @@
} }
} }
function CalculaDescuentoMontoAdicional() {
if ($get("TxtDescP").value != "0" && $get("TxtDescP").value) {
var MontoOriginal = ToDouble($get("HdnDescuentoOriginal").value);
var Monto = 0;
var TipoDescuento = $get("HdnTipoDescuento").value;
if (TipoDescuento == 0) {
Monto = parseFloat($get("LblPrecio1").innerText.replace(",", "").replace(",", ""));
}
else if (TipoDescuento == 1) {
Monto = parseFloat($get("LblTotalPS1").innerText.replace(",", "").replace(",", ""));
}
else if (TipoDescuento == 2) {
Monto = parseFloat($get("LblSubTotal1").innerText.replace(",", "").replace(",", ""));
}
else if (TipoDescuento == 3) {
Monto = parseFloat($get("LblSubTotal1").innerText.replace(",", "").replace(",", ""));
}
if (MontoOriginal > 0) {
Monto = Monto - MontoOriginal;
}
var Descuento = parseFloat($get("TxtDescP").value);
var PorcentajeDescuento = (Descuento * 100 / Monto)
var PorcentajeDescuentoMaximo = parseFloat($get("HdnPorcentajeDescuentoMaximo").value);
if (PorcentajeDescuentoMaximo > 0 && PorcentajeDescuento > PorcentajeDescuentoMaximo) {
$get("TxtDescP").value = "0";
$get("TxtPorDescP").value = "0";
$get("LblDescuentoAdicional").innerText = "0.00";
Descuento = 0;
alert("No puede exceder el descuento maximo autorizado.");
}
$get("TxtPorDescP").value = formato_numero((Descuento * 100 / Monto), 2, '.', ',');
$get("LblPrecioFinal").innerText = formato_numero(Monto - Descuento, 2, '.', ',');
$get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ',');
var Total = Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", ""));
$get("LblDescuentoAdicional").innerText = formato_numero(Total, 2, '.', ',');
//SUMA EL DESCUENTO YA EXISTENTE AL ORIGINAL
Total = Total + MontoOriginal;
$get("LblDescuento").innerText = formato_numero(Total, 2, '.', ',');
$get("TxtDescuento").value = formato_numero(Total, 2, '.', ',');
$get("HdnDescuento").value = Total;
if (TipoDescuento == 2) {
Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", ""));
}
}
else {
$get("LblPrecioFinal").innerText = "0.00";
$get("LblDescuento").innerText = "0.00";
$get("HdnDescuento").value = "0.00";
$get("LblDescuentoAdicional").innerText = "0.00";
}
}
function BorraDescuentos() { function BorraDescuentos() {
$get("TxtPorDescP").value = "0"; $get("TxtPorDescP").value = "0";
$get("TxtDescP").value = "0"; $get("TxtDescP").value = "0";
@@ -3433,6 +3571,23 @@
$("#LblSubTotal1").text($("#TxtSubTotal").val()); $("#LblSubTotal1").text($("#TxtSubTotal").val());
} }
function AbrirModalDescuentoAdicional()
{
$('#ModalDescuento').modal();
$get('LblTitulo1').style.display = '';
$get('LblTitulo2').style.display = 'none';
$get('LblTituloTipo1').style.display = '';
$get('LblTituloTipo2').style.display = 'none';
$get('HdnTipoDescuento').value = '0';
$get('LblPrecio1').style.display = '';
$get('LblTotalPS1').style.display = 'none';
$get('LblSubTotal1').style.display = 'none';
$get('LblAmort').style.display = 'none';
$get('BtnAplicarDescP').style.display = '';
$get('BtnAplicarDescG').style.display = 'none';
$get('TrMotivoDescuento').style.display = '';
}
function formato_numero(numero, decimales, separador_decimal, separador_miles) { // v2007-08-06 function formato_numero(numero, decimales, separador_decimal, separador_miles) { // v2007-08-06
numero = parseFloat(numero); numero = parseFloat(numero);
if (isNaN(numero)) { if (isNaN(numero)) {

View File

@@ -688,7 +688,7 @@ Partial Class PV
Get Get
Return New Dictionary(Of Integer, Decimal) From { Return New Dictionary(Of Integer, Decimal) From {
{20516, 0.23D}, 'Descuento para lubricantes LTH {20516, 0.23D}, 'Descuento para lubricantes LTH
{20515, 0.24D} 'Descuento para filtros LTH {20515, 0.274D} 'Descuento para filtros LTH
} }
End Get End Get
End Property End Property
@@ -1062,7 +1062,7 @@ Partial Class PV
ViewState("ClienteRetIVA") = 0 ViewState("ClienteRetIVA") = 0
ViewState("ClienteRetISR") = 0 ViewState("ClienteRetISR") = 0
ViewState("EnviarCorreoCliente") = False ViewState("EnviarCorreoCliente") = False
HdnPorcentajeDescuentoMaximo.Value = UsuarioActual.DescuentoAutorizado.ToString() HdnPorcentajeDescuentoMaximo.Value = If(UsuarioActual.DescuentoAutorizado > 0, UsuarioActual.DescuentoAutorizado, 15).ToString()
CveVentaDetalle = -1 CveVentaDetalle = -1
EstablecioFolio = False EstablecioFolio = False
EstatusCliente = False EstatusCliente = False
@@ -1113,7 +1113,19 @@ Partial Class PV
LblUsuario.Text = UsuarioActual.Usuario LblUsuario.Text = UsuarioActual.Usuario
TxtCantidad.Attributes.Add("onKeyUp ", "Recalcula();") TxtCantidad.Attributes.Add("onKeyUp ", "Recalcula();")
TxtPrecio.Attributes.Add("onKeyUp ", "Recalcula();") TxtPrecio.Attributes.Add("onKeyUp ", "Recalcula();")
ImgDescPU.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 = '0'; $get('LblPrecio1').style.display = ''; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = ''; $get('BtnAplicarDescG').style.display = 'none'; $get('TrMotivoDescuento').style.display = '';")
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
ImgDescPU.Attributes.Add("onclick", "javascript:AbrirModalDescuentoAdicional();")
TxtPorDescP.Attributes.Add("onKeyUp", "CalculaDescuentoAdicional();")
TxtDescP.Attributes.Add("onKeyUp", "CalculaDescuentoMontoAdicional();")
TrDescuentoIncluido.Visible = True
TrDescuentoAdicional.Visible = True
Else
ImgDescPU.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 = '0'; $get('LblPrecio1').style.display = ''; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = ''; $get('BtnAplicarDescG').style.display = 'none'; $get('TrMotivoDescuento').style.display = '';")
TxtPorDescP.Attributes.Add("onKeyUp", "CalculaDescuento();")
TxtDescP.Attributes.Add("onKeyUp", "CalculaDescuentoMonto();")
End If
'ImgDescConcepto.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 = '1'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = ''; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = ''; $get('BtnAplicarDescG').style.display = 'none'; $get('TrMotivoDescuento').style.display = '';") 'ImgDescConcepto.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 = '1'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = ''; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = ''; $get('BtnAplicarDescG').style.display = 'none'; $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 = '';") '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 = '';")
ImgOtrosConceptos.Attributes.Add("onclick", "javascript:$('#ModalOtrosConceptos').modal();") ImgOtrosConceptos.Attributes.Add("onclick", "javascript:$('#ModalOtrosConceptos').modal();")
@@ -1131,8 +1143,8 @@ Partial Class PV
'ImgCerrarTerminoCorte.Attributes.Add("OnClick", "$('#DivTerminarCorte').hide();") 'ImgCerrarTerminoCorte.Attributes.Add("OnClick", "$('#DivTerminarCorte').hide();")
'ImgCerrarIE.Attributes.Add("OnClick", "$('#DivIngresoEgreso').hide();") 'ImgCerrarIE.Attributes.Add("OnClick", "$('#DivIngresoEgreso').hide();")
'ImgCerrarEstadoCaja.Attributes.Add("OnClick", "$('#DivEstadoCaja').hide();") 'ImgCerrarEstadoCaja.Attributes.Add("OnClick", "$('#DivEstadoCaja').hide();")
TxtPorDescP.Attributes.Add("onKeyUp", "CalculaDescuento();")
TxtDescP.Attributes.Add("onKeyUp", "CalculaDescuentoMonto();")
'TxtFechaAjuste.Attributes.Add("onchange", "CalculaMesesUso();") 'TxtFechaAjuste.Attributes.Add("onchange", "CalculaMesesUso();")
CreaDTmpC() CreaDTmpC()
@@ -1922,7 +1934,7 @@ Partial Class PV
For Each Row As DataRow In TmpDT.FiltraParametros("EliminarDB = False").Rows For Each Row As DataRow In TmpDT.FiltraParametros("EliminarDB = False").Rows
Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString.ToEntero() Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString.ToEntero()
If CveVentaDetalle > 0 Then If CveVentaDetalle > 0 Then
If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString.ToEntero, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDecimal, Row("PU").ToString.ToDecimal(), Row("ImporteIEPS").ToString.ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), Row("ImporteIVA").ToString.ToDecimal(), Row("PorcentajeIVA").ToString().ToDecimal(), Row("Obs").ToString, UsuarioActual.CveUsuario) Then If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString.ToEntero, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDecimal, Row("PU").ToString.ToDecimal(), Row("ImporteIEPS").ToString.ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), Row("ImporteIVA").ToString.ToDecimal(), Row("PorcentajeIVA").ToString().ToDecimal(), Row("Descuento").ToString().ToDecimal(), Row("Obs").ToString, UsuarioActual.CveUsuario) Then
OcurrioError = True OcurrioError = True
Exit For Exit For
End If End If
@@ -4049,6 +4061,14 @@ Partial Class PV
TxtDescuento.Text = (PrecioSugerido * ClasificacionesDescuentos(drPS("CveClasificacion").ToString.ToEntero)).ToString("F2") TxtDescuento.Text = (PrecioSugerido * ClasificacionesDescuentos(drPS("CveClasificacion").ToString.ToEntero)).ToString("F2")
End If End If
HdnDescuentoOriginal.Value = TxtDescuento.Text.ToDecimal().ToString()
LblDescuentoIncluido.Text = TxtDescuento.Text.ToDecimal().FormatoNumero(2)
If PrecioSugerido > 0 AndAlso TxtDescuento.Text.ToDecimal() > 0 Then
TxtPrecio.Text = PrecioSugerido.FormatoNumero()
RegistraScript("$get('LblPrecio1').innerText = formato_numero(" + PrecioSugerido.ToString() + ", 2, '.', ',');", "A1")
End If
If ChkAjuste.Checked Then If ChkAjuste.Checked Then
CalculaMesesUso() CalculaMesesUso()
UpAjuste.Update() UpAjuste.Update()
@@ -4072,6 +4092,7 @@ Partial Class PV
UpPS.Update() UpPS.Update()
UpUnidadMedida.Update() UpUnidadMedida.Update()
UpAddVenta.Update() UpAddVenta.Update()
UPPDescuento.Update()
End Sub End Sub
Protected Sub DdlPS_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DdlPS.selectedindexchange Protected Sub DdlPS_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DdlPS.selectedindexchange
DdlPSIndexChange(DdlPS.SelectedValue.ToEntero, DdlPS) DdlPSIndexChange(DdlPS.SelectedValue.ToEntero, DdlPS)

View File

@@ -280,19 +280,19 @@ Partial Class PopUpBuscarFolio
End Sub End Sub
Private Function ValidarUnFiltroSeleccionado() As Boolean Private Function ValidarUnFiltroSeleccionado() As Boolean
If DdlClasificacion.SelectedValue.ToEntero > 0 Then Return True 'If DdlClasificacion.SelectedValue.ToEntero > 0 Then Return True
If DdlTipoDocto.SelectedValue <> "-1" Then Return True 'If DdlTipoDocto.SelectedValue <> "-1" Then Return True
If DdlSubProyecto.SelectedValue.ToEntero > 0 Then Return True 'If DdlSubProyecto.SelectedValue.ToEntero > 0 Then Return True
If DdlEstatusFactura.SelectedValue.ToEntero > 0 Then Return True 'If DdlEstatusFactura.SelectedValue.ToEntero > 0 Then Return True
If DdlUsuario.SelectedValue.ToEntero > 0 Then Return True 'If DdlUsuario.SelectedValue.ToEntero > 0 Then Return True
If DdlPS.SelectedValue.ToEntero > 0 Then Return True 'If DdlPS.SelectedValue.ToEntero > 0 Then Return True
If TxtFolio.Text.Trim.Length > 0 Then Return True 'If TxtFolio.Text.Trim.Length > 0 Then Return True
If DdlNombre.SelectedValue.ToEntero > 0 Then Return True 'If DdlNombre.SelectedValue.ToEntero > 0 Then Return True
If TxtFolioFiscal.Text.Trim.Length > 0 Then Return True 'If TxtFolioFiscal.Text.Trim.Length > 0 Then Return True
If TxtPedidoContrato.Text.Length > 0 Then Return True 'If TxtPedidoContrato.Text.Length > 0 Then Return True
If TxtOrdenCompra.Text.Length > 0 Then Return True 'If TxtOrdenCompra.Text.Length > 0 Then Return True
Return False Return True
End Function End Function
End Class End Class

View File

@@ -211,6 +211,44 @@
</div> </div>
<div class="row" id="divBitacora" runat="server" visible="false">
<asp:UpdatePanel runat="server" ID="UpHistorialModificacion" UpdateMode="Conditional">
<ContentTemplate>
<div class="col-md-12">
<div class="portlet light bordered xspadding">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Historial de Modificación</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
</div>
<div class="portlet-body">
<asp:GridView ID="GvBitacora" runat="server" GridLines="None" Width="100%" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" CellSpacing="0" AutoGenerateColumns="False">
<Columns>
<asp:TemplateField HeaderText="Fecha" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ConceptoHistorialBitacora" HeaderText="Campo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Anterior" HeaderText="Anterior" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Actual" HeaderText="Actual" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" />
</Columns>
</asp:GridView>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<table width="100%"> <table width="100%">
<tr> <tr>
<td align="center"> <td align="center">

View File

@@ -17,6 +17,16 @@ Partial Class Ventas_Promociones
ViewState("TempDT") = value ViewState("TempDT") = value
End Set End Set
End Property End Property
Private Property TempDTOrigial As DataTable
Get
Return CType(ViewState("TempDTOrigial"), DataTable)
End Get
Set(value As DataTable)
ViewState("TempDTOrigial") = value
End Set
End Property
Private Property CvePromocion As Integer Private Property CvePromocion As Integer
Get Get
Return ViewState("CvePromocion").ToString.ToEntero Return ViewState("CvePromocion").ToString.ToEntero
@@ -46,6 +56,7 @@ Partial Class Ventas_Promociones
#End Region #End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then If Not Page.IsPostBack Then
CvePromocion = -1 CvePromocion = -1
CargaValoresIniciales() CargaValoresIniciales()
@@ -53,16 +64,46 @@ Partial Class Ventas_Promociones
If Request("CvePromocion") IsNot Nothing AndAlso Request("CvePromocion").ToString.ToEntero > 0 Then If Request("CvePromocion") IsNot Nothing AndAlso Request("CvePromocion").ToString.ToEntero > 0 Then
CvePromocion = Request("CvePromocion").ToString.ToEntero CvePromocion = Request("CvePromocion").ToString.ToEntero
CargaDatos() CargaDatos()
Else Else
ChkEstatus.Enabled = True ChkEstatus.Enabled = True
ChkEstatus.Checked = True ChkEstatus.Checked = True
CreaDT() CreaDT()
End If End If
CargaGvBitacora()
End If End If
End Sub End Sub
#Region "BITACORA"
Private Sub CargaGvBitacora()
If CvePromocion > 0 Then
divBitacora.Visible = True
Dim ObjGral As New ClsGenerales()
If ObjGral.GetHistorialBitacora(-1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa, CvePromocion:=CvePromocion) Then
GvBitacora.DataSource = ObjGral.DtResultados
End If
ObjGral.Dispose()
GvBitacora.DataBind()
UpHistorialModificacion.Update()
Else
divBitacora.Visible = False
End If
End Sub
#End Region
#Region " VALORES INICIALES " #Region " VALORES INICIALES "
Private Sub CargaValoresIniciales() Private Sub CargaValoresIniciales()
@@ -148,6 +189,32 @@ Partial Class Ventas_Promociones
TempDT.Columns.Add("AplicaDomingo", GetType(Boolean)) TempDT.Columns.Add("AplicaDomingo", GetType(Boolean))
TempDT.Columns.Add("IncluyeImpuestos", GetType(Boolean)) TempDT.Columns.Add("IncluyeImpuestos", GetType(Boolean))
TempDTOrigial = TempDT.Copy
'366 Estatus
'367 CvePS
'368 PUPromocion
'369 CveTipoPromocion
'370 Cantidad Minima
'371 AplicaRestriccion
'372 HoraInicio
'373 HoraFin
'374 AplicaLunes
'375 AplicaMartes
'376 AplicaMiercoles
'377 AplicaJueves
'378 AplicaViernes
'379 AplicaSabado
'380 AplicaDomingo
'381 IncluyeImpuestos
End Sub End Sub
#Region " PS " #Region " PS "
@@ -197,7 +264,8 @@ Partial Class Ventas_Promociones
DdlTipoAplicacion.SelectedValueExist(Dr("TipoAplicacion").ToString) DdlTipoAplicacion.SelectedValueExist(Dr("TipoAplicacion").ToString)
If ObjVentas.GetPromocionesDetalle(CvePromocion, UsuarioActual.CveEmpresa) Then If ObjVentas.GetPromocionesDetalle(CvePromocion, UsuarioActual.CveEmpresa) Then
TempDT = ObjVentas.DtResultados TempDT = ObjVentas.DtResultados.Copy
TempDTOrigial = ObjVentas.DtResultados.Copy
CargaGrid() CargaGrid()
Else Else
Alert("Ocurrió un error al consultar los detalles de la promoción. Por favor vuelva a intentar.", TipoMensaje.MsgError) Alert("Ocurrió un error al consultar los detalles de la promoción. Por favor vuelva a intentar.", TipoMensaje.MsgError)
@@ -324,6 +392,9 @@ Partial Class Ventas_Promociones
Dr("AplicaDomingo") = False Dr("AplicaDomingo") = False
End If End If
Dr("IncluyeImpuestos") = ChkIncluyeImpuesto.Checked
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
Dr("CveRinTamaño") = DdlRin.SelectedValue.ToEntero Dr("CveRinTamaño") = DdlRin.SelectedValue.ToEntero
Else Else
@@ -456,9 +527,12 @@ Partial Class Ventas_Promociones
Dim CveCliente As Integer = If(DdlClientes.SelectedValue = "", -1, DdlClientes.SelectedValue.ToEntero) Dim CveCliente As Integer = If(DdlClientes.SelectedValue = "", -1, DdlClientes.SelectedValue.ToEntero)
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
Dim TieneError = False Dim TieneError = False
ObjVentas.IniciaTransacSQL() ObjVentas.IniciaTransacSQL()
Dim ObjGral As New ClsGenerales(ObjVentas.IniciaTransacSQL)
If ObjVentas.UpdatePromociones(TxtPromocion.Text.Trim, If(IsDate(TxtFechaI.Text), TxtFechaI.Text.ToDate, MinFecha), If(IsDate(TxtFechaF.Text), TxtFechaF.Text.ToDate, MaxFecha), If ObjVentas.UpdatePromociones(TxtPromocion.Text.Trim, If(IsDate(TxtFechaI.Text), TxtFechaI.Text.ToDate, MinFecha), If(IsDate(TxtFechaF.Text), TxtFechaF.Text.ToDate, MaxFecha),
DdlVendedor.SelectedValue.ToEntero, CveCliente, ChkEstatus.Checked, DdlMoneda.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlVendedor.SelectedValue.ToEntero, CveCliente, ChkEstatus.Checked, DdlMoneda.SelectedValue.ToEntero, UsuarioActual.CveUsuario,
CvePromocion, DdlSubProyecto.SelectedValue.ToEntero, DdlTipoAplicacion.SELECTEDVALUE.TOENTERO, UsuarioActual.CveEmpresa, CveMarca:=DdlMarca.SelectedValue.ToEntero) Then CvePromocion, DdlSubProyecto.SelectedValue.ToEntero, DdlTipoAplicacion.SELECTEDVALUE.TOENTERO, UsuarioActual.CveEmpresa, CveMarca:=DdlMarca.SelectedValue.ToEntero) Then
@@ -470,6 +544,18 @@ Partial Class Ventas_Promociones
TieneError = True TieneError = True
Exit For Exit For
End If End If
If Not TieneError Then
If Not ObjGral.AddHistorialBitacora(364, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, "", Dr("CodigoPS").ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
Next Next
If Not TieneError Then If Not TieneError Then
@@ -480,6 +566,171 @@ Partial Class Ventas_Promociones
TieneError = True TieneError = True
Exit For Exit For
End If End If
If Not TieneError Then
'366 Estatus
'367 CvePS
'368 PUPromocion
'369 CveTipoPromocion
'370 Cantidad Minima
'371 AplicaRestriccion
'372 HoraInicio
'373 HoraFin
'374 AplicaLunes
'375 AplicaMartes
'376 AplicaMiercoles
'377 AplicaJueves
'378 AplicaViernes
'379 AplicaSabado
'380 AplicaDomingo
'381 IncluyeImpuestos
Dim Dr2 As DataRow = TempDTOrigial.FiltraParametros($"CvePromocionDetalle = {Dr("CvePromocionDetalle").ToString}").Rows(0)
If Not TieneError And Dr("CvePS").ToString <> Dr2("CvePS").ToString Then
If Not ObjGral.AddHistorialBitacora(367, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr("CodigoPS").ToString, Dr2("CodigoPS").ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
If Not TieneError And Dr("CveTipoPromocion").ToString <> Dr2("CveTipoPromocion").ToString Then
If Not ObjGral.AddHistorialBitacora(369, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr("TipoPromocion").ToString, $"{Dr("CodigoPS").ToString} - {Dr2("TipoPromocion").ToString}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
If Not TieneError And Dr("CantidadMinima").ToString <> Dr2("CantidadMinima").ToString Then
If Not ObjGral.AddHistorialBitacora(370, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr("CantidadMinima").ToString, $"{Dr("CodigoPS").ToString} - {Dr2("CantidadMinima").ToString}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
'If Not TieneError And Dr("AplicaRestriccion").ToString <> Dr2("AplicaRestriccion").ToString Then
' If Not ObjGral.AddHistorialBitacora(371, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr2("AplicaRestriccion").ToString, $"{Dr("CodigoPS").ToString} - {Dr("AplicaRestriccion").ToString}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
' TieneError = True
' Exit For
' End If
'End If
If Not TieneError And Dr("HoraInicio").ToString <> Dr2("HoraInicio").ToString Then
If Not ObjGral.AddHistorialBitacora(372, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr("HoraInicio").ToString, $"{Dr("CodigoPS").ToString} - {Dr2("HoraInicio").ToString}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
If Not TieneError And Dr("HoraFin").ToString <> Dr2("HoraFin").ToString Then
If Not ObjGral.AddHistorialBitacora(373, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr("HoraFin").ToString, $"{Dr("CodigoPS").ToString} - {Dr2("HoraFin").ToString}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
If Not TieneError And Dr("AplicaLunes").ToString <> Dr2("AplicaLunes").ToString Then
Dim EstadoAnterior As String = If(Boolean.Parse(Dr2("AplicaLunes").ToString), "Aplica", "No aplica")
Dim EstadoActual As String = If(Boolean.Parse(Dr("AplicaLunes").ToString), "Aplica", "No aplica")
If Not ObjGral.AddHistorialBitacora(374, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, EstadoActual, $"{Dr("CodigoPS").ToString} - { EstadoAnterior }", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
If Not TieneError And Dr("AplicaMartes").ToString <> Dr2("AplicaMartes").ToString Then
Dim EstadoAnterior As String = If(Boolean.Parse(Dr2("AplicaMartes").ToString), "Aplica", "No aplica")
Dim EstadoActual As String = If(Boolean.Parse(Dr("AplicaMartes").ToString), "Aplica", "No aplica")
If Not ObjGral.AddHistorialBitacora(375, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, EstadoActual, $"{Dr("CodigoPS").ToString} - { EstadoAnterior }", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
If Not TieneError And Dr("AplicaMiercoles").ToString <> Dr2("AplicaMiercoles").ToString Then
Dim EstadoAnterior As String = If(Boolean.Parse(Dr2("AplicaMiercoles").ToString), "Aplica", "No aplica")
Dim EstadoActual As String = If(Boolean.Parse(Dr("AplicaMiercoles").ToString), "Aplica", "No aplica")
If Not ObjGral.AddHistorialBitacora(376, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, EstadoActual, $"{Dr("CodigoPS").ToString} - { EstadoAnterior }", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
If Not TieneError And Dr("AplicaJueves").ToString <> Dr2("AplicaJueves").ToString Then
Dim EstadoAnterior As String = If(Boolean.Parse(Dr2("AplicaJueves").ToString), "Aplica", "No aplica")
Dim EstadoActual As String = If(Boolean.Parse(Dr("AplicaJueves").ToString), "Aplica", "No aplica")
If Not ObjGral.AddHistorialBitacora(377, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, EstadoActual, $"{Dr("CodigoPS").ToString} - { EstadoAnterior }", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
If Not TieneError And Dr("AplicaViernes").ToString <> Dr2("AplicaViernes").ToString Then
Dim EstadoAnterior As String = If(Boolean.Parse(Dr2("AplicaViernes").ToString), "Aplica", "No aplica")
Dim EstadoActual As String = If(Boolean.Parse(Dr("AplicaViernes").ToString), "Aplica", "No aplica")
If Not ObjGral.AddHistorialBitacora(378, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, EstadoActual, $"{Dr("CodigoPS").ToString} - { EstadoAnterior }", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
If Not TieneError And Dr("AplicaSabado").ToString <> Dr2("AplicaSabado").ToString Then
Dim EstadoAnterior As String = If(Boolean.Parse(Dr2("AplicaSabado").ToString), "Aplica", "No aplica")
Dim EstadoActual As String = If(Boolean.Parse(Dr("AplicaSabado").ToString), "Aplica", "No aplica")
If Not ObjGral.AddHistorialBitacora(379, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, EstadoActual, $"{Dr("CodigoPS").ToString} - { EstadoAnterior }", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
If Not TieneError And Dr("AplicaDomingo").ToString <> Dr2("AplicaDomingo").ToString Then
Dim EstadoAnterior As String = If(Boolean.Parse(Dr2("AplicaDomingo").ToString), "Aplica", "No aplica")
Dim EstadoActual As String = If(Boolean.Parse(Dr("AplicaDomingo").ToString), "Aplica", "No aplica")
If Not ObjGral.AddHistorialBitacora(380, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, EstadoActual, $"{Dr("CodigoPS").ToString} - { EstadoAnterior }", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
If Not TieneError And Dr("IncluyeImpuestos").ToString <> Dr2("IncluyeImpuestos").ToString Then
Dim EstadoAnterior As String = If(Boolean.Parse(Dr2("IncluyeImpuestos").ToString), "Incluye", "No Incluye")
Dim EstadoActual As String = If(Boolean.Parse(Dr("IncluyeImpuestos").ToString), "Incluye", "No Incluye")
If Not ObjGral.AddHistorialBitacora(381, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, EstadoActual, $"{Dr("CodigoPS").ToString} - { EstadoAnterior }", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
End If
Next Next
End If End If
@@ -489,6 +740,16 @@ Partial Class Ventas_Promociones
TieneError = True TieneError = True
Exit For Exit For
End If End If
If Not TieneError Then
If Not ObjGral.AddHistorialBitacora(365, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, "", Dr("CodigoPS").ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
Next Next
End If End If
@@ -511,6 +772,7 @@ Partial Class Ventas_Promociones
#Region " ELIMINAR " #Region " ELIMINAR "
Protected Sub BtnEliminar_Click(sender As Object, e As EventArgs) Protected Sub BtnEliminar_Click(sender As Object, e As EventArgs)
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
ObjVentas.IniciaTransacSQL() ObjVentas.IniciaTransacSQL()
Dim TieneError = False Dim TieneError = False
@@ -541,4 +803,13 @@ Partial Class Ventas_Promociones
' DivCantMinima.Visible = False ' DivCantMinima.Visible = False
' End If ' End If
'End Sub 'End Sub
End Class End Class

View File

@@ -223,24 +223,32 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
//sb.AppendFormat("{0} <br/>", respCancelacion.Mensaje); //sb.AppendFormat("{0} <br/>", respCancelacion.Mensaje);
if (!respCancelacion.HuboError) if (!respCancelacion.HuboError)
{ {
retorno.EnviarAcuse = true; if (respCancelacion.CveEstatus > 0)
CveEstatus = respCancelacion.CveEstatus;
var ObjVentas = new ClsVentas();
if (ObjVentas.UpdateEstatusVenta(CveVenta, CveEstatus, UsuarioActual.CveEmpresa))
{ {
sb.Append("El estatus de la factura fue cambiado a 'Cancelada'."); retorno.EnviarAcuse = true;
CveEstatus = respCancelacion.CveEstatus;
var ObjVentas = new ClsVentas();
if (ObjVentas.UpdateEstatusVenta(CveVenta, CveEstatus, UsuarioActual.CveEmpresa))
{
sb.Append("El estatus de la factura fue cambiado a 'Cancelada'.");
}
else
{
sb.Append("Ocurrió un error al cambiar el estatus de la factura.");
}
ObjVentas.Dispose();
sb.Append("El documento se canceló correctamente.");
sb.Append($"</br> <a href='/Compras/PopUpVerFactura.aspx?P={Encripta($"OP=CAN&CVEVTA={CveVenta}")}' class='Texto' target='_blank'>Imprimir Acuse</a>");
if (!EsRefacturacion)
{
sb.Append("</br></br> ¿Desea enviar el Acuse de Cancelación al Cliente?");
}
} }
else else
{ {
sb.Append("Ocurrió un error al cambiar el estatus de la factura."); sb.Append(respCancelacion.Mensaje);
}
ObjVentas.Dispose();
sb.Append("El documento se canceló correctamente.");
sb.Append($"</br> <a href='/Compras/PopUpVerFactura.aspx?P={Encripta($"OP=CAN&CVEVTA={CveVenta}")}' class='Texto' target='_blank'>Imprimir Acuse</a>");
if (!EsRefacturacion)
{
sb.Append("</br></br> ¿Desea enviar el Acuse de Cancelación al Cliente?");
} }
} }
if (respCancelacion.CveEstatus.Contiene(4, 5) && EsRefacturacion) if (respCancelacion.CveEstatus.Contiene(4, 5) && EsRefacturacion)

View File

@@ -154,6 +154,10 @@ Partial Class Ventas_RepVentasUtilidadDetalle
DdlPS.ddl.Items.Insert(0, New ListItem("Todos", "-1")) DdlPS.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
End If End If
DdlMarcas.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
DdlMarcas.DataBind()
DdlMarcas.Items.Insert(0, New ListItem("Todas", "-1"))
'Cargo Clasificaciones 'Cargo Clasificaciones
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
DdlClasificacion.DataBind() DdlClasificacion.DataBind()

View File

@@ -2628,6 +2628,10 @@ Partial Class Ventas
'DdlEstatus.Enabled = False 'DdlEstatus.Enabled = False
End If End If
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
LnkAgregarCliente.Visible = True
End If
End If End If
CargaEstatusFactura(Opcion) CargaEstatusFactura(Opcion)
@@ -3267,7 +3271,12 @@ Partial Class Ventas
If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, CveCliente, -1, 1) Then If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, CveCliente, -1, 1) Then
If ObjContratos.DtResultados.FiltraParametros("Estatus = True").Rows.Count > 0 AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ped") Or DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev")) Then If ObjContratos.DtResultados.FiltraParametros("Estatus = True").Rows.Count > 0 AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ped") Or DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev")) Then
DtContratos = ObjContratos.DtResultados.FiltraParametros($"Estatus = True AND FechaFinal >= '{Now.ToShortDateString}' AND FechaInicial <= '{Now.ToShortDateString}'") If UsuarioActual.CveEmpresa.Contiene(72, 80) Then
DtContratos = ObjContratos.DtResultados.FiltraParametros($"Estatus = True AND FechaFinal >= '{Now.ToShortDateString}' AND FechaInicial <= '{Now.ToShortDateString}'")
Else
DtContratos = ObjContratos.DtResultados.FiltraParametros($"Estatus = True ")
End If
If AfterPageLoad Then If AfterPageLoad Then
RegistraScript("window.onload = function MuestraContratos() { document.getElementById(""C_BtnMostrarContrato"").click(); }") RegistraScript("window.onload = function MuestraContratos() { document.getElementById(""C_BtnMostrarContrato"").click(); }")
@@ -5632,7 +5641,7 @@ Partial Class Ventas
ViewState("ClienteRetIVA") = ObjCliente.RetIVA / 100 ViewState("ClienteRetIVA") = ObjCliente.RetIVA / 100
ViewState("ClienteRetISR") = ObjCliente.RetISR / 100 ViewState("ClienteRetISR") = ObjCliente.RetISR / 100
If CveVenta <= 0 Then If CveVenta <= 0 OrElse EsCreaApartirDe Then
DdlTipoRetencion.SelectedValueExist(ObjCliente.DtResultados(0)("CveTipoRetencion").ToString()) DdlTipoRetencion.SelectedValueExist(ObjCliente.DtResultados(0)("CveTipoRetencion").ToString())
DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty) DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty)
@@ -7689,13 +7698,7 @@ Partial Class Ventas
Dim CveProducto As Integer Dim CveProducto As Integer
Dim Existencia As Double Dim Existencia As Double
Dim CveAlmacen = ddlAlmacen.SelectedValue.ToEntero() Dim CveAlmacen = ddlAlmacen.SelectedValue.ToEntero()
For Each dr As DataRow In TmpDT.Rows For Each dr As DataRow In TmpDT.FiltraParametros("CveTipoPS = 2").Rows
'SI ES SERVICIO NO VALIDA
'GlobalDTProductosServicios
If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=dr("CvePS").ToString().ToEntero()).FiltroPrimeroValor("CveTipoPS").ToString().ToEntero() = 1 Then
Continue For
End If
If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False Then If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False Then
'VALIDA EXISTENCIA 'VALIDA EXISTENCIA
@@ -8257,7 +8260,7 @@ Partial Class Ventas
For Each Row As DataRow In DtMovDetalles.Rows For Each Row As DataRow In DtMovDetalles.Rows
Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal() Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal()
Dim SaldoAlmacen As Decimal = Row("SaldoAlmacen").ToString().ToDecimal() Dim SaldoAlmacen As Decimal = Row("SaldoAlmacen").ToString().ToDecimal()
Cantidad += Cantidad CantidadTotal += Cantidad
If SaldoAlmacen < 0 AndAlso Cantidad = Math.Abs(SaldoAlmacen) Then If SaldoAlmacen < 0 AndAlso Cantidad = Math.Abs(SaldoAlmacen) Then
TotalSalida += Math.Abs(SaldoAlmacen) TotalSalida += Math.Abs(SaldoAlmacen)
@@ -8268,7 +8271,7 @@ Partial Class Ventas
Next Next
'SI SE VERIFICA QUE TODO ESTA SURTIDO, SE MARCA TODA LA FACTURA 'SI SE VERIFICA QUE TODO ESTA SURTIDO, SE MARCA TODA LA FACTURA
If CantidadTotal = Total Then If CantidadTotal = TotalSalida Then
If Not ObjInventario.ActualizarEsDevolucionVenta(ObjFactura.CveVenta, 2) Then If Not ObjInventario.ActualizarEsDevolucionVenta(ObjFactura.CveVenta, 2) Then
ErrorList.Add("No se pudo Cancelar el movimiento de almacen de la Factura") ErrorList.Add("No se pudo Cancelar el movimiento de almacen de la Factura")
End If End If
@@ -8474,10 +8477,10 @@ Partial Class Ventas
If AutoConta Then If AutoConta Then
If idCuentaContabilizacion > 0 Then If idCuentaContabilizacion > 0 Then
If ObjConta.ContabilizarPrePoliza(ObjFactura.CvePrePoliza, ObjFactura.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then If ObjConta.ContabilizarPrePoliza(ObjFactura.CvePrePoliza, ObjFactura.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
Else Else
Alert("Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError) Alert("Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError)
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
End If End If
Else Else
Alert(String.Format("Falta asignación de las siguientes cuentas contables: {0}", CuentasContablesInvalidas), TipoMensaje.MsgAdvertencia) Alert(String.Format("Falta asignación de las siguientes cuentas contables: {0}", CuentasContablesInvalidas), TipoMensaje.MsgAdvertencia)
@@ -8485,7 +8488,7 @@ Partial Class Ventas
End If End If
End If End If
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
'If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack() 'If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
'RMF, cuando es pedido, se manda autorización. 'RMF, cuando es pedido, se manda autorización.
@@ -10695,7 +10698,7 @@ Partial Class Ventas
.CuentaPredial = drr("CuentaPredial").ToString(), .CuentaPredial = drr("CuentaPredial").ToString(),
.ImporteGravaIVAAdicional = drr("ImporteIEPS").ToString().ToDecimal} .ImporteGravaIVAAdicional = drr("ImporteIEPS").ToString().ToDecimal}
'verifica suma subtotales 'verifica suma subtotales
If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'proceso de ajusta de decimales If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal.RoundSQL(2) <> concepto.Importe.RoundSQL(2) AndAlso Math.Abs(totSubTotal.RoundSQL(2) - concepto.Importe.RoundSQL(2)) <= 0.01 Then 'proceso de ajusta de decimales
concepto.Importe = totSubTotal concepto.Importe = totSubTotal
End If End If
totSubTotal = totSubTotal - concepto.Importe totSubTotal = totSubTotal - concepto.Importe
@@ -10705,19 +10708,19 @@ Partial Class Ventas
'si es ingreso amortizado por la totalidad, y arroja el valor total de cero, no debe de impuestos, y si la BASE de calculo es mayor a cero 'si es ingreso amortizado por la totalidad, y arroja el valor total de cero, no debe de impuestos, y si la BASE de calculo es mayor a cero
If Timbre.Comprobante.Total > 0 AndAlso concepto.Importe - concepto.Descuento + concepto.ImporteGravaIVAAdicional > 0 Then If Timbre.Comprobante.Total > 0 AndAlso concepto.Importe - concepto.Descuento + concepto.ImporteGravaIVAAdicional > 0 Then
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento + concepto.ImporteGravaIVAAdicional, .TasaOCuota = drr("PorcentajeIVA").ToString().ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString().ToDecimal}) concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = (concepto.Importe - concepto.Descuento + concepto.ImporteGravaIVAAdicional).RoundSQL(6), .TasaOCuota = drr("PorcentajeIVA").ToString().ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString().ToDecimal})
End If End If
If drr("ImporteIEPS").ToString().ToDouble > 0 Then If drr("ImporteIEPS").ToString().ToDouble > 0 Then
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIEPS").ToString().ToDecimal, .Impuesto = "003", .Importe = drr("ImporteIEPS").ToString().ToDecimal}) concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = (concepto.Importe - concepto.Descuento).RoundSQL(6), .TasaOCuota = drr("PorcentajeIEPS").ToString().ToDecimal, .Impuesto = "003", .Importe = drr("ImporteIEPS").ToString().ToDecimal})
End If End If
If drr("ImporteRetIVA").ToString().ToDouble > 0 Then 'si hay retenciones If drr("ImporteRetIVA").ToString().ToDouble > 0 Then 'si hay retenciones
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeRetIVA").ToString().ToDecimal, .Impuesto = "002", .Importe = drr("ImporteRetIVA").ToString().ToDecimal}) concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = (concepto.Importe - concepto.Descuento).RoundSQL(6), .TasaOCuota = drr("PorcentajeRetIVA").ToString().ToDecimal, .Impuesto = "002", .Importe = drr("ImporteRetIVA").ToString().ToDecimal})
End If End If
If drr("ImporteRetISR").ToString().ToDouble > 0 Then 'retención de ISR If drr("ImporteRetISR").ToString().ToDouble > 0 Then 'retención de ISR
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeRetISR").ToString().ToDecimal, .Impuesto = "001", .Importe = drr("ImporteRetISR").ToString().ToDecimal}) concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = (concepto.Importe - concepto.Descuento).RoundSQL(6), .TasaOCuota = drr("PorcentajeRetISR").ToString().ToDecimal, .Impuesto = "001", .Importe = drr("ImporteRetISR").ToString().ToDecimal})
End If End If
Timbre.Conceptos.Add(concepto) Timbre.Conceptos.Add(concepto)
@@ -13258,9 +13261,6 @@ Partial Class Ventas
End If End If
Dim ModalidadRefacturacion As Integer = UsuarioActual.Empresa.Funcionalidad(586).ToEntero() Dim ModalidadRefacturacion As Integer = UsuarioActual.Empresa.Funcionalidad(586).ToEntero()
If UsuarioActual.CveUsuario.Contiene(100, 1719) Then
ModalidadRefacturacion = 2
End If
'REFACTURACION CON PAGOS, DEBE CANCELAR SALDOS DEL DOCUMENTO ANTERIOR Y TRASPASAR PAGOS AL NUEVO 'REFACTURACION CON PAGOS, DEBE CANCELAR SALDOS DEL DOCUMENTO ANTERIOR Y TRASPASAR PAGOS AL NUEVO
If ModalidadRefacturacion = 2 AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Ant") AndAlso ObjFactura.NuevaFactura = 1 Then If ModalidadRefacturacion = 2 AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Ant") AndAlso ObjFactura.NuevaFactura = 1 Then
@@ -18966,6 +18966,12 @@ Partial Class Ventas
' rowSurtidos("Surtido").ToString().ToDouble < rowSurtidos("Cantidad").ToString().ToDouble AndAlso (dr("CantidadDisponible").ToString().ToDouble - rowSurtidos("Surtido").ToString().ToDouble > 0 Or dr("Serie").ToString() <> "") ' rowSurtidos("Surtido").ToString().ToDouble < rowSurtidos("Cantidad").ToString().ToDouble AndAlso (dr("CantidadDisponible").ToString().ToDouble - rowSurtidos("Surtido").ToString().ToDouble > 0 Or dr("Serie").ToString() <> "")
If rowSurtidos("Surtido").ToString().ToDecimal < rowSurtidos("Cantidad").ToString().ToDecimal Then If rowSurtidos("Surtido").ToString().ToDecimal < rowSurtidos("Cantidad").ToString().ToDecimal Then
Dim CantidadSurtida As Double = If(dr("CantidadDisponible").ToString().ToDecimal < rowSurtidos("Cantidad").ToString().ToDouble, dr("CantidadDisponible").ToString().ToDecimal, rowSurtidos("Cantidad").ToString().ToDecimal) Dim CantidadSurtida As Double = If(dr("CantidadDisponible").ToString().ToDecimal < rowSurtidos("Cantidad").ToString().ToDouble, dr("CantidadDisponible").ToString().ToDecimal, rowSurtidos("Cantidad").ToString().ToDecimal)
'SI LA CANTIDAD SURTIDA SUPERA LO REQUERIDO, TOMA SOLO LO NECESARIO PARA COMPLETAR
If (rowSurtidos("Surtido").ToString().ToDecimal + CantidadSurtida) > rowSurtidos("Cantidad").ToString().ToDecimal Then
CantidadSurtida = (rowSurtidos("Cantidad").ToString().ToDecimal - rowSurtidos("Surtido").ToString().ToDecimal)
End If
MovDTCuadrados.ImportRow(dr) MovDTCuadrados.ImportRow(dr)
MovDTCuadrados(MovDTCuadrados.Rows.Count - 1)("Cantidad") = CantidadSurtida MovDTCuadrados(MovDTCuadrados.Rows.Count - 1)("Cantidad") = CantidadSurtida
DtRemConceptosSurtidos(Indice)("Surtido") = rowSurtidos("Surtido").ToString().ToDecimal + CantidadSurtida DtRemConceptosSurtidos(Indice)("Surtido") = rowSurtidos("Surtido").ToString().ToDecimal + CantidadSurtida
@@ -19958,6 +19964,9 @@ Partial Class Ventas
sb.Append("Está seguro de cancelar el documento para realizar la refacturación?.") sb.Append("Está seguro de cancelar el documento para realizar la refacturación?.")
End If End If
Else Else
If Not UsuarioActual.Empresa.FacturaProduccion Then
script = "BtnRefacturacionConfirmar();"
End If
sb.Append("<b>No encontrado</b> <br/>") sb.Append("<b>No encontrado</b> <br/>")
End If End If
Else Else
@@ -20211,7 +20220,7 @@ Partial Class Ventas
For Each Row As DataRow In TmpDT.Rows For Each Row As DataRow In TmpDT.Rows
Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString().ToEntero() Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString().ToEntero()
If CveVentaDetalle > 0 Then If CveVentaDetalle > 0 Then
If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString().ToEntero(), Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDecimal, Row("PU").ToString().ToDecimal(), Row("ImporteIEPS").ToString().ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), Row("ImporteIVA").ToString().ToDecimal(), Row("PorcentajeIVA").ToString().ToDecimal(), Row("Obs").ToString(), UsuarioActual.CveUsuario) Then If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString().ToEntero(), Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDecimal, Row("PU").ToString().ToDecimal(), Row("ImporteIEPS").ToString().ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), Row("ImporteIVA").ToString().ToDecimal(), Row("PorcentajeIVA").ToString().ToDecimal(), Row("Descuento").ToString().ToDecimal(), Row("Obs").ToString(), UsuarioActual.CveUsuario) Then
OcurrioError = True OcurrioError = True
Exit For Exit For
End If End If
@@ -26913,7 +26922,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 = (Porcentaje * (TmpDT.SUMD("Total", FiltroStr) - TmpDT.SUMD("Descuento", FiltroStr))) Dim importePuTemp As Decimal = (Porcentaje * (TmpDT.SUMD("TotalImporte", FiltroStr) - TmpDT.SUMD("Descuento", FiltroStr)))
If Not AplicaImpuestosLocales Then If Not AplicaImpuestosLocales Then
importePuTemp = importePuTemp - TotalImpuestosLocalesVentaOriginal importePuTemp = importePuTemp - TotalImpuestosLocalesVentaOriginal
@@ -29767,7 +29776,7 @@ Partial Class Ventas
End If End If
End If End If
ObjCliente.Dispose() ObjCliente.Dispose()
'DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty) DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty)
TrVistaPrevia.Visible = True TrVistaPrevia.Visible = True
TxtFechaVencimientoCotizacion.Text = Now.ToShortDateString TxtFechaVencimientoCotizacion.Text = Now.ToShortDateString
@@ -31158,6 +31167,8 @@ Partial Class Ventas
tClienteRetIVA = 0.04D tClienteRetIVA = 0.04D
ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(RowServicio("EsOutSourcing").ToString()) Then ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(RowServicio("EsOutSourcing").ToString()) Then
tClienteRetIVA = 0.06D tClienteRetIVA = 0.06D
ElseIf DdlTipoRetencion.SelectedValue.Contiene("0") Then
tClienteRetIVA = 0.00D
End If End If
ViewState("ClienteRetIVA") = tClienteRetIVA ViewState("ClienteRetIVA") = tClienteRetIVA
End If End If
@@ -31499,7 +31510,7 @@ Partial Class Ventas
Dim Respuesta As Boolean = False Dim Respuesta As Boolean = False
If EscontratoObra Then If EscontratoObra AndAlso PorAmortizacionAnticipo > 0 Then ' si es contrato de obra y tiene amortización de anticipo
If DdlTipoComprobante.SelectedValue = "Ing" Then If DdlTipoComprobante.SelectedValue = "Ing" Then
@@ -31520,7 +31531,7 @@ Partial Class Ventas
Respuesta = True Respuesta = True
Else Else
Respuesta = False Respuesta = False
Alert("Debe de seleccioanr un importe de amortización.", TipoMensaje.MsgAdvertencia) Alert("Debe de seleccionar un importe de amortización.", TipoMensaje.MsgAdvertencia)
End If End If
Else Else