This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2022-09-05 16:30:09 -07:00
49 changed files with 9295 additions and 1755 deletions

View File

@@ -23,5 +23,7 @@ Public Class CalendarEvent
Public Property CveTipoEvento As Integer
Public Property Importe As Double
Public Property EmpresaCRM As String
Public Property SubProyecto As String
Public Property CveSubProyecto As Integer
End Class

View File

@@ -613,7 +613,7 @@ Public Class ClsMovimientos
'CveAplicaNC
Public Function GetCxPProveedor(CveProveedor As Integer, FechaI As String, FechaF As String, CveUsuarioProgramo As Integer, CveUsuarioRegistro As Integer,
CveUsuarioResponsable As Integer, CveClasificacionProveedor As Integer, CveMoneda As Integer, CveEstatus As Integer, CveProveedorSucursal As Integer, CveAplicaNC As Integer,
Optional FechaVI As String = "-1", Optional FechaVF As String = "-1", Optional CodigoProgramacion As String = "-1") As Boolean
Optional FechaVI As String = "-1", Optional FechaVF As String = "-1", Optional CodigoProgramacion As String = "-1", Optional CveSubProyecto As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Comp_ProveedorCxP")
With SqlAdapter.SelectCommand.Parameters
@@ -631,6 +631,7 @@ Public Class ClsMovimientos
.Add("@FechaVI", SqlDbType.VarChar).Value = FechaVI
.Add("@FechaVF", SqlDbType.VarChar).Value = FechaVF
.Add("@CodigoProgramacion", SqlDbType.VarChar).Value = CodigoProgramacion
.Add("@CveSubProyecto", SqlDbType.SmallInt).Value = CveSubProyecto
End With

View File

@@ -3218,8 +3218,7 @@ Public Class ClsNominas
End Function
Public Function SATSolicitudTimbreIngresosRep(CveEmpresa As Integer, FechaInicio As Date, FechaFin As DateTime, Opcion As Integer) As Boolean
Public Function SATSolicitudTimbreIngresosRep(CveEmpresa As Integer, FechaInicio As Date, FechaFin As DateTime, Opcion As Integer, Vista As Integer) As Boolean
Dim retorno As Boolean = False
Try
@@ -3229,6 +3228,7 @@ Public Class ClsNominas
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
.Add("@FechaFin", SqlDbType.DateTime).Value = FechaFin
.Add("@Opcion", SqlDbType.Int).Value = Opcion
.Add("@Vista", SqlDbType.Int).Value = Vista
End With
SqlAdapter.Fill(Data)

View File

@@ -1853,7 +1853,7 @@ Public Class ClsOIEventos
Return Retorno
End Function
Public Function FinalizaEvento(FechaFin As DateTime, CveEventoEstatus As Integer, Geom As String, CveEvento As Integer) As Boolean
Public Function FinalizaEvento(FechaFin As DateTime, CveEventoEstatus As Integer, Geom As String, CveEvento As Integer, Optional CveOS As Integer = -1, Optional CveUsuario As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OI_EventoFinalizar")
@@ -1863,6 +1863,8 @@ Public Class ClsOIEventos
.Add("@Geom", SqlDbType.VarChar).Value = Geom
.Add("@FechaFin", SqlDbType.DateTime).Value = FechaFin
.Add("@CveEvento", SqlDbType.Int).Value = CveEvento
.Add("@CveOS", SqlDbType.Int).Value = CveOS
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
End With
Try
@@ -2432,12 +2434,13 @@ Public Class ClsOIEventos
Optional CveOS As Integer = -1, Optional CveOC As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveEventoPadre As Integer = -1,
Optional RecurrenciaTipo As Integer = -1, Optional Frecuencia As Integer = -1, Optional DiasSemana As String = "-1", Optional Dia As Integer = -1, Optional Mes As Integer = -1,
Optional RecurrenciaFin As String = "-1", Optional CveTipoEvento As Integer = 2, Optional Importe As Double = -1,
Optional CveEmpresaCRM As Integer = -1, Optional CveContactoCRM As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, Optional CveTipoProcesoCRM As Integer = -1, Optional CveEtapaProcesoCRM As Integer = -1) As Boolean
Optional CveEmpresaCRM As Integer = -1, Optional CveContactoCRM As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, Optional CveTipoProcesoCRM As Integer = -1, Optional CveEtapaProcesoCRM As Integer = -1,
Optional CveSubProyecto As Integer = -1) As Boolean
Dim Retorno As Boolean = False
Retorno = AddEvento(CveTipoEvento, CveAgendaTipo, Asunto, Descripcion, Prioridad, -1, CveUsuarioIng, FechaInicio, FechaFin, -1, -1, "-1", CveUsuarioIng, CveEmpresa, CveActivoFijo, CveIE, CveProspecto, CveCliente, CveOS, CveOC,
CvePersonal, CvePersonal, CveEventoPadre:=CveEventoPadre, RecurrenciaTipo:=RecurrenciaTipo, Frecuencia:=Frecuencia, DiasSemana:=DiasSemana, Dia:=Dia, Mes:=Mes, RecurrenciaFin:=RecurrenciaFin, Importe:=Importe,
CveEmpresaCRM:=CveEmpresaCRM, CveContactoCRM:=CveContactoCRM, CveAcercamientoCRM:=CveAcercamientoCRM, CveTipoProcesoCRM:=CveTipoProcesoCRM, CveEtapaProcesoCRM:=CveEtapaProcesoCRM)
CveEmpresaCRM:=CveEmpresaCRM, CveContactoCRM:=CveContactoCRM, CveAcercamientoCRM:=CveAcercamientoCRM, CveTipoProcesoCRM:=CveTipoProcesoCRM, CveEtapaProcesoCRM:=CveEtapaProcesoCRM, CveSubProyecto:=CveSubProyecto)
Return Retorno
End Function

View File

@@ -5195,6 +5195,7 @@ Public Class ClsPaginas
PaginaDict.Add("/OS/PopUpOS_PS_Especificaciones.aspx".ToUpper(), 135)
PaginaDict.Add("/OS/PopUpMateriales.aspx".ToUpper(), 135)
PaginaDict.Add("/OS/Asignaciones.aspx".ToUpper(), 125)
PaginaDict.Add("/OS/RepServicioDomicilio.aspx".ToUpper(), 1330)
#End Region
'OC
#Region "OC"
@@ -5606,7 +5607,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Contabilidad/OCDetalleAlmacen.aspx".ToUpper(), -1)
PaginaDict.Add("/Agropecuaria/CierreCultivo.aspx".ToUpper(), 1326)
PaginaDict.Add("/Inventarios/RepRSCO.aspx".ToUpper(), 1328)
@@ -5643,6 +5644,9 @@ Public Class ClsPaginas
'ECOMMERCE
PaginaDict.Add("/Ecommerce/Insignias.aspx".ToUpper(), 7002)
@@ -7041,6 +7045,54 @@ Public Class ClsPaginas
Vta.SelloCFDi = "Sin Timbrar"
Vta.SelloSAT = "Sin Timbrar"
#Region "COMERCIO EXTERIOR VARIABLES Y TABLAS"
Dim CETipoOperacion = "", CEClavePedimento As String = "", CEIncoterm As String = "", CEId As String = "", CEMotivoTraslado As String = "", CETipoCambio As String = ""
Dim RCETipoOperacion As String = "", RCEClavePedimento As String = "", RCEIncoterm As String = "", RCEMotivoTraslado As String = ""
Dim CE_DT_Cabecera As New DataTable
CE_DT_Cabecera.Columns.Add("Version")
CE_DT_Cabecera.Columns.Add("MotivoTraslado")
CE_DT_Cabecera.Columns.Add("TipoOperacion")
CE_DT_Cabecera.Columns.Add("ClaveDePedimento")
CE_DT_Cabecera.Columns.Add("CertificadoOrigen")
CE_DT_Cabecera.Columns.Add("Incoterm")
CE_DT_Cabecera.Columns.Add("Subdivision")
CE_DT_Cabecera.Columns.Add("TipoCambioUSD", GetType(Decimal))
CE_DT_Cabecera.Columns.Add("TotalUSD", GetType(Decimal))
Dim CE_DT_Emisor As New DataTable
CE_DT_Emisor.Columns.Add("Calle")
CE_DT_Emisor.Columns.Add("NumeroExterior")
CE_DT_Emisor.Columns.Add("Colonia")
CE_DT_Emisor.Columns.Add("Municipio")
CE_DT_Emisor.Columns.Add("Estado")
CE_DT_Emisor.Columns.Add("Pais")
CE_DT_Emisor.Columns.Add("CodigoPostal")
CE_DT_Emisor.Columns.Add("Tipo", GetType(Integer))
Dim CE_DT_Receptor As New DataTable
Dim CE_DT_Destinatario As New DataTable
CE_DT_Receptor = CE_DT_Emisor.Copy
CE_DT_Destinatario = CE_DT_Emisor.Copy
Dim CE_DT_Mercancias As New DataTable
CE_DT_Mercancias.Columns.Add("NoIdentificacion")
CE_DT_Mercancias.Columns.Add("FraccionArancelaria")
CE_DT_Mercancias.Columns.Add("CantidadAduana")
CE_DT_Mercancias.Columns.Add("UnidadAduana")
CE_DT_Mercancias.Columns.Add("ValorUnitarioAduana", GetType(Decimal))
CE_DT_Mercancias.Columns.Add("ValorDolares", GetType(Decimal))
#End Region
'SI ESTA TIMBRADA - CON XML
If File.Exists(PathXML) AndAlso Vta.Serie <> "VistaPrevia" Then 'Cuando es vista previe y coincide la serie y folio se ponen los datos fiscales
Dim XmlDoc As New System.Xml.XmlDocument
@@ -7077,6 +7129,130 @@ Public Class ClsPaginas
Vta.SelloCFDi = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("SelloCFD").InnerText
Vta.SelloSAT = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("SelloSAT").InnerText
End If
#Region "COMERCIO EXTERIOR LECTURA DATOS XML"
If XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Name = "cce11:ComercioExterior" Then
Dim nRowCECabecera As DataRow = CE_DT_Cabecera.NewRow
CETipoOperacion = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("TipoOperacion").InnerText
CEClavePedimento = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("ClaveDePedimento").InnerText
CEIncoterm = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("Incoterm").InnerText
nRowCECabecera("Version") = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("Version").InnerText
nRowCECabecera("MotivoTraslado") = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("MotivoTraslado").InnerText
nRowCECabecera("TipoOperacion") = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("TipoOperacion").InnerText
nRowCECabecera("ClaveDePedimento") = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("ClaveDePedimento").InnerText
nRowCECabecera("CertificadoOrigen") = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("CertificadoOrigen").InnerText
nRowCECabecera("Incoterm") = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("Incoterm").InnerText
nRowCECabecera("Subdivision") = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("Subdivision").InnerText
nRowCECabecera("TipoCambioUSD") = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("TipoCambioUSD").InnerText.ToDecimal
nRowCECabecera("TotalUSD") = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("TotalUSD").InnerText.ToDecimal
CE_DT_Cabecera.Rows.Add(nRowCECabecera)
Dim nodo As XmlNode = XmlDoc.DocumentElement
Dim VersionCFDI As String = ValorXML(nodo, "version")
Dim cfdVer As String = ""
If VersionCFDI = "3.2" Then
cfdVer = "http://www.sat.gob.mx/cfd/2"
ElseIf VersionCFDI = "3.3" Then
cfdVer = "http://www.sat.gob.mx/cfd/3"
Else ' se considera que es la version 4.0
cfdVer = "http://www.sat.gob.mx/cfd/4"
End If
Dim namespaces As XmlNamespaceManager = New XmlNamespaceManager(XmlDoc.NameTable)
namespaces.AddNamespace("cfdi", cfdVer)
namespaces.AddNamespace("cce11", "http://www.sat.gob.mx/ComercioExterior11")
CEId = ""
Try
CEId = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).SelectSingleNode("//cce11:Destinatario", namespaces).Attributes("NumRegIdTrib").InnerText 'XmlDoc.SelectNodes("//cfdi:Complemento/tfd:TimbreFiscalDigital/cce11:Destinatario")
Catch ex As Exception
End Try
CEMotivoTraslado = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("MotivoTraslado").InnerText
CETipoCambio = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("TipoCambioUSD").InnerText
RCETipoOperacion = GlobalDTTipoOperacion.FiltroPrimeroValor("Descripcion", $"ClaveSATTipoOperacion = '{CETipoOperacion}'")
RCEClavePedimento = GlobalDTClavePedimento.FiltroPrimeroValor("Descripcion", $"ClaveSATPedimento = '{CEClavePedimento}'")
RCEIncoterm = GlobalDTIncoterm.FiltroPrimeroValor("Descripcion", $"ClaveSATIncoterm = '{CEIncoterm}'")
RCEMotivoTraslado = GlobalDTSATMotivoTraslado.FiltroPrimeroValor("MotivoTraslado", $"ClaveSATMotivoTraslado = '{CEMotivoTraslado}'")
Dim CENodosEmisor As XmlNodeList = XmlDoc.DocumentElement.SelectNodes("//cfdi:Complemento/cce11:ComercioExterior/cce11:Emisor", namespaces) 'XmlDoc.SelectNodes("cfdi:Complemento/{0}:Traslados", "")
Dim CENodosReceptor As XmlNodeList = XmlDoc.DocumentElement.SelectNodes("//cfdi:Complemento/cce11:ComercioExterior/cce11:Receptor", namespaces)
Dim CEnodosDestinatario As XmlNodeList = XmlDoc.DocumentElement.SelectNodes("//cfdi:Complemento/cce11:ComercioExterior/cce11:Destinatario", namespaces)
Dim CEnodosMercancias As XmlNodeList = XmlDoc.DocumentElement.SelectNodes("//cfdi:Complemento/cce11:ComercioExterior/cce11:Mercancias", namespaces)
For Each node As XmlNode In CENodosEmisor
Dim nRowEmisor As DataRow = CE_DT_Emisor.NewRow
nRowEmisor("Calle") = ValorNodoXML(node.FirstChild, "Calle")
nRowEmisor("NumeroExterior") = ValorXML(node.FirstChild, "NumeroExterior")
nRowEmisor("Colonia") = ValorXML(node.FirstChild, "Colonia")
nRowEmisor("Municipio") = ValorXML(node.FirstChild, "Municipio")
nRowEmisor("Estado") = ValorXML(node.FirstChild, "Estado")
nRowEmisor("Pais") = ValorXML(node.FirstChild, "Pais")
nRowEmisor("CodigoPostal") = ValorXML(node.FirstChild, "CodigoPostal")
nRowEmisor("Tipo") = 1
CE_DT_Emisor.Rows.Add(nRowEmisor)
Exit For
Next
For Each node As XmlNode In CENodosReceptor
Dim nRowReceptor As DataRow = CE_DT_Receptor.NewRow
nRowReceptor("Calle") = ValorXML(node.FirstChild, "Calle")
nRowReceptor("NumeroExterior") = ValorXML(node.FirstChild, "NumeroExterior")
nRowReceptor("Colonia") = ValorXML(node.FirstChild, "Colonia")
nRowReceptor("Municipio") = ValorXML(node.FirstChild, "Municipio")
nRowReceptor("Estado") = ValorXML(node.FirstChild, "Estado")
nRowReceptor("Pais") = ValorXML(node.FirstChild, "Pais")
nRowReceptor("CodigoPostal") = ValorXML(node.FirstChild, "CodigoPostal")
nRowReceptor("Tipo") = 2
CE_DT_Receptor.Rows.Add(nRowReceptor)
Exit For
Next
For Each node As XmlNode In CEnodosDestinatario
Dim nRowDestinatario As DataRow = CE_DT_Destinatario.NewRow
nRowDestinatario("Calle") = ValorXML(node.FirstChild, "Calle")
nRowDestinatario("NumeroExterior") = ValorXML(node.FirstChild, "NumeroExterior")
nRowDestinatario("Colonia") = ValorXML(node.FirstChild, "Colonia")
nRowDestinatario("Municipio") = ValorXML(node.FirstChild, "Municipio")
nRowDestinatario("Estado") = ValorXML(node.FirstChild, "Estado")
nRowDestinatario("Pais") = ValorXML(node.FirstChild, "Pais")
nRowDestinatario("CodigoPostal") = ValorXML(node.FirstChild, "CodigoPostal")
nRowDestinatario("Tipo") = 3
CE_DT_Destinatario.Rows.Add(nRowDestinatario)
Exit For
Next
For Each node As XmlNode In CEnodosMercancias
Dim nRowMercancias As DataRow = CE_DT_Mercancias.NewRow
nRowMercancias("NoIdentificacion") = ValorXML(node.FirstChild, "NoIdentificacion")
nRowMercancias("FraccionArancelaria") = ValorXML(node.FirstChild, "FraccionArancelaria")
nRowMercancias("CantidadAduana") = ValorXML(node.FirstChild, "CantidadAduana")
nRowMercancias("UnidadAduana") = ValorXML(node.FirstChild, "UnidadAduana")
nRowMercancias("ValorUnitarioAduana") = ValorXML(node.FirstChild, "ValorUnitarioAduana").ToDecimal
nRowMercancias("ValorDolares") = ValorXML(node.FirstChild, "ValorDolares").ToDecimal
CE_DT_Mercancias.Rows.Add(nRowMercancias)
Next
Dim asddd As String = ""
End If
#End Region
Next
End If
@@ -7191,6 +7367,17 @@ Public Class ClsPaginas
Dim params As New List(Of ReportParameter)
If RCETipoOperacion.Trim.Length > 0 Then
params.Add(New ReportParameter("CETipoOperacion", RCETipoOperacion))
params.Add(New ReportParameter("CEClavePedimento", RCEClavePedimento))
params.Add(New ReportParameter("CEIncoterm", RCEIncoterm))
params.Add(New ReportParameter("CEId", CEId))
params.Add(New ReportParameter("CEMotivoTraslado", RCEMotivoTraslado))
params.Add(New ReportParameter("CETipoCamvio", CETipoCambio))
End If
If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
params.Add(New ReportParameter("CFDIVersion", Vta.Version))
If Vta.Cliente.CodigoRegimenFiscal.ToString.Length > 0 Then
@@ -7776,6 +7963,26 @@ Public Class ClsPaginas
Dim rds5 As New ReportDataSource With {.Name = "DataSet5", .Value = If(Vta.DtNCVinculadas IsNot Nothing, Vta.DtNCVinculadas, New DataTable)} ' sino esta creado el objeto, lo creamos, para que no truene el reporte
lrds.Add(rds5)
If RCETipoOperacion.Trim.Length > 0 Then
Dim rds6 As New ReportDataSource With {.Name = "CE_DT_Emisor", .Value = CE_DT_Emisor}
lrds.Add(rds6)
Dim rds7 As New ReportDataSource With {.Name = "CE_DT_Receptor", .Value = CE_DT_Receptor}
lrds.Add(rds7)
Dim rds8 As New ReportDataSource With {.Name = "CE_DT_Destinatario", .Value = CE_DT_Destinatario}
lrds.Add(rds8)
Dim rds9 As New ReportDataSource With {.Name = "CE_DT_Mercancias", .Value = CE_DT_Mercancias}
lrds.Add(rds9)
Dim rds10 As New ReportDataSource With {.Name = "CE_DT_Cabecera", .Value = CE_DT_Cabecera}
lrds.Add(rds10)
End If
If UsuarioActual.CveEmpresa.Contiene(141, 152, 159, 160, 161, 162, 163) AndAlso (RutaFormato.Contains("Factura") Or RutaFormato.Contains("Cotizacion")) Then
params.Add(New ReportParameter("Kilometraje", Vta.Kilometraje.ToString))
End If
@@ -7915,7 +8122,7 @@ Public Class ClsPaginas
Dim payload As New JObject(
New JProperty("formato", Formato),
New JProperty("ruta", RutaReporte),
New JProperty("UsarFormatoCompilado", false),
New JProperty("UsarFormatoCompilado", False),
New JProperty("parametros", paramsArray),
New JProperty("dataSource", dataSourceArray)
)
@@ -9363,8 +9570,7 @@ Public Class ClsPaginas
#Region "P A G O D E C O M P R A S "
Public Function AplicaPrePolizaPago(CompraActual As Compra, Pago As CompraPago, CvePrePoliza As Integer, ByRef ObjConta As ClsContabilidad) As Boolean
Public Function AplicaPrePolizaPagoCompra(CompraActual As Compra, Pago As CompraPago, CvePrePoliza As Integer, ByRef ObjConta As ClsContabilidad) As Boolean
Dim ErrorMovtos As Boolean = False
Dim PorcentajePago As Decimal = Pago.ImportePago / CompraActual.Total
Dim ImporteMovimiento As Decimal = 0
@@ -9470,14 +9676,18 @@ Public Class ClsPaginas
ImporteMovimiento = (PorcentajePago * CompraActual.RetISR).RoundSQL
ImporteMN = (ImporteMovimiento * CompraActual.TC).RoundSQL
If CompraActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento
Dim ContabilizableISR As Boolean = False
If UsuarioActual.CveEmpresa = 140 Then
ContabilizableISR = True
End If
Dim Ret As ConceptosRetenciones = CompraActual.ConceptoPrePolizaRetISR
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, Ret.CveConceptoxAcreditar, CompraActual.SerieFolio, Concepto, Ret.IdCtaContablexAcreditar, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, Ret.CveConceptoxAcreditar, CompraActual.SerieFolio, Concepto, Ret.IdCtaContablexAcreditar, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, Contabilizable:=ContabilizableISR) Then ErrorMovtos = True
'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe
If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * Pago.TCPago).RoundSQL
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, Ret.CveConceptoAcreditable, CompraActual.SerieFolio, Concepto, Ret.IdCtaContableAcreditable, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, Ret.CveConceptoAcreditable, CompraActual.SerieFolio, Concepto, Ret.IdCtaContableAcreditable, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, Contabilizable:=ContabilizableISR) Then ErrorMovtos = True
End If
@@ -9509,15 +9719,17 @@ Public Class ClsPaginas
If Not ErrorMovtos AndAlso ImporteMovimiento <> 0 Then
Dim tOtCveCon As Integer = 211
Dim tOtTipoMovto As Boolean = False
Dim IdCta As Integer = If(UsuarioActual.Empresa.TipoContabilidad = 2, UsuarioActual.Empresa.Funcionalidad(266).ToEntero(), 0)
If ImporteMovimiento < 0 Then
tOtTipoMovto = True : tOtCveCon = 78
ImporteMovimiento = Math.Abs(ImporteMovimiento)
IdCta = If(UsuarioActual.Empresa.TipoContabilidad = 2, UsuarioActual.Empresa.IdCuentaOtrosIngresos, 0)
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, tOtTipoMovto, ImporteMovimiento, ImporteMovimiento, tOtCveCon, CompraActual.SerieFolio, Concepto, 0, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveSubProyecto:=CompraActual.CveSubProyecto, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, tOtTipoMovto, ImporteMovimiento, ImporteMovimiento, tOtCveCon, CompraActual.SerieFolio, Concepto, IdCta, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveSubProyecto:=CompraActual.CveSubProyecto, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True
End If
If Not ErrorMovtos AndAlso CompraActual.TC <> Pago.TCPago Then
If Not ErrorMovtos AndAlso TCValuacion <> Pago.TCPago Then
Dim ConceptoContable, IdCtaContable As Integer
Dim TipoMovimiento As Boolean
Dim Diferencia As Decimal = 0
@@ -9625,50 +9837,52 @@ Public Class ClsPaginas
Public ReadOnly Property ConceptoPrePolizaRetIVA As ConceptosRetenciones
Get
Dim Ret As New ConceptosRetenciones
Dim Funcionalidad As Integer
Dim Funcionalidad, FuncionalidadxAcred As Integer
If CveConceptoRetIVA = 1 Then
Funcionalidad = 308
Funcionalidad = 308 : FuncionalidadxAcred = 307
Ret.CveConceptoAcreditable = 22
Ret.CveConceptoxAcreditar = 15
ElseIf CveConceptoRetIVA = 2 Then
Funcionalidad = 310
Funcionalidad = 310 : FuncionalidadxAcred = 309
Ret.CveConceptoAcreditable = 184
Ret.CveConceptoxAcreditar = 183
ElseIf CveConceptoRetIVA = 3 Then
Funcionalidad = 312
Funcionalidad = 312 : FuncionalidadxAcred = 311
Ret.CveConceptoAcreditable = 186
Ret.CveConceptoxAcreditar = 185
ElseIf CveConceptoRetIVA = 4 Then
Funcionalidad = 314
Funcionalidad = 314 : FuncionalidadxAcred = 313
Ret.CveConceptoAcreditable = 249
Ret.CveConceptoxAcreditar = 248
ElseIf CveConceptoRetIVA = 5 Then
Funcionalidad = 578
Funcionalidad = 578 : FuncionalidadxAcred = 578
Ret.CveConceptoAcreditable = 286
Ret.CveConceptoxAcreditar = 285
ElseIf CveConceptoRetIVA = 6 Then
Funcionalidad = 578
Funcionalidad = 578 : FuncionalidadxAcred = 578
Ret.CveConceptoAcreditable = 333
Ret.CveConceptoxAcreditar = 334
End If
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
If UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero > 0 Then
Ret.IdCtaContablexAcreditar = UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero
Dim ObjConta As New ClsContabilidad
If UsuarioActual.Empresa.Funcionalidad(FuncionalidadxAcred).ToEntero > 0 Then
Ret.IdCtaContablexAcreditar = UsuarioActual.Empresa.Funcionalidad(FuncionalidadxAcred).ToEntero
Else
Dim ObjConta As New ClsContabilidad
If ObjConta.GetRetCuenta(Ret.CveConceptoAcreditable, UsuarioActual.CveEmpresa) Then
If ObjConta.DtResultados.Rows.Count > 0 Then
Ret.IdCtaContablexAcreditar = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
If ObjConta.GetRetCuenta(Ret.CveConceptoxAcreditar, UsuarioActual.CveEmpresa) Then
If ObjConta.DtResultados.Rows.Count > 0 Then
Ret.IdCtaContableAcreditable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
If ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContablexAcreditar = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
ObjConta.Dispose()
End If
If UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero > 0 Then
Ret.IdCtaContableAcreditable = UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero
Else
If ObjConta.GetRetCuenta(Ret.CveConceptoAcreditable, UsuarioActual.CveEmpresa) Then
If ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContableAcreditable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
ObjConta.Dispose()
End If
Return Ret
@@ -9677,38 +9891,41 @@ Public Class ClsPaginas
Public ReadOnly Property ConceptoPrePolizaRetISR As ConceptosRetenciones
Get
Dim Ret As New ConceptosRetenciones
Dim Funcionalidad As Integer
Dim Funcionalidad, FuncionalidadxAcred As Integer
If CveConceptoRetISR = 1 Then
Funcionalidad = 316
Funcionalidad = 316 : FuncionalidadxAcred = 315
Ret.CveConceptoAcreditable = 23
Ret.CveConceptoxAcreditar = 16
ElseIf CveConceptoRetISR = 2 Then
Funcionalidad = 318
Funcionalidad = 318 : FuncionalidadxAcred = 317
Ret.CveConceptoAcreditable = 244
Ret.CveConceptoxAcreditar = 243
ElseIf CveConceptoRetISR = 3 Then
Funcionalidad = 348
Funcionalidad = 349 : FuncionalidadxAcred = 348
Ret.CveConceptoAcreditable = 328
Ret.CveConceptoxAcreditar = 327
End If
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
Dim ObjConta As New ClsContabilidad
If UsuarioActual.Empresa.Funcionalidad(FuncionalidadxAcred).ToEntero > 0 Then
Ret.IdCtaContablexAcreditar = UsuarioActual.Empresa.Funcionalidad(FuncionalidadxAcred).ToEntero
Else
If ObjConta.GetRetCuenta(Ret.CveConceptoxAcreditar, UsuarioActual.CveEmpresa) Then
If ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContablexAcreditar = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
End If
End If
If UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero > 0 Then
Ret.IdCtaContableAcreditable = UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero
Else
Dim ObjConta As New ClsContabilidad
If ObjConta.GetRetCuenta(Ret.CveConceptoxAcreditar, UsuarioActual.CveEmpresa) Then
If ObjConta.DtResultados.Rows.Count > 0 Then
Ret.IdCtaContablexAcreditar = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
End If
End If
If ObjConta.GetRetCuenta(Ret.CveConceptoAcreditable, UsuarioActual.CveEmpresa) Then
If ObjConta.DtResultados.Rows.Count > 0 Then
Ret.IdCtaContableAcreditable = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
End If
If ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContableAcreditable = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
End If
ObjConta.Dispose()
End If
ObjConta.Dispose()
End If
Return Ret
@@ -9751,7 +9968,9 @@ Public Class ClsPaginas
Pago.CveConceptoPago = If(Pago.CveConceptoPago = -1, 2, Pago.CveConceptoPago) 'si viene en parametro lo toma com primera opcion, sino el 2
If VentaActual.CveMoneda <> 1 Then Pago.CveConceptoPago = 292
If VentaActual.CveMoneda <> 1 Then
If Pago.TipoPago = "NC" Then Pago.CveConceptoPago = 301 : Pago.CveConceptoPago = 292
End If
Dim Concepto As String = String.Format("{0} F:{1}", VentaActual.ClienteNombre, VentaActual.SerieFolio)
Dim FuncionalidadFluctuacionImpuestos As Boolean = If(UsuarioActual.Empresa.Funcionalidad(159) = "1", True, False)

View File

@@ -720,7 +720,7 @@ Public Class ClsSisUsuarios
#End Region
#Region "U S U A R I O S"
Public Function GetUsuarios(CveUsuario As Integer, Optional CveRol As Integer = -1, Optional CveUsuarioControlado As Integer = -1) As Boolean
Public Function GetUsuarios(CveUsuario As Integer, Optional CveRol As Integer = -1, Optional CveUsuarioControlado As Integer = -1, Optional Estatus As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Sis_UsuariosGet")
@@ -731,6 +731,9 @@ Public Class ClsSisUsuarios
.Add("@Usuario", SqlDbType.VarChar).Value = "-1"
.Add("@Contraseña", SqlDbType.VarChar).Value = "-1"
.Add("@EsLogIn", SqlDbType.Bit).Value = 0
.Add("@Estatus", SqlDbType.Int).Value = Estatus
End With
Try

View File

@@ -4832,7 +4832,7 @@ Public Class Timbrado
If ObjCFDITimbre.Conceptos IsNot Nothing AndAlso ObjCFDITimbre.Conceptos.Count > 0 Then
For Each concep As CFDIConceptos In ObjCFDITimbre.Conceptos
cfdi.Concepto(concep.ClaveProdServ, concep.Noidentificacion, concep.Cantidad.ToString("0.00####").ToDouble(), concep.ClaveUnidad, concep.Unidad, concep.Descripcion, concep.ValorUnitario.ToString("0.00####").ToDouble(), concep.Importe, concep.Descuento, concep.ObjetoImpuesto)
cfdi.Concepto(concep.ClaveProdServ, concep.Noidentificacion, concep.Cantidad.ToString("0.00####"), concep.ClaveUnidad, concep.Unidad, concep.Descripcion, concep.ValorUnitario.ToString("0.00####"), concep.Importe, concep.Descuento, concep.ObjetoImpuesto)
For Each imp As CFDIConceptosImpuestos In concep.Impuestos
If imp.TrasladooRetencion = "T" Then
cfdi.ConceptoTraslado(imp.Base, imp.Impuesto, imp.TipoFactor, imp.TasaOCuota, imp.Importe)
@@ -4919,81 +4919,81 @@ Public Class Timbrado
#End Region
#Region "Comercio Exterior"
'If Ventas.Cliente.AplicaComercioExterior And ObjCFDITimbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto Then
' If ObjCFDITimbre.Complementos.ComercioExterior11 IsNot Nothing Then
If Ventas.Cliente.AplicaComercioExterior And ObjCFDITimbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto Then
If ObjCFDITimbre.Complementos.ComercioExterior11 IsNot Nothing Then
' 'DATOS GENERALES
' cfdi.ComercioExterior11(ObjCFDITimbre.Complementos.ComercioExterior11.MotivoTraslado,
' ObjCFDITimbre.Complementos.ComercioExterior11.TipoOperacion,
' ObjCFDITimbre.Complementos.ComercioExterior11.ClavedePedimento,
' ObjCFDITimbre.Complementos.ComercioExterior11.CertificadoOrigen,
' ObjCFDITimbre.Complementos.ComercioExterior11.NumCertificadoOrigen,
' ObjCFDITimbre.Complementos.ComercioExterior11.NumeroExportadorConfiable,
' ObjCFDITimbre.Complementos.ComercioExterior11.Incoterm,
' ObjCFDITimbre.Complementos.ComercioExterior11.Subdivision,
' ObjCFDITimbre.Complementos.ComercioExterior11.Observaciones,
' ObjCFDITimbre.Complementos.ComercioExterior11.TipoCambioUSD,
' ObjCFDITimbre.Complementos.ComercioExterior11.TotalUSD)
' 'EMISOR
' cfdi.ComercioExterior11Emisor(If(EmisorRFC.Length >= 12, "", ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.CURP))
' cfdi.ComercioExterior11Domicilio(ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Calle,
' ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.NumeroExterior,
' ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.NumeroInterior,
' ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Colonia,
' ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Localidad,
' ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Referencia,
' ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Municipio,
' ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Estado,
' ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Pais,
' ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.CP)
' 'RECEPTOR
' cfdi.ComercioExterior11Receptor(ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumRegIdTrib)
' cfdi.ComercioExterior11DomicilioReceptor(ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Calle,
' ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumeroExterior,
' ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumeroInterior,
' ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Colonia,
' ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Localidad,
' ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Referencia,
' ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Municipio,
' ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Estado,
' ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Pais,
' ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.CP)
' cfdi.ComercioExterior11Destinatario(ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.NumRegIdTrib,
' ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Nombre,
' ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Calle,
' ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.NumeroExterior,
' ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.NumeroInterior,
' ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Colonia,
' ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Localidad,
' ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Referencia,
' ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Municipio,
' ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Estado,
' ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Pais,
' ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.CP)
' 'MERCANCIAS
' If ObjCFDITimbre.Complementos.ComercioExterior11.Mercancias IsNot Nothing AndAlso ObjCFDITimbre.Complementos.ComercioExterior11.Mercancias.Count > 0 Then
' For Each concep As CFDIComercioExterior11Mercancias In ObjCFDITimbre.Complementos.ComercioExterior11.Mercancias
' cfdi.ComercioExterior11Mercancia(concep.NoIdentificacion, concep.FraccionArancelaria, concep.CantidadAduana, concep.UnidadAduana, concep.ValorUnitarioAduana, concep.ValorDolares)
' If concep.DescripcionesEspecificas.Marca <> "" Then
' cfdi.ComercioExterior11MercanciaDescripcionesEspeciales(concep.DescripcionesEspecificas.Marca,
' concep.DescripcionesEspecificas.Modelo,
' concep.DescripcionesEspecificas.SubModelo,
' concep.DescripcionesEspecificas.NumeroSerie)
' End If
' Next
'DATOS GENERALES
cfdi.ComercioExterior11(ObjCFDITimbre.Complementos.ComercioExterior11.MotivoTraslado,
ObjCFDITimbre.Complementos.ComercioExterior11.TipoOperacion,
ObjCFDITimbre.Complementos.ComercioExterior11.ClavedePedimento,
ObjCFDITimbre.Complementos.ComercioExterior11.CertificadoOrigen,
ObjCFDITimbre.Complementos.ComercioExterior11.NumCertificadoOrigen,
ObjCFDITimbre.Complementos.ComercioExterior11.NumeroExportadorConfiable,
ObjCFDITimbre.Complementos.ComercioExterior11.Incoterm,
ObjCFDITimbre.Complementos.ComercioExterior11.Subdivision,
ObjCFDITimbre.Complementos.ComercioExterior11.Observaciones,
ObjCFDITimbre.Complementos.ComercioExterior11.TipoCambioUSD,
ObjCFDITimbre.Complementos.ComercioExterior11.TotalUSD)
'EMISOR
cfdi.ComercioExterior11Emisor(If(EmisorRFC.Length >= 12, "", ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.CURP))
cfdi.ComercioExterior11Domicilio(ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Calle,
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.NumeroExterior,
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.NumeroInterior,
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Colonia,
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Localidad,
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Referencia,
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Municipio,
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Estado,
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Pais,
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.CP)
'RECEPTOR
cfdi.ComercioExterior11Receptor(ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumRegIdTrib)
cfdi.ComercioExterior11DomicilioReceptor(ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Calle,
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumeroExterior,
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumeroInterior,
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Colonia,
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Localidad,
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Referencia,
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Municipio,
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Estado,
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Pais,
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.CP)
cfdi.ComercioExterior11Destinatario(ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.NumRegIdTrib,
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Nombre,
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Calle,
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.NumeroExterior,
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.NumeroInterior,
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Colonia,
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Localidad,
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Referencia,
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Municipio,
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Estado,
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Pais,
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.CP)
'MERCANCIAS
If ObjCFDITimbre.Complementos.ComercioExterior11.Mercancias IsNot Nothing AndAlso ObjCFDITimbre.Complementos.ComercioExterior11.Mercancias.Count > 0 Then
For Each concep As CFDIComercioExterior11Mercancias In ObjCFDITimbre.Complementos.ComercioExterior11.Mercancias
cfdi.ComercioExterior11Mercancia(concep.NoIdentificacion, concep.FraccionArancelaria, concep.CantidadAduana, concep.UnidadAduana, concep.ValorUnitarioAduana, concep.ValorDolares)
If concep.DescripcionesEspecificas.Marca <> "" Then
cfdi.ComercioExterior11MercanciaDescripcionesEspeciales(concep.DescripcionesEspecificas.Marca,
concep.DescripcionesEspecificas.Modelo,
concep.DescripcionesEspecificas.SubModelo,
concep.DescripcionesEspecificas.NumeroSerie)
End If
Next
' End If
End If
' End If
'End If
End If
End If
#End Region
End If

View File

@@ -22,22 +22,60 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
Dim FI As Date
Dim FF As Date
If context.Request("U").ToEntero > 0 Then
CveUsuario = context.Request("U").ToEntero
CveEmpresa = context.Request("E").ToEntero
FI = context.Request("start").ToDate
If context.Request("METODO") IsNot Nothing Then
FF = context.Request("end").ToDate
If Not GetEventos(CveUsuario, CveEmpresa, FI, FF) Then
'Convierte el objeto de Eventos en JSON
'Dim oSerializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer
Dim sJSON As String = Newtonsoft.Json.JsonConvert.SerializeObject(events)
Select Case context.Request("METODO")
Case "servicio_domicilio"
If context.Request("U").ToEntero > 0 Then
CveUsuario = context.Request("U").ToEntero
CveEmpresa = context.Request("E").ToEntero
FI = context.Request("start").ToDate
FF = context.Request("end").ToDate
If Not GetEventos(CveUsuario, CveEmpresa, FI, FF, CveOS:=-2) Then
'Convierte el objeto de Eventos en JSON
'Dim oSerializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer
Dim sJSON As String = Newtonsoft.Json.JsonConvert.SerializeObject(events)
context.Response.Write(sJSON)
End If
End If
Exit Select
Case Else
Exit Select
End Select
Else
If context.Request("U").ToEntero > 0 Then
CveUsuario = context.Request("U").ToEntero
CveEmpresa = context.Request("E").ToEntero
FI = context.Request("start").ToDate
FF = context.Request("end").ToDate
If Not GetEventos(CveUsuario, CveEmpresa, FI, FF) Then
'Convierte el objeto de Eventos en JSON
'Dim oSerializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer
Dim sJSON As String = Newtonsoft.Json.JsonConvert.SerializeObject(events)
context.Response.Write(sJSON)
End If
context.Response.Write(sJSON)
End If
End If
End Sub
Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
@@ -47,14 +85,15 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
End Property
Private Function GetEventos(CveUsuario As Integer, CveEmpresa As Integer, pFI As Date, pFF As Date) As Boolean
Private Function GetEventos(CveUsuario As Integer, CveEmpresa As Integer, pFI As Date, pFF As Date, Optional CveOS As Integer = -1) As Boolean
Dim ObjEventos As New ClsOIEventos
Dim ErrorEventos = False
Dim CveEmpresaCRM As Integer = 0
If ObjEventos.GetEventos(-1, -1, -1, "-1", "-1", -1, CveUsuario, CveUsuario, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, CveUsuario, CveUsuario, CveUsuario, CveEmpresa, pFI, pFF) Then
If ObjEventos.GetEventos(-1, -1, -1, "-1", "-1", -1, CveUsuario, CveUsuario, -1, -1, -1, "-1", -1, -1, -1, -1, CveOS, -1, -1, -1, -1, -1, CveUsuario, CveUsuario, CveUsuario, CveEmpresa, pFI, pFF) Then
If ObjEventos.DtResultados.Rows.Count > 0 Then
events = New List(Of CalendarEvent)
Try
For Each dr As DataRow In ObjEventos.DtResultados.Rows
Dim cevent As CalendarEvent = New CalendarEvent()
@@ -78,6 +117,8 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
cevent.Prospecto = dr("Prospecto").ToString
cevent.CveTipoEvento = dr("Prospecto").ToString.ToEntero
cevent.EmpresaCRM = dr("EmpresaCRM").ToString
cevent.SubProyecto = dr("SubProyecto").ToString
cevent.CveSubProyecto = dr("CveSubProyecto").ToString.ToEntero
'11/05/2018 - Evento Gasto Recurrente
cevent.CveTipoEvento = dr("CveTipoEvento").ToString.ToEntero

View File

@@ -314,7 +314,7 @@ Partial Class Bancos_DepositosCaja
CveIEDestino = ObjBancos.AddBancos_IE(DdlCajaChica.SelectedValue.ToEntero, 2, Fecha, FolioIE.ToString, String.Format("Depósito Bancario: {0}", SerieFolio), Importe, CveMoneda, 1, TxtObservaciones.Text, "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, Importe, SerieFolio, 30, String.Format("Depósito Bancario: {0}", SerieFolio), Fecha, IdCuentaBancariaDestino, -1, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, CveVenta:=CveVenta, CveIE:=CveIEDestino, ImporteMX:=Importe * TipoCambio, CveCuenta:=CveCuentaBancariaDestino) Then
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, Importe, SerieFolio, 30, String.Format("Depósito Bancario: {0}", SerieFolio), Fecha, IdCuentaBancariaDestino, -1, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, CveVenta:=CveVenta, CveIE:=CveIEDestino, ImporteMX:=Importe * TipoCambio) Then
OcurrioError = True
Exit For
End If

View File

@@ -365,7 +365,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas
{
MsgError = "No se pudo insertar concepto de bancos complementaria";
}
s
// BANCOS
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, TxtImportePrestamo.Text.ToDecimal(), Ref, CveConceptoContableBanco, Conc, IDCtaContableBancosPrestamo, CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), ImporteMX: TxtImportePrestamo.Text.ToDecimal(), ImporteME: TxtImportePrestamo.Text.ToDecimal(), TipoCambio: tipoCambio, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero()))
{

View File

@@ -203,6 +203,21 @@ Partial Class Bancos_ProveedoresAbonar
End Set
End Property
Private Property CveSubProyectoFiltro As Integer
Get
If ViewState("CveSubProyectoFiltro") Is Nothing Then
ViewState("CveSubProyectoFiltro") = -1
End If
Return ViewState("CveSubProyectoFiltro").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveSubProyectoFiltro") = value
End Set
End Property
Private Property DtDatos As DataTable
Get
Return DirectCast(ViewState("DtDatos"), DataTable)
@@ -278,6 +293,7 @@ Partial Class Bancos_ProveedoresAbonar
CveAplicaNC = IfNull(Request("CveAplicaNC"), "-1").ToString.ToEntero
CveProveedorSucursal = IfNull(Request("CveProveedorSucursal"), "-1").ToString.ToEntero
CodigoProgramacion = IfNull(Request("CodigoProgramacion"), "-1").ToString
CveSubProyectoFiltro = IfNull(Request("CveSubProyecto"), -1).ToString.ToEntero
TxtOtrosImportes.Attributes.Add("onKeyUp", String.Format("FnSuma(this,{0},{1});", "TxtTotal", 0))
@@ -382,7 +398,7 @@ Partial Class Bancos_ProveedoresAbonar
TxtImporte.Text = ""
TxtTotal.Text = ""
If Mov.GetCxPProveedor(CveProveedor, FechaI, FechaF, CveUsuarioProgramo, CveUsuarioRegistro, CveUsuarioResponsable, CveClasificacionProveedor, tCveMoneda, CveEstatus, CveProveedorSucursal, CveAplicaNC, "-1", "-1", CodigoProgramacion) Then
If Mov.GetCxPProveedor(CveProveedor, FechaI, FechaF, CveUsuarioProgramo, CveUsuarioRegistro, CveUsuarioResponsable, CveClasificacionProveedor, tCveMoneda, CveEstatus, CveProveedorSucursal, CveAplicaNC, "-1", "-1", CodigoProgramacion, CveSubProyecto:=CveSubProyectoFiltro) Then
DtDatos = Mov.DtResultados.FiltraParametros("Saldo > 0", "Fecha,SerieFolio")
GvCxP.DataSource = DtDatos
DtDatos.Columns.Add("Movimiento")
@@ -488,7 +504,7 @@ Partial Class Bancos_ProveedoresAbonar
If e.Row.DBCampo("Saldo").ToDouble < 0 Then e.Row.Cells(7).ForeColor = Drawing.Color.Red
If e.Row.DBCampo("DiasVencidos").ToDouble > 0 AndAlso CType(sender, GridView).ID = "GvCxC" Then e.Row.Cells(4).ForeColor = Drawing.Color.Red
If e.Row.DBCampo("Original").ToDouble = 0 Then DirectCast(e.Row.FindControl("LtlSaldoOriginal"), Literal).Text = ""
If e.Row.DBCampo("TotalOriginal").ToDouble = 0 Then DirectCast(e.Row.FindControl("LtlSaldoOriginal"), Literal).Text = ""
If e.Row.DBCampo("Abonado").ToDouble = 0 Then DirectCast(e.Row.FindControl("LtlAbonado"), Literal).Text = ""
If e.Row.DBCampo("Saldo").ToDouble = 0 Then DirectCast(e.Row.FindControl("LtlSaldo"), Literal).Text = ""
@@ -835,6 +851,7 @@ Partial Class Bancos_ProveedoresAbonar
CompraActual.EsImportacion = gvr.DataKey("EsImportacion") = "True"
CompraActual.UsuarioActual = UsuarioActual
CompraActual.CveSubProyecto = gvr.DataKey("CveSubProyecto").ToEntero
CompraActual.IdCtaContableProv = CtaProveedor
'Importe de pago
Pago.ImportePago = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
@@ -850,6 +867,8 @@ Partial Class Bancos_ProveedoresAbonar
If gvr.FCTextBox("TxtComision").Text.ToDecimal <> 0 Then
Pago.OtroGastoIngreso = gvr.FCTextBox("TxtComision").Text.ToDecimal
Else
Pago.OtroGastoIngreso = 0
End If
If AplicaPrePolizaPago(CompraActual, Pago, CvePrePoliza, ObjMov) Then
@@ -867,7 +886,8 @@ Partial Class Bancos_ProveedoresAbonar
Dim UsaComplementariaBancos As Boolean = Not UsuarioActual.CveEmpresa.Contiene(7, 11, 122, 145)
Dim ConceptoMovimiento As String = $"{TxtPagueseA.Text.Trim} - {TxtObservaciones.Text} {If(Pago.TCPago > 1, $" TC:{Pago.TCPago}", "")}"
Dim Referencia As String = $"{HdnTipoTransaccionAbreviatura.Value}: {TxtFolio.Text.Trim}"
Dim tImporteMN As Decimal = Pago.ImportePago
Dim tImporteMN As Decimal = TxtImporte.Text.ToDecimal
Pago.ImportePago = tImporteMN
If DivTarjeta.Visible AndAlso DdlTarjeta.SelectedValue.ToEntero > 0 Then
Dim ObjCreditos As New ClsBancos
@@ -891,7 +911,7 @@ Partial Class Bancos_ProveedoresAbonar
MsgError = "No se pudo insertar la póliza"
End If
If UsaComplementariaBancos Then
If Pago.CveMonedaPago = 2 AndAlso UsaComplementariaBancos Then
If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, (Pago.ImportePago * Pago.TCPago - Pago.ImportePago).RoundSQL, 204, Referencia, ConceptoMovimiento, IdCuentaBancariaComplementaria, CveIE:=CveIE, CveProveedor:=CveProveedor, ImporteME:=Pago.ImportePago, TipoCambio:=Pago.TCPago, CveSubProyecto:=CveSubProyecto) Then
MsgError = "No se pudo insertar la póliza"
End If
@@ -1001,7 +1021,7 @@ Partial Class Bancos_ProveedoresAbonar
For Each gvr As GridViewRow In GvCxP.Rows
If gvr.FCCheckBox("Chk").Checked Then
'obtengo su poliza para ver que presupuestos afecto
If gvr.DataKey("Original").ToDouble > 0 Then PorcentajePago = gvr.FCTextBox("TxtAbonar").Text.ToDouble / gvr.DataKey("Original").ToDouble Else PorcentajePago = 1
If gvr.DataKey("TotalOriginal").ToDouble > 0 Then PorcentajePago = gvr.FCTextBox("TxtAbonar").Text.ToDouble / gvr.DataKey("TotalOriginal").ToDouble Else PorcentajePago = 1
If ObjComp.GetPresupuestosCompras(gvr.DataKey("CveCompra").ToEntero) Then
dtAC.Merge(ObjComp.DtResultados)
@@ -1890,7 +1910,7 @@ Partial Class Bancos_ProveedoresAbonar
End If
End If
Dim PorcentajePago As Decimal = gr.DataKey("Saldo").ToDecimal / gr.DataKey("Original").ToDecimal
Dim PorcentajePago As Decimal = gr.DataKey("Saldo").ToDecimal / gr.DataKey("TotalOriginal").ToDecimal
If MsgError = "" AndAlso gr.DataKey("IVA").ToDecimal > 0 Then
Dim PorcentajeImpuesto As Decimal = gr.DataKey("PorcentajeIVA").ToDecimal

View File

@@ -162,7 +162,8 @@ Partial Class Bancos_RepProveedoresPagos
CveUsuarioProgramo = DdlUsuarioProgramo.SelectedValue.ToEntero
End If
e.Row.FCHyperLink("ImgAbonar").NavigateUrl = String.Format("/Bancos/ProveedoresAbonar.aspx?CveProveedor={0}&FechaI={1}&FechaF={2}&CveUsuarioProgramo={3}&TipoPago={4}&CveUsuarioRegistro={5}&CveUsuarioResponsable={6}&CveClasificacion={7}&CveMoneda={8}&CveEstatus={9}&CveProveedorSucursal={10}&CveAplicaNC={11}&CodigoProgramacion={12}", e.Row.DBCampo("CveProveedor"), If(txtFechaI.Text <> "", txtFechaI.Text, "-1"), If(txtFechaF.Text <> "", txtFechaF.Text, "-1"), CveUsuarioProgramo, -1, DdlUsuarioRegistro.SelectedValue, DdlUsuarioResponsable.SelectedValue, DdlProveedoresClasificaciones.SelectedValue, e.Row.DBCampo("CveMoneda"), DdlEstatusCompra.SelectedValue, e.Row.DBCampo("CveProveedorSucursal"), AplicaNC.SelectedValue, DdlCodigoProgramacion.SelectedValue)
e.Row.FCHyperLink("ImgAbonar").NavigateUrl = String.Format("/Bancos/ProveedoresAbonar.aspx?CveProveedor={0}&FechaI={1}&FechaF={2}&CveUsuarioProgramo={3}&TipoPago={4}&CveUsuarioRegistro={5}&CveUsuarioResponsable={6}&CveClasificacion={7}&CveMoneda={8}&CveEstatus={9}&CveProveedorSucursal={10}&CveAplicaNC={11}&CodigoProgramacion={12}&CveSubProyecto={13}", e.Row.DBCampo("CveProveedor"), If(txtFechaI.Text <> "", txtFechaI.Text, "-1"), If(txtFechaF.Text <> "", txtFechaF.Text, "-1"), CveUsuarioProgramo, -1, DdlUsuarioRegistro.SelectedValue, DdlUsuarioResponsable.SelectedValue, DdlProveedoresClasificaciones.SelectedValue, e.Row.DBCampo("CveMoneda"), DdlEstatusCompra.SelectedValue, e.Row.DBCampo("CveProveedorSucursal"), AplicaNC.SelectedValue, DdlCodigoProgramacion.SelectedValue, DdlSubProyecto.SelectedValue)
End If
End Sub

View File

@@ -6246,7 +6246,9 @@
});
$('input[name*=HdnOC1IVA]').each(function () {
SumaIVA += ToDouble($(this).val());
let tmpiva = (ToDouble($(this).val())).toFixed(2)
SumaIVA += ToDouble(tmpiva);
});
$('input[name*=HdnOC1RetIVA]').each(function () {

View File

@@ -5385,7 +5385,7 @@ Partial Class Compras_Compras
End If
'agregamos la salida gasto
'agregamos la salida
folio = ObjInventario.GetFolioSiguiente(3, UsuarioActual.CveEmpresa)
cvemovimientosalidagasto = ObjInventario.AddMovimiento(tcvealmacen, 3, DdlMoneda.SelectedValue.ToEntero, fecha.AddSeconds(1), folio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, Modulo:="Comp/G3")
If cvemovimientosalidagasto <= 0 Then
@@ -5965,7 +5965,7 @@ Partial Class Compras_Compras
Pago.CveCompraAmortizacion = -1
Pago.CveCreditoDetalle = CveCreditoDetalle
ErrorMovtosCxP = AplicaPrePolizaPago(CompraActual, Pago, CvePrePoliza, ObjConta)
ErrorMovtosCxP = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta)
End If
@@ -6036,7 +6036,7 @@ Partial Class Compras_Compras
Pago.CveCompraAmortizacion = -1
'Pago.CveConceptoPago = CveConceptoPago
ErrorMovtosCxP = AplicaPrePolizaPago(CompraActual, Pago, CvePrePoliza, ObjConta)
ErrorMovtosCxP = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta)
End If
Case 14 'IVA X Acreditar
@@ -6091,14 +6091,6 @@ Partial Class Compras_Compras
End If
End If
'Case 224 'Otros impuestos
' If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then
' importeMovimiento = OtrosImpuestos
' importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador
' If tipoCambioActual > 1 Then Concepto += $" TC{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}"
' IdCtaContable = If(UsuarioActual.CveEmpresa = 119, 1171, -1)
' End If
Case 15 'RetIVA X Acreditar Honorarios/Serv. Prof.
If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then
If DdlRetIVAConcepto.Items.Count > 0 AndAlso DdlRetIVAConcepto.SelectedValue.ToEntero() > 0 Then
@@ -6157,7 +6149,7 @@ Partial Class Compras_Compras
funcionalidad = 317
ConceptoContable = 243
ElseIf DdlRetISRConcepto.SelectedValue.ToEntero = 3 Then
funcionalidad = 348
funcionalidad = 349
ConceptoContable = 327
End If
importeMovimiento = CompraActual.RetISR
@@ -6269,10 +6261,12 @@ Partial Class Compras_Compras
DT = TmpDT.FiltraParametros("ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) > 0", "", {"CveAlmacen"})
'RECORREMOS PARA DETECTAR LA MODALIDAD DEL ALMACEN, EN CASO DE SER SOLO EXISTENCIA LIMPIAMOS CVEALMACEN
'SI LA COMPRA ES DE TIPO GASTO CON ALMACEN DEBE REGISTRAR MOVIMIENTO
Dim AlmacenSoloExistencia As Boolean = False
If DdlTipoCompra.SelectedValue <> "10" Then
For Each Dr As DataRow In DT.Rows
If DtAlmacenes.FiltroPrimeroValor("Modalidad", $"CveAlmacen = {Dr("CveAlmacen").ToString.ToEntero}").ToString = "Solo Existencia" Then
Dr("CveAlmacen") = 0
AlmacenSoloExistencia = True
End If
Dr.AcceptChanges()
Next
@@ -6296,7 +6290,6 @@ Partial Class Compras_Compras
End If
End If
If importeMN <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMN, Referencia, 6, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual,
CveClasificacion:=RowDetalle("CveClasificacion").ToString().ToEntero(), CveSubProyecto:=RowDetalle("CveSubProyecto").ToString().ToEntero(), Contabilizable:=SeContabiliza) Then
@@ -6317,15 +6310,14 @@ Partial Class Compras_Compras
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
End If
End If
End If
If importeMN <> 0 Then
'Conta ContPAQ
If IdCtaContable = 0 Then
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 68))("ConceptoContable").ToString)
idCuentaContabilizacion = 0
End If
End If
If importeMN <> 0 Then
'SI ES GASTO CON ALMACEN NO DEBE CONTABILIZAR CONCEPTO 68
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMN, Referencia, 68, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, Contabilizable:=If(DdlTipoCompra.SelectedValue = "10", False, SeContabiliza)) Then
@@ -6349,9 +6341,6 @@ Partial Class Compras_Compras
importeMovimiento = 0
IdCtaContable = 0
''FLETES
'If UsuarioActual.CveEmpresa.Contiene(119) And UsuarioActual.Empresa.UsaInventarios And DdlTipoComprobante.SelectedValue <> "NC" And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And CveConceptoContableAlmacen.Contiene(237, 240) Then
'End If
Dim CostoIndirectoAcum176 As Decimal = 0
'INV [MERCANCIA RECIBIDA POR ADELANTADO (OC) | MERCANCIA PENDIENTE POR RECIBIR (COMPRA) ]
@@ -7047,7 +7036,6 @@ Partial Class Compras_Compras
End If
End If
End If
End If
Next
@@ -7096,7 +7084,7 @@ Partial Class Compras_Compras
Pago.CveIE = -1
Pago.CvePersonal = CvePersonal
ErrorPrepoliza = AplicaPrePolizaPago(CompraActual, Pago, CvePrePoliza, ObjConta)
ErrorPrepoliza = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta)
End If
@@ -7250,7 +7238,7 @@ Partial Class Compras_Compras
Pago.CveIE = Ant.CveIE
Pago.CveMonedaPago = 1
ErrorMovtosCxP = AplicaPrePolizaPago(CompraActual, Pago, CvePrePoliza, ObjConta)
ErrorMovtosCxP = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta)
End If
@@ -7293,7 +7281,7 @@ Partial Class Compras_Compras
Pago.TCPago = Ant.TCCompra
Pago.CveMonedaPago = If(Ant.TCCompra > 1, 2, 1)
ErrorPrepoliza = AplicaPrePolizaPago(CompraActual, Pago, CvePrePoliza, ObjConta)
ErrorPrepoliza = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta)
End If
@@ -7405,9 +7393,6 @@ Partial Class Compras_Compras
End If
End If
'' A N T I C I P O S
If UsuarioActual.Empresa.UsaAC Then
If ArrAnticipos.Count > 0 Then
@@ -7475,7 +7460,6 @@ Partial Class Compras_Compras
End If
End If
'' F U N C I O N A R I O S Y E M P L E A D O S
If RBLContado.SelectedValue = "2" AndAlso DdlFuncionarioEmpleado.SelectedValue.ToEntero > 0 Then
TxtDocumentoImporte.Text = TxtDocumentoImporteFE.Text
@@ -7489,25 +7473,20 @@ Partial Class Compras_Compras
'se agrego un movimiento de pago
If CveIE > 0 Then
If ImporteCompra <> 0 Then
'inserto los movimientos de la conta para abonar al saldo
Dim Pago As New CompraPago
Pago.ImportePago = ImporteCompra
Pago.CveIE = CveIE
Pago.CveMonedaPago = 1
ErrorMovtosCxP = AplicaPrePolizaPago(CompraActual, Pago, CvePrePoliza, ObjConta)
ErrorMovtosCxP = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta)
End If
Else
ErrorMovtosIE = True
End If
End If
'movimiento de compra
'[IPP] PARCHE PROVISIONAL DE CLASIFICACION Y SUBPROYECTO [CveClasificacion:=TmpDT.FiltroPrimeroValor("CveClasificacion").ToString.ToEntero] [CveSubProyecto:=TmpDT.FiltroPrimeroValor("CveSubProyecto").ToString.ToEntero]
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoCompra, TxtSubTotal2.Text.ToDecimal, " ", CveConceptoCompra, " ", TxtFechaPago.Text.ToDate, 0, -1, CveClasificacion:=TmpDT.FiltroPrimeroValor("CveClasificacion").ToString.ToEntero, CveSubProyecto:=TmpDT.FiltroPrimeroValor("CveSubProyecto").ToString.ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveIE:=CveIE, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=TxtSubTotal2.Text.ToDecimal) Then
@@ -7622,7 +7601,7 @@ Partial Class Compras_Compras
Pago.CveCompraAmortizacion = CveCompraNC
Pago.CveConceptoPago = CveConceptoPago
ErrorMovtosCxP = AplicaPrePolizaPago(CompraActual, Pago, CvePrePoliza, ObjConta)
ErrorMovtosCxP = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta)
Else
ErrorMovtosCxP = True
@@ -7730,7 +7709,7 @@ Partial Class Compras_Compras
Pago.CveIE = CveIE
Pago.CveMonedaPago = 1
ErrorMovtosCxP = AplicaPrePolizaPago(CompraActual, Pago, CvePrePoliza, ObjConta)
ErrorMovtosCxP = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta)
Else
ErrorMovtosCxP = True
@@ -8983,16 +8962,6 @@ Partial Class Compras_Compras
End If
'[IPP] COMENTADO PORQUE REUNIFICABA AMORTIZACIÓN NC 27/Agosto/2018
'If Not CompraUnificada Then
' 'Unificacion de PrePolizas
' If UsuarioActual.Empresa.Funcionalidad(219) = "1" Then
' If Not ObjConta.PrePolizaUnificacion(gvr.DataKey("CvePrePoliza").ToEntero, CvePrepolizaPadre) Then
' ErrorMovtosCxP = 1
' Alert("No se pudo unificar la prepoliza", TipoMensaje.MsgError)
' End If
' End If
'End If
End If
Next
@@ -9011,8 +8980,6 @@ Partial Class Compras_Compras
ErrorMovtosCxP = 1
End If
End If
End If
End If
@@ -10055,17 +10022,17 @@ Partial Class Compras_Compras
If UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen = 0 Then
DT = TmpDT.FiltraParametros("ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) > 0", "", {"CveAlmacen"})
'RECORREMOS PARA DETECTAR LA MODALIDAD DEL ALMACEN, EN CASO DE SER SOLO EXISTENCIA LIMPIAMOS CVEALMACEN
If DdlTipoCompra.SelectedValue <> "10" Then
For Each Dr As DataRow In DT.Rows
If DtAlmacenes.FiltroPrimeroValor("Modalidad", $"CveAlmacen = {Dr("CveAlmacen").ToString.ToEntero}").ToString = "Solo Existencia" Then
Dr("CveAlmacen") = 0
End If
Dr.AcceptChanges()
Next
End If
'For Each Dr As DataRow In DT.Rows
' If DtAlmacenes.FiltroPrimeroValor("Modalidad", $"CveAlmacen = {Dr("CveAlmacen").ToString.ToEntero}").ToString = "Solo Existencia" Then
' Dr("CveAlmacen") = 0
' End If
' Dr.AcceptChanges()
'Next
DT.AcceptChanges()
DT = DT.FiltraParametros("ISNULL(CveAlmacen,0) > 0")
If DT.Rows.Count > 0 AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
If (DT.Rows.Count > 0) AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
For Each Row2 As DataRow In DT.Rows
importeMovimiento = TmpDT.SUM("Total", $"CveAlmacen = {Row2("CveAlmacen")}").ToString.ToDecimal + TmpDT.SUM("CostoIndirectoAlmacen", $"CveAlmacen = {Row2("CveAlmacen")}").ToString.ToDecimal 'Row2("Total").ToString.ToDecimal + Row2("CostoIndirectoAlmacen").ToString.ToDecimal
@@ -10186,17 +10153,10 @@ Partial Class Compras_Compras
End If
End If
''SEGMENTO DE NEGOCIO
Dim IdSegmentoNegocio As Integer = -1
'Dim drT As DataRow = GlobalDTSubProyectos(-1, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero).FiltroPrimero(String.Format("CveSubProyecto = {0} ", Row2("CveSubProyecto").ToString.ToEntero))
'If drT IsNot Nothing Then
' IdSegmentoNegocio = drT("IdSegNeg").ToString.ToEntero
'End If
'AGREGA MOVIMIENTO
If importeMovimiento <> 0 AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}"
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 6, Concepto, FechaMovimiento, IdCtaContable, IdSegmentoNegocio, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CveCreditoDetalle:=CveCreditoDetalle, CveClasificacion:=Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveTipoGasto:=Row2("CveTipoGasto").ToString.ToEntero) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 6, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CveCreditoDetalle:=CveCreditoDetalle, CveClasificacion:=Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveTipoGasto:=Row2("CveTipoGasto").ToString.ToEntero) Then
ErrorPrepoliza = True
End If
End If
@@ -15027,7 +14987,7 @@ Partial Class Compras_Compras
Dim Cont As Integer = 0
For Each gvr As GridViewRow In GvOC1.Rows
RegistraScript($"CalculaTotalOCEdit('{gvr.DataKey("PS").Replace("'", "")}', {gvr.DataKey("Cantidad").ToString.ToDouble}, {gvr.FCTextBox("TxtCantidad").ClientID}, {gvr.FCTextBox("TxtPU").ClientID}, {gvr.FCTextBox("TxtTotalOC1").ClientID}, {gvr.DataKey("IEPSPS").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1IEPSImporte").ClientID}, {gvr.DataKey("IVA").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1IVA").ClientID},{gvr.DataKey("RetIVA").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1RetIVA").ClientID},{gvr.DataKey("RetISR").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1RetISR").ClientID},{gvr.DataKey("IEPSPS").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1IEPSIVA").ClientID},{gvr.DataKey("Descuento")},{gvr.FCHiddenField("HdnOC1Descuento").ClientID},{gvr.DataKey("IVAPorcentaje").ToString.ToDouble},{gvr.DataKey("RetIVAPorcentaje").ToString.ToDouble},{gvr.DataKey("RetISRPorcentaje").ToString.ToDouble},{gvr.DataKey("IEPSPSPorcentaje").ToString.ToDouble},{gvr.DataKey("IEPSPSIVAPorcentaje").ToString.ToDouble});", $"Gv{Cont}")
RegistraScript($"CalculaTotalOCEdit('{ gvr.DataKey("PS").Replace("'", "").Replace(vbLf, " ").Replace(vbCrLf, " ") }', {gvr.DataKey("Cantidad").ToString.ToDouble}, {gvr.FCTextBox("TxtCantidad").ClientID}, {gvr.FCTextBox("TxtPU").ClientID}, {gvr.FCTextBox("TxtTotalOC1").ClientID}, {gvr.DataKey("IEPSPS").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1IEPSImporte").ClientID}, {gvr.DataKey("IVA").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1IVA").ClientID},{gvr.DataKey("RetIVA").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1RetIVA").ClientID},{gvr.DataKey("RetISR").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1RetISR").ClientID},{gvr.DataKey("IEPSPS").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1IEPSIVA").ClientID},{gvr.DataKey("Descuento")},{gvr.FCHiddenField("HdnOC1Descuento").ClientID},{gvr.DataKey("IVAPorcentaje").ToString.ToDouble},{gvr.DataKey("RetIVAPorcentaje").ToString.ToDouble},{gvr.DataKey("RetISRPorcentaje").ToString.ToDouble},{gvr.DataKey("IEPSPSPorcentaje").ToString.ToDouble},{gvr.DataKey("IEPSPSIVAPorcentaje").ToString.ToDouble});", $"Gv{Cont}")
Cont += 1
Next
@@ -15043,7 +15003,7 @@ Partial Class Compras_Compras
Protected Sub GvOC1_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvOC1.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim JSCambiaScript = $"CalculaTotalOCEdit('{e.Row.DBCampo("PS").Replace("'", "")}', {e.Row.DBCampo("Cantidad").ToString.ToDouble}, {e.Row.FCTextBox("TxtCantidad").ClientID}, {e.Row.FCTextBox("TxtPU").ClientID}, {e.Row.FCTextBox("TxtTotalOC1").ClientID}, {e.Row.DBCampo("IEPSPS").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IEPSImporte").ClientID}, {e.Row.DBCampo("IVA").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IVA").ClientID},{e.Row.DBCampo("RetIVA").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1RetIVA").ClientID},{e.Row.DBCampo("RetISR").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1RetISR").ClientID},{e.Row.DBCampo("IEPSPS").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IEPSIVA").ClientID},{e.Row.DBCampo("Descuento")},{e.Row.FCHiddenField("HdnOC1Descuento").ClientID},{e.Row.DBCampo("IVAPorcentaje").ToString.ToDouble},{e.Row.DBCampo("RetIVAPorcentaje").ToString.ToDouble},{e.Row.DBCampo("RetISRPorcentaje").ToString.ToDouble},{e.Row.DBCampo("IEPSPSPorcentaje").ToString.ToDouble},{e.Row.DBCampo("IEPSPSIVAPorcentaje").ToString.ToDouble});"
Dim JSCambiaScript = $"CalculaTotalOCEdit('{e.Row.DBCampo("PS").Replace("'", "").Replace(vbLf, " ").Replace(vbCrLf, " ")}', {e.Row.DBCampo("Cantidad").ToString.ToDouble}, {e.Row.FCTextBox("TxtCantidad").ClientID}, {e.Row.FCTextBox("TxtPU").ClientID}, {e.Row.FCTextBox("TxtTotalOC1").ClientID}, {e.Row.DBCampo("IEPSPS").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IEPSImporte").ClientID}, {e.Row.DBCampo("IVA").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IVA").ClientID},{e.Row.DBCampo("RetIVA").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1RetIVA").ClientID},{e.Row.DBCampo("RetISR").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1RetISR").ClientID},{e.Row.DBCampo("IEPSPS").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IEPSIVA").ClientID},{e.Row.DBCampo("Descuento")},{e.Row.FCHiddenField("HdnOC1Descuento").ClientID},{e.Row.DBCampo("IVAPorcentaje").ToString.ToDouble},{e.Row.DBCampo("RetIVAPorcentaje").ToString.ToDouble},{e.Row.DBCampo("RetISRPorcentaje").ToString.ToDouble},{e.Row.DBCampo("IEPSPSPorcentaje").ToString.ToDouble},{e.Row.DBCampo("IEPSPSIVAPorcentaje").ToString.ToDouble});"
e.Row.FCTextBox("TxtCantidad").Attributes.Add("onkeyup", $"LimitaCantidadOC({e.Row.DBCampo("CantidadPendienteVincular")}, this);{JSCambiaScript}")
e.Row.FCTextBox("TxtPU").Attributes.Add("onkeyup", JSCambiaScript)

View File

@@ -113,6 +113,7 @@ Partial Class Compras_ReembolsosComprobaciones
CveCuentaBancaria = -1
ViewState("CveMoneda") = 1
CveMonedaPago = 1
TipoCambioPago = 1
Folio = ""
'Cargar Filtros
@@ -376,7 +377,7 @@ Partial Class Compras_ReembolsosComprobaciones
ChkOtrosIngresosCheque.Visible = True
If UsuarioActual.TienePermisoProceso(113) Then TrChequeExcedente.Visible = True
'If UsuarioActual.TienePermisoProceso(113) Then TrChequeExcedente.Visible = True
CargaDatos(DDlCheques.SelectedValue.ToEntero)
@@ -392,7 +393,7 @@ Partial Class Compras_ReembolsosComprobaciones
ChkOtrosIngresosCheque.Visible = False
If UsuarioActual.TienePermisoProceso(113) Then TableExpedirCheque.Visible = True
'If UsuarioActual.TienePermisoProceso(113) Then TableExpedirCheque.Visible = True
LimpiaDatos()
@@ -547,7 +548,7 @@ Partial Class Compras_ReembolsosComprobaciones
End If
Else
If drp IsNot Nothing Then
If drp("IdPoliza").ToString.ToEntero > 0 Then
If drp("FolioPoliza").ToString.ToEntero > 0 Then
CvePrePolizaIERegistrado = ObjMov.AddPrePolizas("Compras/Comprobaciones2", 9, TxtImporteVinculado.Text.ToDecimal, TxtImporteVinculado.Text.ToDecimal, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
IdPoliza = drp("IdPoliza").ToString.ToEntero
Else
@@ -749,7 +750,7 @@ Partial Class Compras_ReembolsosComprobaciones
End If
End If
If AplicaPrePolizaPago(CompraActual, Pago, CvePrePolizaPago, ObjMov) Then
If AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePolizaPago, ObjMov) Then
MsgError = "Detalle"
End If
End If
@@ -798,6 +799,7 @@ Partial Class Compras_ReembolsosComprobaciones
CveIEPago = 0
Dim FolioIENew = ObjIE.GetNextFolio(CveCajaChica, 6).ToString
CveIEPago = ObjIE.AddBancos_IE(CveCajaChica, 6, TxtFechaPrePoliza.Text.ToDate, FolioIENew, gvr.DataKey("Proveedor"), ImporteMovto, CveMoneda, 0.0, $"{gvr.DataKey("Proveedor")} F:{gvr.DataKey("SerieFolio")} {If(DdlPersonal.Visible, DdlPersonal.SelectedItem.Text, DdlCajaChica.SelectedItem.Text)}", "", False, True, -1, CvePrePolizaPago, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked Or CveCajaChica > 0, True, False))
TipoCambioPago = 1
End If
End If
@@ -811,7 +813,7 @@ Partial Class Compras_ReembolsosComprobaciones
MsgError = "no se pudo insertar el detalle de la poliza"
End If
If Not AplicaPrePolizaPago(CompraActual, Pago, CvePrePolizaPago, ObjMov) Then
If Not AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePolizaPago, ObjMov) Then
MsgError = "Detalle"
End If

View File

@@ -210,11 +210,11 @@ Partial Class PopUpAuxiliar
e.Row.FCLiteral("LtlConcepto").Text = String.Format("{0}{1}</a>", Liga, e.Row.DBCampo("ConceptoContable"))
End If
If e.Row.DBCampo("CveConceptoContable").Contiene("91", "251") Then 'desaplicar NC
If e.Row.DBCampo("CveConceptoContable").Contiene("91", "251", "301") Then 'desaplicar NC
e.Row.FCLinkButton("LnkDesAplicar").Visible = True
e.Row.FCLinkButton("imgD").Visible = False
If e.Row.DBCampo("CveConceptoContable").Contiene("251") Then
If e.Row.DBCampo("CveConceptoContable").Contiene("251", "301") Then
e.Row.FCLinkButton("LnkDesAplicar").CommandArgument = String.Format("{0}|{1}|{2}", e.Row.DBCampo("CvePrePoliza"), e.Row.DBCampo("CveVenta"), e.Row.DBCampo("CveVentaAmortizacion"))
Else
e.Row.FCLinkButton("LnkDesAplicar").CommandArgument = String.Format("{0}|{1}|{2}", e.Row.DBCampo("CvePrePoliza"), e.Row.DBCampo("CveVentaAmortizacion"), e.Row.DBCampo("CveVenta"))

View File

@@ -434,6 +434,10 @@ Partial Class ContabilidadC_RegPrePolizaS
' TxtEstatus.Text = If(Boolean.Parse(dr("Estatus").ToString), "Activa", "Inactiva")
CvePlantillaPoliza = dr("CvePlantillaPoliza").ToString
If UsuarioActual.CveRol = 1 Then
TxtUsuarioElaboro.ToolTip = dr("Modulo").ToString
End If
If UsuarioActual.CveRol = 1 OrElse UsuarioActual.TienePermisoProceso(221) Then
'DivAgregarConceptos.Visible = True
LnkAddConcepto.Visible = True
@@ -2417,7 +2421,7 @@ Partial Class ContabilidadC_RegPrePolizaS
End If
TipoMov = GlobalDTTipoTransacciones.FiltroPrimeroValor("CveTipoTransaccion", String.Format("TipoTransaccion = '{0}' ", Row("TipoTransferencia"))).ToEntero
TipoNaturaleza = GlobalDTTipoTransacciones.FiltroPrimeroValor("Tipo", String.Format("TipoTransaccion = '{0}' ", Row("TipoTransferencia"))).ToEntero
TipoNaturaleza = GlobalDTTipoTransacciones.FiltroPrimeroValor("Tipo", String.Format("TipoTransaccion = '{0}' ", Row("TipoTransferencia")))
FolioExcel = Row("Folio").ToString.ToEntero
CveTipoTransaccion = TipoMov
@@ -2438,11 +2442,19 @@ Partial Class ContabilidadC_RegPrePolizaS
Exit Sub
End If
If Row("Abono").ToString.ToDecimal > 0 And TipoNaturaleza = "Ing" Or Row("Cargo").ToString.ToDecimal > 0 And TipoNaturaleza = "Egs" Then
If Not (TipoNaturaleza = "Ing" And ((TipoMovto = False And ImporteDocumento >= 0) Or (TipoMovto = True And ImporteDocumento <= 0)) Or
TipoNaturaleza = "Egs" And ((TipoMovto = True And ImporteDocumento >= 0) Or (TipoMovto = False And ImporteDocumento <= 0))) Then
Alert($"El movimiento con cuenta: {NombreCuenta} , importe: {ImporteDocumento.ToString("###,###,###.00")} (registro {ContadorRegistros}), no tiene la naturaleza correcta", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'If Row("Abono").ToString.ToDecimal > 0 And TipoNaturaleza = "Ing" Or Row("Cargo").ToString.ToDecimal > 0 And TipoNaturaleza = "Egs" Then
' Alert($"El movimiento con cuenta: {NombreCuenta} , importe: {ImporteDocumento.ToString("###,###,###.00")} (registro {ContadorRegistros}), no tiene la naturaleza correcta", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
End If
If Row("Abono").ToString.ToDecimal > 0 And Row("Cargo").ToString.ToDecimal > 0 Then

View File

@@ -181,6 +181,11 @@ Partial Class Contabilidad2_RepAnexoCatalogoAnual
Private Sub CargaDatos()
If CveCuenta <= -1 Then
Alert("No hay una cuenta expecificada.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
DTHeaders = New DataTable
DTDatos = New DataTable

View File

@@ -20,7 +20,7 @@
<%--<asp:ImageButton ID="Imprimir" runat="server" alt="Imprimir" src="/Imagenes/btnImprimir.gif" Style="cursor: pointer; height: 20px" />&nbsp;--%>
</li>
<li>
<asp:LinkButton ID="LnkCerrar" runat="server"><i class="fa fa-print"></i> Cerrar Ejercicio</asp:LinkButton>
<asp:LinkButton ID="LnkCerrar" runat="server" visible="false"><i class="fa-solid fa-shield" ></i> Cerrar Ejercicio</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
@@ -603,8 +603,8 @@
</asp:DropDownList>
</div>
<label class="col-md-1 truncate" style="width: 90px;">Cuentas:</label>
<div class="col-md-2" style="width: 125px;">
<asp:DropDownList ID="DdlCuentas" runat="server" CssClass="select2me" DataTextField="CtaCodigo" DataValueField="CveCuenta" Width="100px">
<div class="col-md-5">
<asp:DropDownList ID="DdlCuentas" runat="server" CssClass="select2me" DataTextField="CtaCodigo" DataValueField="CveCuenta" Width="100%">
</asp:DropDownList>
</div>
</div>

View File

@@ -173,6 +173,7 @@ Partial Class AC2_SituacionFinanciera
DdlSubproyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, -1)
DdlSubproyecto.DataBind()
If UsuarioActual.TienePermisoProceso(346) Then LnkCerrar.Visible = True
'DdlEjercicio.SelectedValueExist(UsuarioActual.Empresa.EjercicioActual.ToString)
DdlPeriodo.SelectedValue = Now.Month.ToString

File diff suppressed because it is too large Load Diff

View File

@@ -172,6 +172,10 @@
<DataField>SATClaveUM</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="CodigoObjetoImpuesto">
<DataField>CodigoObjetoImpuesto</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
<rd:DataSetInfo>
<rd:DataSetName>DsOC</rd:DataSetName>
@@ -1411,16 +1415,19 @@
<Width>2.0584cm</Width>
</TablixColumn>
<TablixColumn>
<Width>4.44265cm</Width>
<Width>3.47821cm</Width>
</TablixColumn>
<TablixColumn>
<Width>6.28682cm</Width>
<Width>4.82589cm</Width>
</TablixColumn>
<TablixColumn>
<Width>2.5cm</Width>
</TablixColumn>
<TablixColumn>
<Width>1.6882cm</Width>
</TablixColumn>
<TablixColumn>
<Width>2.43574cm</Width>
<Width>2.33651cm</Width>
</TablixColumn>
</TablixColumns>
<TablixRows>
@@ -1605,6 +1612,42 @@
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox22">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Obj. Imp.</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>9pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox22</rd:DefaultName>
<Style>
<Border>
<Color>#c4d79b</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>#c4d79b</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox84">
@@ -1847,6 +1890,44 @@
</CellContents>
</TablixCell>
<TablixCell />
<TablixCell>
<CellContents>
<Textbox Name="CodigoObjetoImpuesto">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!CodigoObjetoImpuesto.Value</Value>
<Style>
<FontSize>7pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>CodigoObjetoImpuesto</rd:DefaultName>
<Style>
<Border>
<Color>#c4d79b</Color>
<Style>Solid</Style>
</Border>
<TopBorder>
<Style>None</Style>
</TopBorder>
<BottomBorder>
<Style>None</Style>
</BottomBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="PU1">
@@ -2049,7 +2130,7 @@
<TablixBody>
<TablixColumns>
<TablixColumn>
<Width>4.44265cm</Width>
<Width>3.47821cm</Width>
</TablixColumn>
</TablixColumns>
<TablixRows>
@@ -2195,7 +2276,7 @@
<TablixBody>
<TablixColumns>
<TablixColumn>
<Width>6.28682cm</Width>
<Width>4.82589cm</Width>
</TablixColumn>
</TablixColumns>
<TablixRows>
@@ -2337,6 +2418,44 @@
</Tablix>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox29">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Style>
<Color>#c4d79b</Color>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox29</rd:DefaultName>
<Style>
<Border>
<Color>#c4d79b</Color>
<Style>Solid</Style>
</Border>
<TopBorder>
<Style>None</Style>
</TopBorder>
<BottomBorder>
<Style>None</Style>
</BottomBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox15">
@@ -2598,6 +2717,42 @@
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox30">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Style />
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox30</rd:DefaultName>
<Style>
<Border>
<Color>#c4d79b</Color>
<Style>None</Style>
</Border>
<BottomBorder>
<Style>Solid</Style>
</BottomBorder>
<RightBorder>
<Style>Solid</Style>
</RightBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox41">
@@ -2683,6 +2838,7 @@
<TablixMember />
<TablixMember />
<TablixMember />
<TablixMember />
</TablixMembers>
</TablixColumnHierarchy>
<TablixRowHierarchy>
@@ -2708,7 +2864,7 @@
<Top>4.14415cm</Top>
<Left>0.11516cm</Left>
<Height>2.29418cm</Height>
<Width>19.97108cm</Width>
<Width>19.94648cm</Width>
<ZIndex>11</ZIndex>
<Style>
<Border>
@@ -4235,7 +4391,11 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>Version 3.3</Value>
<Value>Version </Value>
<Style />
</TextRun>
<TextRun>
<Value>=Parameters!CFDIVersion.Value</Value>
<Style />
</TextRun>
</TextRuns>
@@ -4246,7 +4406,7 @@
<Top>19.66102cm</Top>
<Left>0.07003cm</Left>
<Height>1.01627cm</Height>
<Width>5.45089cm</Width>
<Width>9.87342cm</Width>
<ZIndex>14</ZIndex>
<Style>
<Border>
@@ -4862,7 +5022,7 @@
<Height>23.58967cm</Height>
<Style />
</Body>
<Width>20.16633cm</Width>
<Width>20.16087cm</Width>
<Page>
<PageFooter>
<Height>0.74111cm</Height>
@@ -5514,6 +5674,18 @@
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
<ReportParameter Name="CFDIVersion">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
<ReportParameter Name="RegimenFiscalCodigo">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
</ReportParameters>
<EmbeddedImages>
<EmbeddedImage Name="Logo2">

File diff suppressed because it is too large Load Diff

View File

@@ -1559,38 +1559,42 @@ Partial Class General_SaldosIniciales
For Each Row As DataRow In dt.Rows
NombreCuenta = Row("NombreCuenta").ToString
CuentaPadre = Row("CuentaPadre").ToString
Dim Cuenta As String = Row("Cuenta").ToString
Dim TipoCuenta As String = Row("TipoCuenta").ToString
Dim AgrupadorSAT As String = Row("AgrupadorSAT").ToString
Dim CveCuentaPadre As Integer = -1
Dim CveAgrupadorSAT As Integer = If(AgrupadorSAT = "0", -1, AgrupadoresSAT.FiltroPrimeroValor("CveAgrupadorSAT", String.Format("CodigoNombre LIKE '%{0}%'", AgrupadorSAT)).ToEntero)
Dim Cuenta As String = Row("Cuenta").ToString.Trim
If Cuenta <> "" Then
NombreCuenta = Row("NombreCuenta").ToString.Trim
CuentaPadre = Row("CuentaPadre").ToString.Trim
If Not CuentaPadre = "" Then
If ObjConta.GetCuentas(-1, CuentaPadre.Replace("-", ""), -1, UsuarioActual.CveEmpresa) Then
If ObjConta.DtResultados.Rows.Count > 0 Then
CveCuentaPadre = ObjConta.DtResultados().FiltroPrimeroValor("Id").ToEntero
Dim TipoCuenta As String = Row("TipoCuenta").ToString.Trim
Dim AgrupadorSAT As String = Row("AgrupadorSAT").ToString.Trim
Dim CveCuentaPadre As Integer = -1
Dim CveAgrupadorSAT As Integer = If(AgrupadorSAT = "0", -1, AgrupadoresSAT.FiltroPrimeroValor("CveAgrupadorSAT", String.Format("CodigoNombre LIKE '%{0}%'", AgrupadorSAT)).ToEntero)
If Not CuentaPadre = "" Then
If ObjConta.GetCuentas(-1, CuentaPadre.Replace("-", ""), -1, UsuarioActual.CveEmpresa) Then
If ObjConta.DtResultados.Rows.Count > 0 Then
CveCuentaPadre = ObjConta.DtResultados().FiltroPrimeroValor("Id").ToEntero
Else
TieneError = True
Exit For
End If
Else
TieneError = True
Exit For
End If
Else
CveCuentaPadre = -2
End If
Dim IdNew = ObjConta.AddCuenta(CveCuentaPadre, Cuenta.Replace("-", ""), NombreCuenta, TipoCuenta, 1, 1, CveEmpresaParam:=UsuarioActual.CveEmpresa, CveAgrupadorSAT:=CveAgrupadorSAT)
If IdNew > 0 Then
ContadorUpdate = ContadorUpdate + 1
Else
TieneError = True
ContadorError = ContadorError + 1
Exit For
End If
Else
CveCuentaPadre = -2
End If
Dim IdNew = ObjConta.AddCuenta(CveCuentaPadre, Cuenta.Replace("-", ""), NombreCuenta, TipoCuenta, 1, 1, CveEmpresaParam:=UsuarioActual.CveEmpresa, CveAgrupadorSAT:=CveAgrupadorSAT)
If IdNew > 0 Then
ContadorUpdate = ContadorUpdate + 1
Else
TieneError = True
ContadorError = ContadorError + 1
Exit For
End If
Next
Else
Alert("No se tienen asociados Agrupadores para esta empresa")
@@ -1598,12 +1602,12 @@ Partial Class General_SaldosIniciales
End If
If Not TieneError Then
ObjConta.Commit()
Alert($"Se agregaron {ContadorUpdate} Cuentas Correctamente y se omitieron: {ContadorError} cuentas.")
Else
Alert($"No pudimos agregar la cuenta en ContaSIG: {NombreCuenta} - Cuenta Padre: {CuentaPadre}", TipoMensaje.MsgError)
ObjConta.RollBack()
End If
Alert($"Se agregaron {ContadorUpdate} Cuentas Correctamente y se omitieron: {ContadorError} cuentas.")
Catch ex As Exception
ObjConta.RollBack()

View File

@@ -357,7 +357,7 @@ Partial Class Inicio
Dim ObjInventarios As New ClsInventarios
If ObjInventarios.RepCompuestosVigencia(-1, -1, MinFecha, Now.AddDays(30), 1, UsuarioActual.CveEmpresa, True) Then
If ObjInventarios.RepCompuestosVigencia(-1, -1, MinFecha, Now.AddYears(1), 1, UsuarioActual.CveEmpresa, -1, UsuarioActual.CveUsuario, True) Then
If ObjInventarios.DtResultados.Rows.Count > 0 Then
GvModalRSCOPorCaducar.DataSource = ObjInventarios.DtResultados

View File

@@ -1411,12 +1411,6 @@ Partial Class Inventarios_EntradasSalidas
tCveSubProyecto = drA2("CveSubProyecto").ToString.ToEntero
End If
If UsuarioActual.CveEmpresa = 119 AndAlso Not tCveSubProyecto.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then
FechaCaducidadVal = MinFecha
FechaCaducidad = MinFecha
Lote = ""
End If
'salida
If Valido AndAlso DdlConcepto.SelectedValue.Contiene({"3", "5", "7", "8", "11", "12", "13", "15", "16", "17", "20", "21", "30", "31"}) Then ' salida de almacen
@@ -4682,11 +4676,6 @@ Partial Class Inventarios_EntradasSalidas
Dim CveSubProyectoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenInventarioFisico.SelectedValue.ToEntero).FiltroPrimeroValor("CveSubProyecto").ToString.ToEntero
If UsuarioActual.CveEmpresa = 119 AndAlso Not CveSubProyectoAlmacen.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then
AplicaLote = False
AplicaCaducidad = False
End If
'activa seccion
ThSeccionEntrada.Visible = AplicaSeccion
TrSeccionEntrada.Visible = AplicaSeccion
@@ -4724,10 +4713,6 @@ Partial Class Inventarios_EntradasSalidas
Dim CveSubProyectoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenInventarioFisico.SelectedValue.ToEntero).FiltroPrimeroValor("CveSubProyecto").ToString.ToEntero
If UsuarioActual.CveEmpresa = 119 AndAlso Not CveSubProyectoAlmacen.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then
AplicaLote = False
AplicaCaducidad = False
End If
'activa seccion
ThSeccionSalida.Visible = AplicaSeccion
TrSeccionSalida.Visible = AplicaSeccion

View File

@@ -66,40 +66,10 @@
<div class="titlefiltros caption ">
<ul class="list-inline">
<li>Cliente:
<ADS:Dropdownlost ID="DdlClientes" CssClassDdl="select2me" runat="server" CssStyle="width: 350px;" DataTextField="NombreComercial" Onselectedindexchange="DdlCliente_SelectedIndexChanged" DataValueField="CveCliente"></ADS:Dropdownlost>
<%--<asp:DropDownList ID="DdlClientes" runat="server" DataValueField="CveCliente" DataTextField="Nombre" OnSelectedIndexChanged="DdlCliente_SelectedIndexChanged" AutoPostBack="true" CssClass="form-control input-sm select2me" Width="350px"></asp:DropDownList>--%>
</li>
<li>Serie-Folio:
<asp:DropDownList ID="DdlFolio" runat="server" DataValueField="CveVenta" DataTextField="SerieFolio" CssClass="form-control input-sm select2me" Width="250px"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVFolio" runat="server" ControlToValidate="DdlFolio" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpBuscar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFolio" runat="server" HighlightCssClass="vco" TargetControlID="RFVFolio" Width="300px"></ajax:ValidatorCalloutExtender>
@@ -108,25 +78,17 @@
</div>
<div class="tools">
<asp:Button ID="BtnBuscar" runat="server" Text="Buscar" OnClick="BtnBuscar_Click" ValidationGroup="GrpBuscar" class="btn btn-primary" />
<%--<a href="javascript:;" class="expand"></a>--%>
</div>
</div>
<div class="portlet-body" style="display: none;">
<%--<ul class="list-inline">
<li>Descripcion:
<asp:Label ID="lbDescripcion" runat="server"></asp:Label>
</li>
</ul>--%>
<div class="portlet-body" style="display: none;">
</div>
</div>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
<div class="row" style="margin-left: 0px; margin-right: 0px;">
<div class="col-md-6">
<%--DATOS DE LA VENTA--%>
@@ -556,7 +518,7 @@
<%--GV DATOS--%>
<asp:GridView ID="GvDatos" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" ShowFooter="True" ShowHeader="true" ShowHeaderWhenEmpty="True"
DataKeyNames="Consec,CvePS,Codigo,CodigoBarras,AplicaSerieLote,CveUM,CantidadC,CantidadF,UM,PS,CveClasificacion,CveVentaDetalle,CveTamaño,AplicaSeccion, AplicaSerie,AplicaLote,AplicaCaducidad" HeaderStyle-CssClass="Titulos" CssClass="table table-striped table-hover Widthall ScrollAD gvInventario mysmallbtn" data-heighterror="450" data-freezerows="1" GridLines="None">
DataKeyNames="Consec,CvePS,Codigo,CodigoBarras,CveUM,CantidadC,CantidadF,UM,PS,CveClasificacion,CveCategoria,CveVentaDetalle,CveTamaño,AplicaSeccion, AplicaSerie,AplicaLote,AplicaCaducidad" HeaderStyle-CssClass="Titulos" CssClass="table table-striped table-hover Widthall ScrollAD gvInventario mysmallbtn" data-heighterror="450" data-freezerows="1" GridLines="None">
<HeaderStyle Height="30px" />
<Columns>
<asp:TemplateField>

View File

@@ -269,14 +269,6 @@ Partial Class Inventarios_EntregaAlmacen
End Set
End Property
Private Property ValidaLoteCaducidad As Boolean
Get
Return CType(ViewState("ValidaLoteCaducidad"), Boolean)
End Get
Set(value As Boolean)
ViewState("ValidaLoteCaducidad") = value
End Set
End Property
#End Region
@@ -606,7 +598,7 @@ Partial Class Inventarios_EntregaAlmacen
CveContrato = drE("CveContrato").ToString().ToEntero()
CveVendedor = drE("CveVendedor").ToString().ToEntero()
CveCliente = drE("CveCliente").ToString().ToEntero()
ClienteEntregaPersonal(CveCliente)
'ClienteEntregaPersonal(CveCliente)
CveSubProyecto = drE("CveSubProyecto").ToString().ToEntero()
EsInterno = CBool(DtDatos.Rows(0)("EsInterno").ToString())
CveDireccionEnvio = drE("CveDireccionEnvio").ToString.ToEntero
@@ -665,17 +657,6 @@ Partial Class Inventarios_EntregaAlmacen
End If
End If
If UsuarioActual.CveEmpresa = 119 Then
Dim CveSubProyectoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacen).FiltroPrimeroValor("CveSubProyecto", "").ToEntero
If CveSubProyectoAlmacen.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then
ValidaLoteCaducidad = True
Else
ValidaLoteCaducidad = False
End If
End If
If Not DtDatos.Columns.Contains("Serie") Then DtDatos.Columns.Add("Serie", GetType(String))
If Not DtDatos.Columns.Contains("Lote") Then DtDatos.Columns.Add("Lote", GetType(String))
@@ -957,7 +938,6 @@ Partial Class Inventarios_EntregaAlmacen
e.Row.FCTextBox("TbCantidadF").Text = "0"
End If
If TipoDocto = "DPe" Then
CveConsecSerie = e.Row.DBCampo("Consec").ToString().ToEntero()
PSSerie = e.Row.DBCampo("PS").ToString()
@@ -995,52 +975,41 @@ Partial Class Inventarios_EntregaAlmacen
e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = True
If DdlAlmacen.SelectedValue.ToEntero() > 0 Then
CargaSeccionesAlmacen(e.Row.FCDropDownList("DdlSeccionAlmacen"), DdlAlmacen.SelectedValue.ToEntero(), e.Row.DBCampo("CvePS").ToEntero(), UsuarioActual.CveEmpresa, True)
'Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero(), e.Row.DBCampo("CvePS").ToEntero())
'e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = dtt
'e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind()
'If dtt.Rows.Count > 1 Then
' e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1"))
'End If
'dtt.Dispose()
End If
Else
e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = False
End If
If (ValidaLoteCaducidad) OrElse (UsuarioActual.CveEmpresa <> 119) Then
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
e.Row.FCTextBox("TxtCaducidad").Visible = True
e.Row.FCLinkButton("LnkCaducidad").Visible = True
e.Row.FCTextBox("TxtCaducidad").ReadOnly = True
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
e.Row.FCTextBox("TxtCaducidad").Visible = True
e.Row.FCLinkButton("LnkCaducidad").Visible = True
e.Row.FCTextBox("TxtCaducidad").ReadOnly = True
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
'si aplica caducidad y viene vacía (posible por venta anterior), que se active su registro
If e.Row.FCTextBox("TxtCaducidad").Text = "" OrElse e.Row.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha Then
e.Row.FCTextBox("TxtCaducidad").ReadOnly = False
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = True
e.Row.FCTextBox("TxtCaducidad").Enabled = True
End If
Else
e.Row.FCTextBox("TxtCaducidad").Visible = False
e.Row.FCLinkButton("LnkCaducidad").Visible = False
'si aplica caducidad y viene vacía (posible por venta anterior), que se active su registro
If e.Row.FCTextBox("TxtCaducidad").Text = "" OrElse e.Row.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha Then
e.Row.FCTextBox("TxtCaducidad").ReadOnly = False
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = True
e.Row.FCTextBox("TxtCaducidad").Enabled = True
End If
Else
e.Row.FCTextBox("TxtCaducidad").Visible = False
e.Row.FCLinkButton("LnkCaducidad").Visible = False
e.Row.FCTextBox("TxtCaducidad").Enabled = True
End If
If CBool(e.Row.DBCampo("AplicaLote")) Then
e.Row.FCTextBox("TxtLote").Visible = True
'si aplica caducidad y viene vacía (posible por venta anterior), que se active su registro
If e.Row.FCTextBox("TxtLote").Text = "" Then
e.Row.FCTextBox("TxtLote").ReadOnly = False
e.Row.FCTextBox("TxtLote").Enabled = True
Else
e.Row.FCTextBox("TxtLote").ReadOnly = True
End If
If CBool(e.Row.DBCampo("AplicaLote")) Then
e.Row.FCTextBox("TxtLote").Visible = True
'si aplica caducidad y viene vacía (posible por venta anterior), que se active su registro
If e.Row.FCTextBox("TxtLote").Text = "" Then
e.Row.FCTextBox("TxtLote").ReadOnly = False
e.Row.FCTextBox("TxtLote").Enabled = True
Else
e.Row.FCTextBox("TxtLote").Visible = False
e.Row.FCTextBox("TxtLote").ReadOnly = True
End If
Else
e.Row.FCTextBox("TxtLote").Visible = False
End If
e.Row.FCButton("BtnDividir").Attributes.Add("onclick", String.Format("Dividir('{0}');", e.Row.FCTextBox("TxtDividir").ClientID))
@@ -1049,19 +1018,27 @@ Partial Class Inventarios_EntregaAlmacen
'FUNCIONALIDAD PISTOLA DE CODIGOS
If UsuarioActual.Empresa.Funcionalidad(132) = "1" And e.Row.DBCampo("CodigoBarras").Trim <> "" Then
e.Row.FCTextBox("TbCantidadF").Text = "0"
If e.Row.DBCampo("CodigoBarras").Trim <> "" AndAlso UsuarioActual.Empresa.Funcionalidad(132) = "1" Then
'NO BLOQUEA PARA ROL AD
If UsuarioActual.CveRol = 1 Then
If AplicaSerie Then
e.Row.FCTextBox("TbCantidadF").Enabled = False
e.Row.FCTextBox("TbCantidadF").Text = "0"
Else
e.Row.FCTextBox("TbCantidadF").Text = e.Row.DBCampo("CantidadF").ToDecimal.ToString("#,##0.######")
End If
End If
If Not UsuarioActual.CveRol = 1 Then
e.Row.FCTextBox("TbCantidadF").Enabled = False
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'acumuladoras
If e.Row.DBCampo("CveCategoria") <> "249" Then
e.Row.FCTextBox("TbCantidadF").Enabled = True
End If
Else
If Not UsuarioActual.CveRol = 1 Then
e.Row.FCTextBox("TbCantidadF").Enabled = False
e.Row.FCTextBox("TbCantidadF").Text = "0"
End If
End If
End If
@@ -1070,7 +1047,6 @@ Partial Class Inventarios_EntregaAlmacen
e.Row.FCCheckBox("cbInv").Enabled = False
End If
End If
End Sub
@@ -1140,9 +1116,9 @@ Partial Class Inventarios_EntregaAlmacen
DtDatosDetalle.Columns.Add("FueTraspaso", GetType(Integer))
End If
End Sub
Private Sub CargaSerie(Optional CerrarCompletado As Boolean = False)
RegistraScript("$('#DivSerie').modal('show')", "show")
Private Sub CargaSerie(Optional CerrarCompletado As Boolean = False, Optional CargaMasivo As Boolean = False)
If Not CargaMasivo Then RegistraScript("$('#DivSerie').modal('show')", "show")
Dim AplicaCaducidad = False
If GlobalDTPS(UsuarioActual.CveEmpresa, ).FiltraParametros("").Rows(0) IsNot Nothing Then
@@ -1196,7 +1172,7 @@ Partial Class Inventarios_EntregaAlmacen
Dim Mensaje As New StringBuilder
Mensaje.AppendFormat("Serie Recomendado: <b>{0}</b>", DtSerie.Rows(0)("Serie"))
If AplicaCaducidad Then Mensaje.AppendFormat(", Caducicdad: <b>{0}</b>", DtSerie.Rows(0)("FechaCaducidad").ToString().ToDate.ToShortDateString)
If AplicaCaducidad Then Mensaje.AppendFormat(", Caducidad: <b>{0}</b>", DtSerie.Rows(0)("FechaCaducidad").ToString().ToDate.ToShortDateString)
LbSerieRecomendado.Text = Mensaje.ToString() 'String.Format("Serie / Lote Recomendado: <b>{0}</b>, Caducicdad: <b>{1}</b>", ObjInventarios.DtResultados.Rows(0)("SerieLote"), ObjInventarios.DtResultados.Rows(0)("FechaCaducidad").ToString().ToDate.ToShortDateString)
Else
LbSerieRecomendado.Text = "No se encontro ningun Serie/Lote."
@@ -1250,7 +1226,7 @@ Partial Class Inventarios_EntregaAlmacen
End If
End Sub
Private Sub AgregaSerie(Serie As String, Tipo As Integer)
Private Sub AgregaSerie(Serie As String, Tipo As Integer, Optional CargaMasivo As Boolean = False)
If Serie.Trim = "" Then
Alert("El campo Serie es obligatorio. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
@@ -1312,7 +1288,7 @@ Partial Class Inventarios_EntregaAlmacen
End If
If Tipo < 3 Then
CargaSerie(True)
CargaSerie(True, cargaMasivo)
End If
End Sub
@@ -1570,8 +1546,7 @@ Partial Class Inventarios_EntregaAlmacen
End If
End If
If Gvr.DataKey("AplicaSerieLote") = "True" Then
If Gvr.DataKey("AplicaSerie") = "True" Then
TdSeriePS.Visible = True
TxtSeriePS.Focus()
@@ -1582,7 +1557,6 @@ Partial Class Inventarios_EntregaAlmacen
Exit Sub
End If
Dim CantidadEspecial = Gvr.DataKey("CveClasificacion").ToString().ToEntero().Contiene(17601, 17881) OrElse Gvr.DataKey("CvePS").ToString().ToEntero().Contiene(343032, 343033)
If CantidadEspecial Then
@@ -1636,7 +1610,7 @@ Partial Class Inventarios_EntregaAlmacen
End If
End Sub
Protected Sub BtnSeriePS_Click(sender As Object, e As EventArgs)
AgregaSerie(TxtSeriePS.Text.Trim, 2)
AgregaSerie(TxtSeriePS.Text.Trim, 2, True)
TdSeriePS.Visible = False
TxtSeriePS.Text = ""
@@ -1719,11 +1693,9 @@ Partial Class Inventarios_EntregaAlmacen
Next
If (Not ValidaLoteCaducidad) OrElse (UsuarioActual.CveEmpresa <> 119) Then
ValidaSeccion = False
ValidaCaducidad = False
ValidaLote = False
End If
ValidaSeccion = False
ValidaCaducidad = False
ValidaLote = False
If ValidaSeccion Then
Alert("La sección de almacen no ha sido especificada en todos los productos.", TipoMensaje.MsgAdvertencia)
@@ -1866,11 +1838,6 @@ Partial Class Inventarios_EntregaAlmacen
FechaCaducidad = If(CBool(Dr("AplicaCaducidad")) AndAlso Dr("FechaCaducidad").ToString() <> "", Dr("FechaCaducidad").ToString().ToDate, MinFecha)
Lote = If(CBool(Dr("AplicaLote")), Dr("Lote").ToString().Trim, "-1")
If Not ValidaLoteCaducidad Then
FechaCaducidad = MinFecha
Lote = "-1"
End If
If Dr("CantidadGV").ToString().ToDecimal > 0 Then
If CBool(Dr("AplicaSerie")) Then
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec")))
@@ -2076,15 +2043,14 @@ Partial Class Inventarios_EntregaAlmacen
Next
End If
If Not ErrorMovInv AndAlso CveMovimientoSalida > 0 Then
If Not ErrorMovInv AndAlso CveMovimientoSalida > 0 AndAlso TipoDocto.Contiene("Rem") Then
Dim CvePrePolizaSinCosto As Integer = ObjConta.AddPrePolizas("EA/SinCost", 53, 0, 0, 1, TxtFecha.Text.ToDate, "Entrega", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CvePrePolizaSinCosto > 0 Then
If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePolizaSinCosto, True, 0, 0, 68, TxtObservaciones.Text, TxtObservaciones.Text, -1, -1, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=False) Then
ErrorMovInv = True
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaSinCosto, False, 0, 0, 68, TxtObservaciones.Text, TxtObservaciones.Text, -1, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, Contabilizable:=False) Then
If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePolizaSinCosto, False, 0, 0, 68, TxtObservaciones.Text, TxtObservaciones.Text, -1, -1, CveMovimientoAlmacen:=CveMovimientoEntradaApartado, Contabilizable:=False) Then
ErrorMovInv = True
End If
@@ -2152,12 +2118,6 @@ Partial Class Inventarios_EntregaAlmacen
CantidadPendiente = 1
'If CBool(Dr("AplicaSeccion")) Then
' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, Dr2("CveAlmacen").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero()).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero()
' Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", Dr2("CveAlmacen"), Dr("CvePS"), CveSeccionAlmacen)
'Else
' CveSeccionAlmacen = -1
'End If
CveSeccionAlmacen = -3
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadPendiente.ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), 0, Serie:=Dr1("Serie").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=CveSeccionAlmacen) Then
@@ -2529,7 +2489,7 @@ Partial Class Inventarios_EntregaAlmacen
If TipoMovimiento = 2 AndAlso DtExistencias IsNot Nothing Then
'CveSeccionAlmacen = DtExistencias.FiltroPrimeroValor("CveSeccionAlmacen", $"ISNULL(CveTipoAlmacenDevolucion,0) <> 26 AND CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToEntero
PU = DtExistencias.FiltroPrimeroValor("PU", $"CveTipoAlmacenDevolucion <> 26 AND CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToDecimal
PU = DtExistencias.FiltroPrimeroValor("PU", $"ISNULL(CveTipoAlmacenDevolucion,-1) <> 26 AND CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToDecimal
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, Serie:=Dr1("Serie").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), CveVentaDetalleRemision:=Dr("CveVentaDetalleRemision").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=-3) Then

View File

@@ -28,14 +28,6 @@ Partial Class Inventarios_RecepcionAlmacen
End Set
End Property
Private Property ValidaLoteCaducidad As Boolean
Get
Return CType(ViewState("ValidaLoteCaducidad"), Boolean)
End Get
Set(value As Boolean)
ViewState("ValidaLoteCaducidad") = value
End Set
End Property
Private Property CveTipoAlmacen As Integer
Get
Return CType(ViewState("CveTipoAlmacen"), Integer)
@@ -606,21 +598,11 @@ Partial Class Inventarios_RecepcionAlmacen
Dim drr As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero).FiltroPrimero("")
If drr IsNot Nothing Then
'("CveSubProyecto").ToEntero
Dim CveSubProyecto As Integer = drr("CveSubProyecto").ToString.ToEntero
'RMF condición temporal
If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyecto.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then
ValidaLoteCaducidad = True
Else
ValidaLoteCaducidad = False
End If
CveTipoAlmacen = drr("CveTipoAlmacen").ToString.ToEntero
End If
CargaGVInv()
'For Each Gvr As GridViewRow In GvInv.Rows
' If Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue = "-1" Then
@@ -1412,6 +1394,9 @@ Partial Class Inventarios_RecepcionAlmacen
If Not TmDT.Columns.Contains("CantidadSeleccionada") Then
TmDT.Columns.Add("CantidadSeleccionada", GetType(Decimal))
End If
If Not TmDT.Columns.Contains("CveCategoria") Then
TmDT.Columns.Add("CveCategoria", GetType(Integer))
End If
GvInv.Columns(2).Visible = False
@@ -1490,6 +1475,10 @@ Partial Class Inventarios_RecepcionAlmacen
e.Row.FCButton("BtnSerie").Visible = False
e.Row.FCTextBox("TbCantidadF").Enabled = True
e.Row.FCCheckBox("cbInv").Enabled = True
If UsuarioActual.TienePermisoProceso(345) Then 'carga la cantidad con el rol AD
e.Row.FCTextBox("TbCantidadF").Text = e.Row.DBCampo("CantidadF").FormatoNumero
End If
End If
End If
@@ -1517,7 +1506,7 @@ Partial Class Inventarios_RecepcionAlmacen
e.Row.FCTextBox("TbCantidadF").Text = e.Row.DBCampo("CantidadF").FormatoNumero
e.Row.FCTextBox("TbCantidadF").Enabled = False
End If
If UsuarioActual.CveRol = 1 Then 'carga la cantidad con el rol AD
If UsuarioActual.TienePermisoProceso(345) Then 'carga la cantidad con el rol AD
e.Row.FCTextBox("TbCantidadF").Text = e.Row.DBCampo("CantidadF").FormatoNumero
End If
End If
@@ -1547,23 +1536,20 @@ Partial Class Inventarios_RecepcionAlmacen
e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = False
End If
If (ValidaLoteCaducidad) OrElse (UsuarioActual.CveEmpresa <> 119) Then
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
e.Row.FCTextBox("TxtCaducidad").Visible = True
e.Row.FCLinkButton("LnkCaducidad").Visible = True
e.Row.FCTextBox("TxtCaducidad").Text = Now.ToShortDateString
e.Row.FCTextBox("TxtDividir").Visible = True
Else
e.Row.FCTextBox("TxtCaducidad").Visible = False
e.Row.FCLinkButton("LnkCaducidad").Visible = False
End If
If CBool(e.Row.DBCampo("AplicaLote")) Then
e.Row.FCTextBox("TxtLote").Visible = True
Else
e.Row.FCTextBox("TxtLote").Visible = False
End If
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
e.Row.FCTextBox("TxtCaducidad").Visible = True
e.Row.FCLinkButton("LnkCaducidad").Visible = True
e.Row.FCTextBox("TxtCaducidad").Text = Now.ToShortDateString
e.Row.FCTextBox("TxtDividir").Visible = True
Else
e.Row.FCTextBox("TxtCaducidad").Visible = False
e.Row.FCLinkButton("LnkCaducidad").Visible = False
End If
If CBool(e.Row.DBCampo("AplicaLote")) Then
e.Row.FCTextBox("TxtLote").Visible = True
Else
e.Row.FCTextBox("TxtLote").Visible = False
End If
e.Row.FCButton("BtnDividir").Attributes.Add("onclick", String.Format("Dividir('{0}');", e.Row.FCTextBox("TxtDividir").ClientID))
@@ -1574,6 +1560,11 @@ Partial Class Inventarios_RecepcionAlmacen
'FUNCIONALIDAD PISTOLA DE CODIGOS
If UsuarioActual.Empresa.Funcionalidad(132) = "1" And e.Row.DBCampo("CodigoBarras").Trim <> "" And Not UsuarioActual.TienePermisoProceso(174) Then
e.Row.FCTextBox("TbCantidadF").Enabled = False
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'acumuladoras
If e.Row.DBCampo("CveCategoria") <> "249" Then
e.Row.FCTextBox("TbCantidadF").Enabled = True
End If
End If
End If
If e.Row.DBCampo("CantidadF").ToDecimal = 0 Then
@@ -1623,7 +1614,7 @@ Partial Class Inventarios_RecepcionAlmacen
Dim TxtCantidad = GvInv.Rows(Gvr.RowIndex).FCTextBox("TbCantidadF")
If Gvr.DataKey("CantidadF").ToDecimal - TxtCantidad.Text.ToDecimal - 1 >= 0 Then
If Gvr.DataKey("AplicaSerieLote") = "True" Then
If Gvr.DataKey("AplicaSerie") = "True" Then
TdSeriePS.Visible = True
TxtSeriePS.Focus()
@@ -1690,11 +1681,14 @@ Partial Class Inventarios_RecepcionAlmacen
End Sub
Protected Sub BtnSeriePS_Click(sender As Object, e As EventArgs)
AgregaSerie(TxtSeriePS.Text.Trim, 2)
AgregaSerie(TxtSeriePS.Text.Trim, 2, CargaMasivaSeries:=True)
TdSeriePS.Visible = False
TxtSeriePS.Text = ""
TxtCodigoPS.Text = ""
TxtCodigoPS.Focus()
UPInv.Update()
GvInv.DataSource = DtInv
GvInv.DataBind()
End Sub
Protected Sub BtnGuardarCantidadEspecial_Click(sender As Object, e As EventArgs)
AgregaCantidadEspecial()
@@ -1792,7 +1786,6 @@ Partial Class Inventarios_RecepcionAlmacen
DtInv.AcceptChanges()
Next
UPInv.Update()
UpSerie.Update()
TxtSerie.Text = ""
@@ -1831,7 +1824,7 @@ Partial Class Inventarios_RecepcionAlmacen
End If
'PARA VALIDAR SI LA SERIE ES IGUAL AL CODIGO O CODIGOBARRAS
If Serie.ToUpper = dr("Codigo").ToString.ToUpper Or Serie.ToUpper = dr("CodigoBarras").ToString.ToUpper Then
If Serie.ToUpper = dr("Codigo").ToString.ToUpper OrElse Serie.ToUpper = dr("CodigoBarras").ToString.ToUpper Then
MensajeAlert.Append($"<br/> El numero de Serie <b>{Serie}</b> coincide con el codigo o codigo de barras del producto. Por favor rectifique y vuelva a intentar.")
Continue For
End If
@@ -1846,20 +1839,21 @@ Partial Class Inventarios_RecepcionAlmacen
Dim MensajeSinExistencias As New StringBuilder
Dim ObjInventarios As New ClsInventarios
Dim Index = 0
Dim Cantidad As Integer = LbCantidad.Text.ToEntero
If CargaMasivaSeries Then Cantidad = DtInv.FiltroPrimeroValor("CantidadF", "Consec = " & CveConsecSerie).ToEntero
'DtInv
For Each Serie In SeriesArreglo
If Serie <> "" Then
Dim Row = DtDatosDetalle.NewRow
Dim Row = DtDatosDetalle.NewRow
Index = Index + 1
If Index > LbCantidad.Text.ToEntero Then
Exit For
End If
If Index > Cantidad Then Exit For
'VALIDA QUE SIGA AGREGANDO
If Not DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerie)).Rows.Count < LbCantidad.Text.ToEntero Then
Exit For
If Not DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerie)).Rows.Count < Cantidad Then
MensajeAlert.Append("series cargadas en su totalidad") : Exit For
End If
'VERIFICA EXISTENCIAS
@@ -2281,12 +2275,6 @@ Partial Class Inventarios_RecepcionAlmacen
Index += 1
Next
If (Not ValidaLoteCaducidad) OrElse (UsuarioActual.CveEmpresa <> 119) Then
ValidaSeccion = False
ValidaCaducidad = False
ValidaLote = False
End If
If ValidaSeccion Then
Alert("La sección de almacen no ha sido especificada en todos los productos.", TipoMensaje.MsgAdvertencia)
Return False
@@ -2327,7 +2315,7 @@ Partial Class Inventarios_RecepcionAlmacen
End If
End If
Dim Existencia = ObjInventarios.GetExistenciasPS(gvr.DataKey("CvePS").ToEntero, gvr.DataKey("CveUM").ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"))
Dim Existencia = ObjInventarios.GetExistenciasPS(gvr.DataKey("CvePS").ToEntero, gvr.DataKey("CveUM").ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:= (TxtFecha.Text & " " & Now.ToShortTimeString).ToDateTime.ToString("yyyy/MM/dd HH:mm"))
If Existencia < ExistenciaActual Then
MensajeExistencias.Append($"Producto: <b>{GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=gvr.DataKey("CvePS").ToString.ToEntero).FiltroPrimeroValor("PSCodigo")}</b>.</br>")
Continue For
@@ -3254,6 +3242,12 @@ Partial Class Inventarios_RecepcionAlmacen
End If
Else
Dim CveTipoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero()).FiltroPrimeroValor("CveTipoAlmacen").ToEntero()
If CveTipoAlmacen = 21 Then 'tipo: devs a proveedore
RealizarMovimientoVirtual = False
End If
If RealizarMovimientoVirtual Then
Dim DtPSVirtual As New DataTable("DtTamanios")

View File

@@ -1082,7 +1082,7 @@ Partial Class Inventarios_RecepcionUsados
If Valido And AgregarUsado Then
If ObjFactura IsNot Nothing AndAlso Me.CveRemisionRecibida > 0 Then
Dim RowDetalle As DataRow = ObjFactura.DtDetalle.FiltroPrimero($"CvePS={CvePS}")
Dim RowDetalle As DataRow = ObjFactura.DtDetalle.FiltroPrimero($"CveVentaDetalle={CveVentaDetalle}")
If RowDetalle IsNot Nothing Then

View File

@@ -57,11 +57,11 @@ public partial class Inventarios_RepProductosPorCaducar : ClsPaginas
DTDatos = ObjInventarios.DtResultados;
if (DdlOpcion.SelectedValue == "1")
{
GvDatos.Columns[4].HeaderText = "F.Elaboración";
GvDatos.Columns[5].HeaderText = "F.Elaboración";
}
else
{
GvDatos.Columns[4].HeaderText = "F.Caducidad";
GvDatos.Columns[5].HeaderText = "F.Caducidad";
}
}
@@ -230,11 +230,11 @@ public partial class Inventarios_RepProductosPorCaducar : ClsPaginas
{
if (ChkTiempoCaducidad.Checked)
{
GvDatos.Columns[5].Visible = true;
GvDatos.Columns[6].Visible = true;
}
else
{
GvDatos.Columns[5].Visible = false;
GvDatos.Columns[6].Visible = false;
}
CargarDatos();//Si no se recarga no se muestran los valores dela la columna de tiempo caducindad laprimera vez que pasa de oculta a mostrarse
UpDatos.Update();

View File

@@ -13,7 +13,7 @@
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Rep RSCO
Reporte RSCO
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>

View File

@@ -657,7 +657,7 @@
<div class="col-md-12">
<asp:UpdatePanel runat="server" ID="UpDatosRecepcion" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatosRecepcion" DataKeyNames="CveMovimiento,CveUM,CvePS,PS,CveAF,CodigoBarras,CveAlmacen,CveAlmacenDestino,AplicaSerie,CveMovimientoDetalle,CveMovimientoDetalleTransitorio,PU,CveAlmacenSalida,CveMovimientoSalida,Serie,Lote,FechaCaducidad,Cantidad, GastoIndirectoSalida, Importe,Codigo" runat="server" AutoGenerateColumns="False" EmptyDataText="No hay movimientos pendientes" ToolTip="Listado de Movimientos" CssClass="table table-hover Widthall" GridLines="None">
<asp:GridView ID="GvDatosRecepcion" DataKeyNames="CveMovimiento,CveUM,CvePS,PS,CveAF,CodigoBarras,CveAlmacen,CveAlmacenDestino,AplicaSerie,CveMovimientoDetalle,CveMovimientoDetalleTransitorio,PU,CveAlmacenSalida,CveMovimientoSalida,Serie,Lote,FechaCaducidad,Cantidad, GastoIndirectoSalida, Importe,Codigo,CveAlmacenTransitorioVirtual" runat="server" AutoGenerateColumns="False" EmptyDataText="No hay movimientos pendientes" ToolTip="Listado de Movimientos" CssClass="table table-hover Widthall" GridLines="None">
<Columns>
<asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
<%--<HeaderTemplate>

View File

@@ -365,7 +365,7 @@ Partial Class Inventarios_TraspasoAlmacen
Private Sub CargaMovimientoGarantia(CveFolioGarantia As Integer)
Using ObjAcum As New ClsAcumuladores
If ObjAcum.GetFoliosGarantiasDetalle(CveFolioGarantia) Then
If ObjAcum.GetFoliosGarantiasDetalle(CveFolioGarantia, CveEstatusConsecutivo:=1) Then
''carga
Dim dra As DataRow = ObjAcum.DtResultados(0)
DivMov.Visible = True
@@ -572,7 +572,7 @@ Partial Class Inventarios_TraspasoAlmacen
If TxtnSerie.Visible Then
Cantidad = 1
If String.IsNullOrEmpty(TxtnSerie.Text.Trim()) OrElse String.IsNullOrWhiteSpace(TxtnSerie.Text.Trim()) Then
Alert("Serie es necesario", TipoMensaje.MsgAdvertencia)
Alert("Serie es necesario.", TipoMensaje.MsgAdvertencia)
RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'')")
Exit Sub
End If
@@ -597,14 +597,14 @@ Partial Class Inventarios_TraspasoAlmacen
'codigo provisional.
Dim CveSubP As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenOrigen.SelectedValue.ToEntero).FiltroPrimeroValor("CveSubProyecto", "").ToEntero
If DrPS("AplicaCaducidad").ToString = "True" AndAlso CveSubP.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then
If DrPS("AplicaCaducidad").ToString = "True" Then
If Not ChkSugiereFechaCaducidad.Checked AndAlso (TxtnFechaCaducidad.Text = "" OrElse TxtnLote.Text = "") Then
Alert("Falta Especificar lote/Fecha del producto", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
If DrPS("AplicaCaducidad").ToString = "True" AndAlso ChkSugiereFechaCaducidad.Checked And CveSubP.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then
If DrPS("AplicaCaducidad").ToString = "True" AndAlso ChkSugiereFechaCaducidad.Checked Then
Dim ObjInventarios As New ClsInventarios
If ObjInventarios.GetExistenciasCaducidad(CveProducto, DdlAlmacenOrigen.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue) Then
@@ -641,12 +641,7 @@ Partial Class Inventarios_TraspasoAlmacen
tLote = If(TxtnLote.Visible, TxtnLote.Text, "-1")
tCaducidad = If(TxtnFechaCaducidad.Visible, TxtnFechaCaducidad.Text.ToDate, MinFecha)
If Not CveSubP.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then
tLote = "-1"
tCaducidad = MinFecha
End If
Dim tSerie As String = If(TxtnSerie.Visible, TxtnSerie.Text, "-1")
Dim tSerie As String = If(TxtnSerie.Visible, TxtnSerie.Text, "-1").Trim
Dim Valido = ValidaExistencia(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedValue.ToEntero, tSerie, tLote, tCaducidad)
@@ -725,14 +720,12 @@ Partial Class Inventarios_TraspasoAlmacen
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If ChkEmitirTimbrado.Checked AndAlso ChkEmitirCartaPorte.Checked Then
If Not ValidaPSSAT(DrPS) Then
Exit Sub
End If
End If
If DrPS IsNot Nothing Then
CveClasificacion = DrPS("CveClasificacion").ToString.ToEntero
Dim DrUM = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimero($"CveUnidadMedida = {CveUnidadMedida}")
@@ -745,7 +738,7 @@ Partial Class Inventarios_TraspasoAlmacen
registro.Item("CvePS") = CvePS
registro.Item("PS") = DrPS("PSCodigo")
registro.Item("Observaciones") = Observaciones
registro.Item("Serie") = Serie
registro.Item("Serie") = Serie.Trim
registro.Item("Lote") = Lote
If FechaCaducidad > MinFecha Then registro.Item("FechaCaducidad") = FechaCaducidad
registro.Item("CveClasificacion") = CveClasificacion
@@ -902,6 +895,11 @@ Partial Class Inventarios_TraspasoAlmacen
RealizarMovimientoVirtual = True
End If
'SI VA PASAR POR EL ALMACEN TRANSITORIO, DEBE TRASPASAR LOS VIRTUALES AHI PRIMERO
If ChkTransitorio.Checked Then
CveAlmacenVirtualEntrada = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenTransitorio.SelectedValue.ToEntero).FiltroPrimero("")("CveAlmacenVirtual").ToString().ToEntero()
End If
'VALIDA ALMACEN DISTINTA SUCURSAL DEBE SER TRANSITORIO
If Not UsuarioActual.CveEmpresa.Contiene(7, 140) Then '[IPP] EMPRESA VIGILANCIA NO OCUPA TRANSITORIOS - TIENEN MIL SUCURSALES Xd
If Not ChkTransitorio.Checked Then
@@ -1129,6 +1127,7 @@ Partial Class Inventarios_TraspasoAlmacen
dtvirtual = ObjInventario.DtResultados
If dtvirtual.Rows.Count > 0 Then
'SALIDA VIRTUAL
CveMovimientoVirtualSalida = ObjInventario.AddMovimiento(CveAlmacenVirtualSalida, 37, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/V", CveMovimientoRelacionado:=CveMovimientoSalida, CveAlmacenDestino:=CveAlmacenVirtualEntrada)
FolioVirtualSalida = ObjInventario.Folio
Dim Contabilizable As Boolean = False
@@ -1148,9 +1147,9 @@ Partial Class Inventarios_TraspasoAlmacen
End If
Next
'SALIDA VIRTUAL
'ENTRADA VIRTUAL
Dim importevirtual As Decimal = 0
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtualSalida, 36, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/S3", CveMovimientoRelacionado:=CveMovimientoEntrada, CveAlmacenDestino:=CveAlmacenVirtualEntrada)
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtualEntrada, 36, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/S3", CveMovimientoRelacionado:=CveMovimientoEntrada, CveAlmacenDestino:=CveAlmacenVirtualEntrada)
FolioVirtualEntrada = ObjInventario.Folio
If CveMovimientoVirtualEntrada > 0 Then
Dim DtCostosVirtual As DataTable
@@ -1487,7 +1486,7 @@ Partial Class Inventarios_TraspasoAlmacen
Private Sub CargaGvDatos()
EscondeColumnasGVM(DtMovimientos)
GvDatos.DataSource = DtMovimientos
GvDatos.DataSource = DtMovimientos.FiltraParametros("", "No desc")
GvDatos.DataBind()
UpDatos.Update()
End Sub
@@ -1799,13 +1798,6 @@ Partial Class Inventarios_TraspasoAlmacen
If CBool(e.Row.DBCampo("AplicaSeccion")) AndAlso DdlAlmacenRecepcion.SelectedValue.ToEntero > 0 Then
CargaSeccionesAlmacen(e.Row.FCDropDownList("DdlSeccionAlmacen"), DdlAlmacenRecepcion.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero, UsuarioActual.CveEmpresa)
'Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenRecepcion.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero)
'e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = dtt
'e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind()
'If dtt.Rows.Count > 1 Then
' e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1"))
'End If
'dtt.Dispose()
End If
@@ -1822,9 +1814,12 @@ Partial Class Inventarios_TraspasoAlmacen
'FUNCIONALIDAD PISTOLA DE CODIGOS
If UsuarioActual.Empresa.Funcionalidad(132) = "1" And e.Row.DBCampo("CodigoBarras").Trim <> "" Then
e.Row.FCTextBox("TxtCantidad").Enabled = False
If e.Row.DBCampo("CveCategoria") <> "249" Then
e.Row.FCTextBox("TxtCantidad").Enabled = True
End If
End If
End If
End If
End Sub
Protected Sub BtnCancelarTraspaso_Click(sender As Object, e As EventArgs)
@@ -1839,6 +1834,8 @@ Partial Class Inventarios_TraspasoAlmacen
Dim TextoError As String = ""
Dim Fecha As Date = TxtFechaRecepcion.Text.ToDate
Dim CveMovimientoVirtualEntrada As Integer = 0
Dim CveMovimientoVirtualSalida As Integer = 0
Dim CveMovimientoSalidaTransitorio As Integer = 0
Dim FolioVirtualEntrada As Integer = 0
@@ -1922,6 +1919,7 @@ Partial Class Inventarios_TraspasoAlmacen
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero).FiltroPrimeroValor("CveAlmacenVirtual", "").ToEntero()
Dim CveAlmacenVirtualSalida As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacenTransitorio).FiltroPrimeroValor("CveAlmacenVirtual", "").ToEntero()
'SI EL ALMACEN ORIGEN ES DE APOPYO LOGISTICO EL ALMACEN VIRTUAL DEBE SER DE APOYO LOGISTICO
'Dim CveAlmacenVirtual As Integer = -1
@@ -1932,15 +1930,21 @@ Partial Class Inventarios_TraspasoAlmacen
'End If
'VERIFICA SI TIENE ALMACEN VIRTUAL ASIGNADA
If CveAlmacenVirtual > 0 Then
If CveAlmacenVirtual > 0 And CveAlmacenVirtualSalida > 0 Then
Dim dtvirtual As DataTable = Nothing
Dim importePoliza As Decimal = 0
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoEntrada, UsuarioActual.CveEmpresa, CveMovimientoRelacionado:=CveMovimientoSalida) Then
dtvirtual = ObjInventario.DtResultados
If dtvirtual.Rows.Count > 0 Then
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 36, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveMovimientoRelacionado:=CveMovimientoEntrada, Modulo:="TA/C2")
CveMovimientoVirtualSalida = ObjInventario.AddMovimiento(CveAlmacenVirtualSalida, 37, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveMovimientoRelacionado:=CveMovimientoSalidaTransitorio, Modulo:="TA/C3")
FolioVirtualEntrada = ObjInventario.Folio
For Each RowVirtual As DataRow In dtvirtual.Rows
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
Dim CantidadUsado As Decimal = RowVirtual("Cantidad").ToString().ToDecimal()
@@ -1948,21 +1952,54 @@ Partial Class Inventarios_TraspasoAlmacen
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
Dim CostoIndirecto As Decimal = RowVirtual("CostoIndirecto").ToString().ToDecimal()
importePoliza = importePoliza + (CantidadUsado * PU)
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualEntrada, CantidadUsado, CveUM, CvePS, PU, -1, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorMovInv = True
Exit For
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualSalida, CantidadUsado, CveUM, CvePS, PU, -1, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorMovInv = True
Exit For
End If
Next
End If
Else
TextoError = "No se pudo registrar el movimiento virtual"
ErrorMovInv = True
'Else
' TextoError = "No se pudo registrar el movimiento virtual"
' ErrorMovInv = True
End If
If Not ErrorMovInv AndAlso (CveMovimientoSalida > 0 And CveMovimientoVirtualEntrada > 0) Then
Dim CvePrePolizaMovVirtual As Integer = ObjConta.AddPrePolizas("TA/C2|TA/C3", 53, importePoliza, importePoliza, 1, TxtFecha.Text.ToDate, "TA/C2|TA/C3", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CvePrePolizaMovVirtual > 0 Then
If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePolizaMovVirtual, True, importePoliza, importePoliza, 68, TxtObservacionesRecepcion.Text, TxtObservacionesRecepcion.Text, -1, -1, CveMovimientoAlmacen:=CveMovimientoVirtualSalida, Contabilizable:=False) Then
ErrorMovInv = True
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaMovVirtual, False, importePoliza, importePoliza, 68, TxtObservacionesRecepcion.Text, TxtObservacionesRecepcion.Text, -1, -1, CveMovimientoAlmacen:=CveMovimientoVirtualEntrada, Contabilizable:=False) Then
ErrorMovInv = True
End If
Else
ErrorMovInv = True
End If
End If
'Else
' TextoError = "La Sucursal no tiene creado un almacen virtual"
' ErrorMovInv = True
End If
End If
If Not ErrorMovInv Then
@@ -2127,11 +2164,6 @@ Partial Class Inventarios_TraspasoAlmacen
Dim tSerie As String = gvr.FCTextBox("TxtSerie").Text 'gvr.DataKey("Serie").ToString
Dim tFechaCaducidad As Date = gvr.DataKey("FechaCaducidad").ToDate
If CveSubProyectoRecibe.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then
tLote = gvr.FCTextBox("TxtLote").Text
tFechaCaducidad = gvr.FCTextBox("TxtCaducidad").Text.ToDate
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, PrecioEntrada, CveAF:=gvr.DataKey("CveAF").ToString.ToEntero, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, Serie:=tSerie, Lote:=tLote, FechaCaducidad:=tFechaCaducidad, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de salida"
@@ -2324,44 +2356,39 @@ Partial Class Inventarios_TraspasoAlmacen
#Region " AGREGA CON TXT | CODIGO - SERIE "
Protected Sub BtnCodigoPS_Click(sender As Object, e As EventArgs)
If TxtCodigoPS.Text = "" Then
Exit Sub
End If
If TxtCodigoPS.Text = "" Then Exit Sub
TdSeriePS.Visible = False
Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras = '{TxtCodigoPS.Text}'")
Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras = '{TxtCodigoPS.Text.Trim}'")
If DrPS Is Nothing Then
Alert($"No se ha encontrado un producto del Codigo ""<b>{TxtCodigoPS.Text}</b>"". ", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus,200);")
Alert($"No se ha encontrado un producto del Código: ""<b>{TxtCodigoPS.Text}</b>"". ", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus,200);")
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
TxtCodigoPS.Text = ""
Exit Sub
End If
If DrPS("Inv_CveMetodoInventario").ToString.ToEntero = 5 Then
If DrPS("AplicaSerie").ToString = "True" Then
TdSeriePS.Visible = True
TxtSeriePS.Focus()
CvePSSerie = DrPS("CvePS").ToString.ToEntero
CveUMSerie = DrPS("CveUnidadMedida").ToString.ToEntero
Exit Sub
Else
AgregarPS(1, DrPS("CvePS").ToString.ToEntero, DrPS("CveUnidadMedida").ToString.ToEntero)
TxtCodigoPS.Text = ""
End If
AgregarPS(1, DrPS("CvePS").ToString.ToEntero, DrPS("CveUnidadMedida").ToString.ToEntero)
TxtCodigoPS.Text = ""
End Sub
Protected Sub BtnSeriePS_Click(sender As Object, e As EventArgs)
If TxtSeriePS.Text.Trim = "" Then
Exit Sub
End If
If TxtSeriePS.Text.Trim = "" Then Exit Sub
txtCantidad.Text = "1"
Dim Valido = ValidaExistencia(1, CvePSSerie, CveUMSerie, -1, TxtSeriePS.Text.Trim, "-1", MinFecha)
If Valido Then
AgregarPS(1, CvePSSerie, CveUMSerie, TxtSeriePS.Text.Trim)
AgregarPS(1, CvePSSerie, CveUMSerie, Serie:=TxtSeriePS.Text.Trim.ToUpper)
Else
TxtSeriePS.Text = ""
TxtSeriePS.Focus()
@@ -2413,7 +2440,7 @@ Partial Class Inventarios_TraspasoAlmacen
If Existe Then
Alert($"Ya se ha cargado la totalidad del Producto ""<b>{PSTemp}</b>"" con el Codigo ""<b>{TxtCodigoPSRecepcion.Text}</b>"".", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus1,200);")
Else
Alert($"No se ha encontrado un producto para surtir con el Codigo ""<b>{TxtCodigoPSRecepcion.Text}</b>"". ", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus1,200);")
Alert($"No se ha encontrado un producto para surtir con el Código: ""<b>{TxtCodigoPSRecepcion.Text}</b>"".", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus1,200);")
End If
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
@@ -2427,7 +2454,7 @@ Partial Class Inventarios_TraspasoAlmacen
End If
For Each Gvr As GridViewRow In GvDatosRecepcion.Rows
If Gvr.DataKey("CodigoBarras") = TxtCodigoPSRecepcion.Text.Trim And Gvr.DataKey("Serie") = TxtSeriePSRecepcion.Text.Trim Then
If Gvr.DataKey("CodigoBarras") = TxtCodigoPSRecepcion.Text.Trim And Gvr.DataKey("Serie") = TxtSeriePSRecepcion.Text.Trim.ToUpper Then
Dim TxtCantidad = GvDatosRecepcion.Rows(Gvr.RowIndex).FCTextBox("TxtCantidad")
If Gvr.DataKey("Cantidad").ToDecimal - TxtCantidad.Text.ToDecimal - 1 >= 0 Then
@@ -2439,15 +2466,15 @@ Partial Class Inventarios_TraspasoAlmacen
Exit Sub
End If
Alert($"Ya se ha cargado la totalidad del Producto ""<b>{Gvr.DataKey("PS").ToString}</b>"" con el Codigo ""<b>{TxtCodigoPSRecepcion.Text}</b>"".", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus1,200);")
Alert($"Ya se ha cargado la totalidad del Producto ""<b>{Gvr.DataKey("PS").ToString}</b>"" con el Código ""<b>{TxtCodigoPSRecepcion.Text}</b>"".", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus1,200);")
RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'')")
End If
Next
Alert($"No se ha encontrado un producto para surtir con el Codigo ""<b>{TxtCodigoPSRecepcion.Text}</b>"". ", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus1,200);")
Alert($"No se ha encontrado un producto para surtir con el Codigo ""<b>{TxtCodigoPSRecepcion.Text}</b>"". Serie:{TxtSeriePSRecepcion.Text.Trim} ", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus1,200);")
RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'')")
'Alert($"Ya se han cargado todos los productos o no se ha encontrado un producto de la Serie ""<b>{TxtSeriePSRecepcion.Text}</b>"". ", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus2,200);")
TxtSeriePSRecepcion.Text = ""
End Sub
#End Region

View File

@@ -1,4 +1,4 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="OC.aspx.vb" EnableEventValidation="false" Inherits="OC" %>
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="OC.aspx.vb" EnableEventValidation="false" Inherits="OC_OC" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">
@@ -255,7 +255,7 @@
<%--linea 5--%>
<div class="row" style="padding-bottom: 0.6em;">
<b>
<asp:Label runat="server" ID="LblFechaEstimada" Text="Fecha Estimada:" class="col-md-2" /></b>
<asp:Label runat="server" ID="LblFechaEstimada" Text="F. Estimada:" class="col-md-2" /></b>
<div class="col-md-4" id="DivFechaEstimada" runat="server">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80% !important; padding: 0px;">
<asp:TextBox ID="TxtFechaEstimadaEntrega" runat="server" ClientIDMode="Static" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
@@ -284,25 +284,19 @@
</div>
</div>
<%--linea 6--%>
<asp:UpdatePanel ID="UPProv" runat="server" UpdateMode="Conditional">
<asp:UpdatePanel ID="UPProv" runat="server" UpdateMode="Conditional" RenderMode="Inline" style="class=Row">
<ContentTemplate>
<div id="PnlProveedor" runat="server" style="padding-bottom: 0.6em;">
<div class="row">
<label class="col-md-2">Proveedor:</label>
<div class="col-md-9">
<%--<asp:DropDownList ID="DdlProveedores" CssClass="select2me" AutoPostBack="True" Style="width: 100%;" runat="server" DataTextField="NombreCortoProveedor" DataValueField="CveProveedor">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>--%>
<ADS:Dropdownlost runat="server" ID="DdlProveedores" CssStyle="width: 100%;" CssClassDdl="select2me " DataTextField="NombreCortoProveedor" DataValueField="CveProveedor" />
<%--<asp:RangeValidator ID="RVProveedores" CssClass="form-control" runat="server" ControlToValidate="DdlProveedores" Display="None" Type="Integer" MinimumValue="1" MaximumValue="2147483647" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Proveedor''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RangeValidator>
<ajax:ValidatorCalloutExtender ID="VCOProveedores" runat="server" HighlightCssClass="vco" TargetControlID="RVProveedores" Width="300px"></ajax:ValidatorCalloutExtender>--%>
<asp:ImageButton ID="ImgCambiaProv" Visible="false" ImageUrl="/Imagenes/accept.png" runat="server" />
<ADS:Dropdownlost runat="server" ID="DdlProveedores" CssStyle="width: 100%;" CssClassDdl="select2me " DataTextField="NombreCortoProveedor" DataValueField="CveProveedor" />
</div>
<div class="col-md-1" style="padding-left: 0px;">
<asp:LinkButton runat="server" Visible="false" ID="ImgCambiaProv" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea actualizar proveedor?" data-btn-ok-label="si" Text="<i class='fa fa-check' style='color:green'></i>" CssClass="btn btn-default btn-circle btn-xs" ToolTip="Actualizar Proveedor" />
<asp:Label ID="LblLeyendaProveedorIVA" runat="server" Width="100%" Text="" Font-Italic="True"></asp:Label>
</div>
</div>
</div>
@@ -326,10 +320,7 @@
</ContentTemplate>
</asp:UpdatePanel>
<div class="row">
<label class="col-md-2"><b>IVA A Facturar:</b> </label>
<div class="col-md-2">
<asp:UpdatePanel ID="UpDdlIVA" runat="server" UpdateMode="Conditional">
@@ -438,16 +429,11 @@
</tr>
<tr id="TrUsuarioAsignado" runat="server" visible="False">
<td colspan="2">
<asp:Label ID="LblUsuarioAsignado" runat="server" Text=""></asp:Label></td>
</tr>
<tr>
<td></td>
<td>
<asp:HiddenField ID="hdnCveSuperior" runat="server" Value="-1" />
<asp:Label ID="LblUsuarioAsignado" runat="server" Text=""></asp:Label>
<asp:HiddenField ID="hdnCveSuperior" runat="server" Value="-1" />
</td>
</tr>
<tr>
</tr>
<tr id="trCfdi" style="display:none;" >
<td>
<div class="caption font-green">
<i class="icon-pin font-green"></i>

View File

@@ -6,7 +6,7 @@ Imports Extensiones
Imports GemBox.Spreadsheet
Imports Newtonsoft.Json
Partial Class OC
Partial Class OC_OC
Inherits ClsPaginas
Private Shared missing As Object = System.Reflection.Missing.Value
@@ -820,12 +820,11 @@ Partial Class OC
DdlSubProyectoContrato.DataBind()
DdlSubProyectoContrato.Items.Insert(0, New ListItem("Seleccione", "-1"))
If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then
If UsuarioActual.Empresa.Funcionalidad(590) = "1" Then
DVCultivosCuadro.Visible = True
DdlSubProyecto.AutoPostBack = True
DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyecto.SelectedValue} AND Estatus =1")
DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyecto.SelectedValue} And Estatus =1")
DdlCultivosCuadro.DataBind()
DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
@@ -896,17 +895,17 @@ Partial Class OC
UPPDetalle.Update()
PermisosPagina()
RegistraScript("$get('HdnWidth').value = $('#C_Tab_TabC_DivConceptosContenido').width();")
RegistraScript("$Get('HdnWidth').value = $('#C_Tab_TabC_DivConceptosContenido').width();")
'NO MOSTRAR LA OPCION DE ENTREGA DIRECTA (ECONOLLANTAS)
If UsuarioActual.CveEmpresa = 141 Then
DivEntregaDirecta.Visible = False
ChkEntregaDirecta.Enabled = False
ChkEntregaDirecta.Checked = False
End If
DivEntregaDirecta.Visible = False
ChkEntregaDirecta.Enabled = False
ChkEntregaDirecta.Checked = False
End If
End If
MostrarUsuarioAsignado()
End If
MostrarUsuarioAsignado()
Me.Form.DefaultButton = ""
End Sub
@@ -2219,9 +2218,18 @@ Partial Class OC
End If
End If
'Si es Proveedor Extranjero el IVA es 0%
If GlobalDTCompProveedores(CveEmpresaActual).FiltraParametros($"CveProveedor = {DdlProveedores.SelectedValue} AND RFC = 'XEXX010101000'").Rows.Count = 1 Then
IvaPS = 0
If DdlProveedores.SelectedValue.ToEntero > 0 Then
'Si es Proveedor Extranjero el IVA es 0%
Dim drProv As DataRow = GlobalDTCompProveedores(CveEmpresaActual, CveProveedor:=DdlProveedores.SelectedValue.ToEntero).FiltroPrimero("")
If drProv IsNot Nothing Then
If drProv("RFC").ToString = "XEXX010101000" Then
IvaPS = 0
End If
If drProv("CodigoRegimenFiscal").ToString = "626" Then 'simplificado lleva retencion de 1.25 de isr
RetISR = 0.0125
End If
End If
End If
AddPS(TxtCant.Text, DdlP2.SelectedValue.ToEntero, DdlP2.SelectedText, TxtObsPS.Text, ImportePS, TxtDescuentoAdd.Text.ToDecimal, TotalPS,
@@ -4027,7 +4035,19 @@ Partial Class OC
' IEPSPSIVA = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDecimal, 0)
End If
If DdlProveedores.SelectedValue.ToEntero > 0 Then
'Si es Proveedor Extranjero el IVA es 0%
Dim drProv As DataRow = GlobalDTCompProveedores(CveEmpresaActual, CveProveedor:=DdlProveedores.SelectedValue.ToEntero).FiltroPrimero("")
If drProv IsNot Nothing Then
If drProv("RFC").ToString = "XEXX010101000" Then
IvaPS = 0
End If
If drProv("CodigoRegimenFiscal").ToString = "626" Then 'simplificado lleva retencion de 1.25 de isr
RetISR = 0.0125
End If
End If
End If
CveSubProyecto = gvr.FCDropDownList("DdlSubProyectoEdit").SelectedValue.ToEntero
SubProyecto = gvr.FCDropDownList("DdlSubProyectoEdit").SelectedItem.Text
@@ -4039,8 +4059,6 @@ Partial Class OC
Cuadro = gvr.FCDropDownList("DdlCultivosCuadroEdit").SelectedItem.Text
End If
If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Or UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then
CveProyecto = -1
Proyecto = "Seleccione"
@@ -4083,9 +4101,6 @@ Partial Class OC
End If
End If
'Agarra el nuevo AF si se modifico o deja el pasado
CveActivoFijo = If(gvr.FCHiddenField("HdnCveActivoFijo").Value.ToEntero > 0, gvr.FCHiddenField("HdnCveActivoFijo").Value.ToEntero, HdnEditCveActivoFijo.Value.ToEntero)
Codigo = If(gvr.FCHiddenField("HdnCodigoAF").Value <> "-1", gvr.FCHiddenField("HdnCodigoAF").Value, HdnEditCodigo.Value)
@@ -6960,7 +6975,7 @@ Partial Class OC
#End Region
#Region " ACTUALIZA OC "
Protected Sub ImgCambiaProv_Click(sender As Object, e As ImageClickEventArgs) Handles ImgCambiaProv.Click
Private Sub ImgCambiaProv_Click(sender As Object, e As EventArgs) Handles ImgCambiaProv.Click
Dim OC As New ClsOC
If OC.UpdateProveedorOrdenCompra(DdlProveedores.SelectedValue.ToEntero, CveOrdenCompra, UsuarioActual.CveUsuario, CveEmpresaActual) Then
CargaHistorial()
@@ -8728,35 +8743,20 @@ Partial Class OC
Private Function ValidaNumRemision(NumRemision As String, TipoOC As String, CveProveedor As Integer, Optional OcTranasaccion As System.Data.SqlClient.SqlTransaction = Nothing, Optional CveOrdenCompraValida As Integer = -1) As Boolean
Private Function ValidaNumRemision(NumRemision As String, TipoOC As String, CveProveedor As Integer, Optional OcTransaccion As SqlClient.SqlTransaction = Nothing, Optional CveOrdenCompraValida As Integer = -1) As Boolean
Dim NumRemisionValida As Boolean = False
If NumRemision.Trim.Length > 0 Then
If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 AndAlso UsuarioActual.CveRol = 1 Then
Dim ObjOC As ClsOC
If OcTranasaccion IsNot Nothing Then
ObjOC = New ClsOC(OcTranasaccion)
Else
ObjOC = New ClsOC
End If
If UsuarioActual.Empresa.Funcionalidad(590) = "1" AndAlso UsuarioActual.CveRol = 1 Then
Dim ObjOC As New ClsOC(OcTransaccion)
If ObjOC.GetVerificaNumRemision(CveProveedor, TipoOC, NumRemision, UsuarioActual.CveEmpresa, CveOrdenCompraValida) Then
If ObjOC.DtResultados.Rows.Count > 0 Then
Alert($"La remision ya se encuentra asiganada a la { If(TipoOC = "OC", "Orden de compra", "Requisición")} <a target='_blank' href='./OC.aspx?OC={ObjOC.DtResultados.Rows(0)("CveOrdenCompra").ToString()}' >{ObjOC.DtResultados.Rows(0)("Folio").ToString() }</a>", TipoMensaje.MsgAdvertencia)
Alert($"La remision ya se encuentra asignada a la { If(TipoOC = "OC", "Orden de compra", "Requisición")} <a target='_blank' href='./OC.aspx?OC={ObjOC.DtResultados.Rows(0)("CveOrdenCompra").ToString()}' >{ObjOC.DtResultados.Rows(0)("Folio").ToString() }</a>", TipoMensaje.MsgAdvertencia)
Else
NumRemisionValida = True
End If
End If
Else
NumRemisionValida = True
End If
@@ -8764,10 +8764,6 @@ Partial Class OC
NumRemisionValida = True
End If
Return NumRemisionValida
End Function

View File

@@ -175,7 +175,7 @@
</div>
</div>
<div class="portlet-body">
<asp:GridView ID="GvNA" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron Órdenes de Servicio No Asignadas" DataKeyNames="CveOSDetalle, CveOS,CveUsuarioAtendio,TipoEstatus,EstatusOrdenServicio,CveSubProyecto"
<asp:GridView ID="GvNA" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron Órdenes de Servicio No Asignadas" DataKeyNames="CveOSDetalle, CveOS,CveUsuarioAtendio,TipoEstatus,EstatusOrdenServicio,CveSubProyecto,Folio"
CssClass="table table-striped table-hover Widthall table-advance" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="">

View File

@@ -191,6 +191,9 @@ Partial Class OS_Asignaciones
Dim time As DateTime
Dim contadorOrdenesAsignadas As Integer = 0
ObjOS.IniciaTransacSQL()
For Each row As GridViewRow In GvNA.Rows
If row.RowType = DataControlRowType.DataRow Then
@@ -215,20 +218,45 @@ Partial Class OS_Asignaciones
If Not TieneError Then
If Not ObjOS.UpdateOrdenesServiciosEstatus(CveEstatusOS.ToEntero, UsuarioActual.CveUsuario, row.DataKey("CveOS").ToEntero) Then
TieneError = True
End If
If Not TieneError Then
Dim RecurrenciaTipo = 0, Frecuencia = -1, DiasSemana = "-1", Dias = -1, Mes = -1, RecurrenciaFin = "-1"
Dim Fecha As DateTime = time
Dim OIDescripcion As String = $"{DdlTecnico.SelectedItem.Text} <b><a href='/OS/OrdenesServicios.aspx?CveOS={row.DataKey("CveOS")}' target='_blank' class='Texto' >Orden de servicio {row.DataKey("Folio")} </a></b>"
Dim ObjEventos As New ClsOIEventos(ObjOS.IniciaTransacSQL())
If Not ObjEventos.AddEventoAgenda(2, DdlTecnico.SelectedItem.Text, OIDescripcion, 2, time, time.AddHours(1), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
RecurrenciaTipo:=RecurrenciaTipo, Frecuencia:=Frecuencia, DiasSemana:=DiasSemana, Dia:=Dias, Mes:=Mes, RecurrenciaFin:=RecurrenciaFin, CveTipoEvento:=2,
Importe:=0, CveOS:=row.DataKey("CveOS").ToEntero, CveSubProyecto:=row.DataKey("CveSubProyecto").ToEntero) Then
TieneError = True
End If
End If
End If
End If
End If
Next
If contadorOrdenesAsignadas > 0 Then
If Not TieneError Then
ObjOS.Commit()
Alert("Se asignaron las ordenes de servicio correctamente", TipoMensaje.MsgInformacion)
CargaOrdenesServiciosAsignadasXPersona()
CargaOrdenesServiciosNoAsignadas()
End If
Else
ObjOS.RollBack()
Alert("No se han seleccionado ordenes de servicio para asignar", TipoMensaje.MsgAdvertencia)
End If

View File

@@ -359,6 +359,8 @@ Partial Class OS_OrdenesServicios
hdnEsThickbox.Value = "S"
hdnClientIDLink.Value = "NoDefinido"
End If
End Sub
@@ -1080,6 +1082,22 @@ Partial Class OS_OrdenesServicios
Next
'If Not Errores Then
' Dim TipoEstatusSeleccionado As Integer = EstatusOSDelUsuario.FiltroPrimeroValor("TipoEstatus", String.Format("CveEstatusOrdenServicio = {0}", DdlEstatusOS.SelectedValue), "Orden ASC").ToEntero
' If TipoEstatusSeleccionado = 3 Then
' Dim objEventos As New ClsOIEventos(ObjOrdenServicio.IniciaTransacSQL)
' If Not objEventos.FinalizaEvento(Now, 3, "", -1, CveOS) Then
' Errores = True
' End If
' End If
'End If
If Not Errores Then
ViewState("CveOS") = ObjOrdenServicio.CveOS
ViewState("Folio") = ObjOrdenServicio.Folio
@@ -1098,8 +1116,8 @@ Partial Class OS_OrdenesServicios
LimpiaDatos()
Else
ObjOrdenServicio.RollBack()
End If
Else
If CveTecnico = UsuarioActual.CveUsuario Then
If ObjOrdenServicio.UpdateOrdenesServicios(TxtSolicito.Text, TxtFechaRecibido.Text, TxtDescripcion.Text, UsuarioActual.CveUsuario, DdlEstatusOS.SelectedValue.ToEntero, CveOS, UsuarioActual.CveUsuario, DdlTipoOrdenOS.SelectedValue.ToEntero, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero) Then
@@ -1185,6 +1203,24 @@ Partial Class OS_OrdenesServicios
Errores = True
End If
If Not Errores Then
Dim TipoEstatusSeleccionado As Integer = EstatusOSDelUsuario.FiltroPrimeroValor("TipoEstatus", String.Format("CveEstatusOrdenServicio = {0}", DdlEstatusOS.SelectedValue), "Orden ASC").ToEntero
If TipoEstatusSeleccionado = 4 Then
Dim objEventos As New ClsOIEventos(ObjOrdenServicio.IniciaTransacSQL)
If Not objEventos.FinalizaEvento(Now, 3, "", -1, CveOS, UsuarioActual.CveUsuario) Then
Errores = True
End If
End If
End If
If Not Errores Then
ObjOrdenServicio.Commit()
@@ -1335,6 +1371,8 @@ Partial Class OS_OrdenesServicios
AddPS(Consecutivo, -1, DdlPSDetalle.SelectedValue.ToEntero, DdlPSDetalle.SelectedItem.Text, TxtCantidad.Text.ToEntero, TxtObservacionesServicioDetalle.Text, HdnEspecificaciones.Value.ToString, LtlPSEspecificaciones.Text, "",
DdlIdentificador.SelectedValue.ToEntero, DdlIdentificador.SelectedItem.Text, "-1", -1, "-1", "-1", "-1", -1, "-1", ChkSeFacturara.Checked, ChkSeSuperviso.Checked, False, If(Filename <> "", Archivo.Name, "-1"), "", UsuarioActual.CveUsuario)
Else
Dim Consecutivo As Integer = TmpDT.Rows.Count - 1
@@ -1425,6 +1463,10 @@ Partial Class OS_OrdenesServicios
DivCuentaDetalle.Visible = True
End If
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
DivCuentaDetalle.Visible = False
End If
UpBodyGv.Update()
UpFooterGv.Update()
RegistraScript("showDivGv();")

View File

@@ -0,0 +1,750 @@
<%@ Page Title="Reporte Servicio a Domicilio" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepServicioDomicilio.aspx.vb" Inherits="OS_RepServicioDomicilio" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style type="text/css">
.unoaunoold {
color: #999b9b;
font-size: 11px;
}
.Dia {
background-image: url(/Imagenes/FondoCal.jpg);
background-repeat: repeat-x;
height: 17px;
font-size: 10px;
text-align: right;
}
.Hora {
background-color: #E3EFFF;
height: 30px;
font-size: 10px;
border-right: solid 1px #5D8CC9;
border-bottom: solid 1px #5D8CC9;
}
.Mes {
background-image: url(/Imagenes/Caption.jpg);
height: 27px;
}
.Link {
color: #0000b9;
}
.calendariopanel {
z-index: 999;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
border: 0px;
background-color: transparent;
position: absolute;
}
.calendarioback {
background-color: #000;
z-index: -90;
top: 0px;
opacity: 0.3;
position: fixed;
width: 100%;
height: 100%;
}
.calendariobody {
width: 520px;
display: table;
background-color: #fff;
margin-top: 7%;
margin-left: 28%;
}
.calendariobody label {
font-size: 12px;
}
.tareasinicio tr td:nth-child(1) {
}
.portlet.light > .portlet-title > .caption > .caption-subject {
font-size: 16px;
}
.fix > div {
height: inherit !important;
width: inherit !important;
}
.fix > div > .ajax__html_editor_extender_texteditor {
height: 150px !important;
}
/*#overlay a:hover {
position: fixed;
display: none;
width: 100%;
height: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0,0,0,0.5);
z-index: 2;
cursor: pointer;
}*/
#moopio a {
display: block;
}
#moopio a:hover {
background-color: rgba(0,0,0,0.5);
transform: scale(1.2);
cursor: default;
}
.MultiLineTextBox {
resize: none;
}
.select2-container--open {
z-index: 1000 !important;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Reporte Servicios a Domicilio
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="portlet light calendar ">
<div class="portlet-title ">
<div class="caption">
<i class="icon-calendar font-green-sharp"></i>
<span class="caption-subject font-green-sharp bold uppercase">Servicios a Domicilio</span>
</div>
</div>
<div class="portlet-body">
<div id="calendar">
</div>
<asp:UpdatePanel runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button Text="" runat="server" ID="BtnActualizaAdd" ClientIDMode="Static" Style="display: none;" OnClick="BtnActualizaAdd_Click" />
<asp:HiddenField runat="server" ID="HdnU" ClientIDMode="Static" />
<asp:HiddenField runat="server" ID="HdnE" ClientIDMode="Static" />
</ContentTemplate>
</asp:UpdatePanel>
<div id="ModalAgenda" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAgenda" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title"><span id="SpanTituloAgenda">Servicios a Domicilio</span></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12" style="text-align: center;">
<asp:Label ID="LblEmpresaCRM" runat="server" Text="" Style="font-size: 16px; display: none; text-align: center;"></asp:Label>
</div>
</div>
<div class="row" style="display:none!important">
<div class="form-group col-md-6 form-md-line-input input-iconright selectmodal">
<asp:DropDownList ID="DdlAgedaTipo" ClientIDMode="Static" Width="100%" Enabled="false" DataTextField="AgendaTipo" DataValueField="CveAgendaTipo" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVAgendaTipo" InitialValue="-1" runat="server" ControlToValidate="DdlAgedaTipo" CssClass="help-block errorimput" ErrorMessage="<span style='font-size: 11px;'><b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de agenda''</b> es necesario.</span>" ValidationGroup="VGGuardarAgenda"></asp:RequiredFieldValidator>
<label style="width: 90%;" for="<%=DdlAgedaTipo.ClientID.ToString()%>">Tipo de Asunto:</label>
</div>
<div class="form-group col-md-6 form-md-line-input input-iconright selectmodal">
<asp:DropDownList ID="DdlPrioridad" ClientIDMode="Static" Width="100%" runat="server" CssClass="form-control input-sm select2me" Enabled="false">
<asp:ListItem Selected="True" Text="Baja" Value="1"></asp:ListItem>
<asp:ListItem Text="Media" Value="2"></asp:ListItem>
<asp:ListItem Text="Alta" Value="3"></asp:ListItem>
</asp:DropDownList>
<label for="<%=DdlPrioridad.ClientID.ToString()%>">Prioridad:</label>
</div>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtAsuntoAgenda" ClientIDMode="Static" MaxLength="100" CssClass="form-control" runat="server" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVAsuntoAgenda" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtAsuntoAgenda" ErrorMessage="<span style='font-size: 11px;'><b><span style='text-decoration: underline'>ERROR</span></b>: El campo <b>''Asunto''</b> es necesario.</span>" ValidationGroup="VGGuardarAgenda"></asp:RequiredFieldValidator>
<label for="<%= TxtAsuntoAgenda.ClientID.ToString()%>">Asunto:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<div id="DivDescripcionUpdate" style="width: 400px; height: 75px; padding-top: 10px; font-size: 14px; display: none;"></div>
<asp:TextBox ID="TxtDescripcionAgenda" ClientIDMode="Static" MaxLength="5000" runat="server" TextMode="MultiLine" Rows="2" CausesValidation="true" Width="100%" CssClass="form-control MultiLineTextBox"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVDescripcionAgenda" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtDescripcionAgenda" ErrorMessage="<span style='font-size: 11px;'><b><span style='text-decoration: underline'>ERROR</span></b>: El campo <b>''Descripción''</b> es necesario.</span>" ValidationGroup="VGGuardarAgenda"></asp:RequiredFieldValidator>
<label for="<%= TxtDescripcionAgenda.ClientID.ToString()%>" style="height: 60px;">Descripción:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" ClientIDMode="Static" ID="LblSubProyecto" CssClass="form-control"></asp:Label>
<label for="<%= LblSubProyecto.ClientID.ToString()%>" style="height: 60px;"><asp:Label runat="server" ID="LblSubProyectoEtiqueta"></asp:Label>:</label>
</div>
<div class="row">
<div class="form-group col-md-6 form-md-line-input input-iconright" style="padding-left: 0px !important;">
<div class="input-group input-sm date date-picker" data-date-format="dd/mm/yyyy hh:mm" style="width: 70%;">
<asp:TextBox ID="TxtFechaInicioAgenda" Enabled="false" ClientIDMode="Static" runat="server" Width="100%" CssClass="form-control input-sm " CausesValidation="true" MaxLength="18"></asp:TextBox>
<label style="margin-left: -3px; padding-bottom: 30px; width: 70%;" for="<%= TxtFechaInicioAgenda.ClientID.ToString()%>">Fecha de Inicio:</label>
</div>
<asp:RequiredFieldValidator ID="RFVFechaInicioAdd" Display="None" CssClass="help-block errorimput" runat="server" ControlToValidate="TxtFechaInicioAgenda" ErrorMessage="<b><span style='text-decoration: underline'>ERROR</span></b>:<br>El campo <b>''Fecha de Inicio''</b> es necesario." ValidationGroup="VGGuardarAgenda"></asp:RequiredFieldValidator>
</div>
<div class="form-group col-md-6 form-md-line-input input-iconright" style="padding-left: 0px !important;">
<div class="input-group input-sm date date-picker" data-date-format="dd/mm/yyyy hh:mm" style="width: 70%;">
<asp:TextBox ID="TxtFechaFinAgenda" Enabled="false" ClientIDMode="Static" runat="server" Width="100%" CssClass="form-control input-sm " CausesValidation="true" MaxLength="18"></asp:TextBox>
<label style="margin-left: -3px; padding-bottom: 30px; width: 70%;" for="<%= TxtFechaFinAgenda.ClientID.ToString()%>">Fecha de Fin:</label>
</div>
<asp:RequiredFieldValidator ID="RFVFechaFinAdd" Display="None" CssClass="help-block errorimput" runat="server" ControlToValidate="TxtFechaFinAgenda" ErrorMessage="<b><span style='text-decoration: underline'>ERROR</span></b>: El campo <b>''Fecha de Fin''</b> es necesario." ValidationGroup="VGGuardarAgenda"></asp:RequiredFieldValidator>
</div>
</div>
<div style="display:none">
<asp:CheckBox Text="Recurrencia" ClientIDMode="Static" runat="server" ID="CheckRecurrencia" />
</div>
<asp:UpdatePanel runat="server" ClientIDMode="Static" UpdateMode="Conditional" ID="UpRecurrencia">
<ContentTemplate>
<div style="width: 100%; float: left; margin-bottom: 10px; margin-left: 0px;">
<hr style="margin-top: 0px; margin-bottom: 15px;" />
<div style="float: left; width: 20%; height: 130px;">
<asp:RadioButtonList runat="server" CssClass="tablenopadding" RepeatDirection="Vertical" ID="RBLRecurrencia" AutoPostBack="true" OnSelectedIndexChanged="RBLRecurrencia_SelectedIndexChanged">
<asp:ListItem Text="1- Hora" Value="1" Selected="True" />
<asp:ListItem Text="2- Diario" Value="2" />
<asp:ListItem Text="3- Semanal" Value="3" />
<asp:ListItem Text="4- Mensual" Value="4" />
<asp:ListItem Text="5- Anual" Value="5" />
</asp:RadioButtonList>
</div>
<div style="float: left; width: 80%; height: 130px;">
<div runat="server" id="DivRecurrencia" visible="true" style="width: 100%; height: 100%;">
<asp:HiddenField runat="server" ID="HdnDiasSemanaAgendar" ClientIDMode="Static" Value="" />
<div class="col-md-12"></div>
<div class="row">
<div class="col-md-2" style="padding-right: 0px; text-align: right;">Cada:</div>
<div class="form-group col-md-1 form-md-line-input input-iconright" style="padding-left: 0px !important; padding-right: 0px; padding-top: 0px; padding-bottom: 0px; margin-top: -6px;">
<div class="input-group input-sm" style="padding-top: 0px;">
<asp:TextBox ID="TxtFrecuencia" ClientIDMode="Static" Text="1" runat="server" Style="padding-top: 0px; padding-bottom: 0px;" Width="20px" CssClass="form-control input-sm" CausesValidation="true" TextMode="Number"></asp:TextBox>
<label style="margin-top: -3px; margin-left: -5px; width: 20px;" for="<%= TxtFechaFinAgenda.ClientID.ToString()%>"></label>
</div>
</div>
<%--<td>
<asp:TextBox runat="server" ClientIDMode="Static" ID="TxtFrecuencia" Text="1" Width="20px" />
</td>--%>
<div class="col-md-2" style="padding-left: 0px;">
<asp:Label Text="Hora(s)" runat="server" ID="LblTextoFrecuencia" />
</div>
</div>
<div class="row" id="TrDiasSemanaAdd" runat="server" style="display: none;">
<div class="col-md-12">
<asp:CheckBoxList runat="server" ID="CheckDiasSemana" ClientIDMode="Static" RepeatColumns="5" RepeatDirection="Horizontal">
<asp:ListItem Text="Lunes" Value="2" />
<asp:ListItem Text="Martes" Value="3" />
<asp:ListItem Text="Miercoles" Value="4" />
<asp:ListItem Text="Jueves" Value="5" />
<asp:ListItem Text="Viernes" Value="6" />
<asp:ListItem Text="Sabado" Value="7" />
<asp:ListItem Text="Domingo" Value="1" />
</asp:CheckBoxList>
</div>
</div>
</div>
</div>
</div>
<div class="row" style="width: 100%; float: left; margin-bottom: 10px; margin-left: 0px;display:none"">
<hr style="margin-top: 0px; margin-bottom: 15px;" />
<div class="col-md-6" style="padding-left: 0px !important;">
<div class="col-md-8" style="padding-left: 0px; padding-right: 0px;">
<asp:RadioButton Text="Terminar despues de:" ID="RBNumeroOcurrencias" ClientIDMode="Static" GroupName="GNFrecuenciaFinAdd" runat="server" />
</div>
<div class="form-group col-md-1 form-md-line-input input-iconright" style="padding: 0px !important; margin-top: -5px; margin-left: -10px">
<div class="input-group input-sm" style="padding-top: 0px; padding-left: 0px; padding-right: 0px;">
<asp:TextBox runat="server" onclick="FechaFinSet('RBNumeroOcurrencias','TxtFechaFinRecurrencia');" ClientIDMode="Static" CssClass="form-control" TextMode="Number" ID="TxtNumeroOcurrencias" Width="20px" />
<label style="margin-top: 5px; margin-left: -15px; width: 20px;" for="<%= TxtNumeroOcurrencias.ClientID.ToString()%>"></label>
</div>
</div>
<div class="col-md-2" style="margin-top: 5px; padding-left: 5px;">Veces</div>
</div>
<div class="col-md-6">
<div class="row">
<div class="col-md-5" style="padding-left: 0px !important;">
<asp:RadioButton Text="Terminar en:" ID="RBFechaFin" ClientIDMode="Static" GroupName="GNFrecuenciaFinAdd" runat="server" Width="85px" />
</div>
<div class="col-md-6" style="padding-left: 0px !important;">
<div class="form-group form-md-line-input input-iconright" style="padding: 0px !important; margin-top: -5px; margin-left: -10px">
<div class="input-group input-sm date date-picker" data-date-format="dd/mm/yyyy" style="width: 108px!important; padding-top: 0px;">
<asp:TextBox ID="TxtFechaFinRecurrencia" ClientIDMode="Static" runat="server" CssClass="form-control" Height="28px" Width="80px" Font-Size="13px"></asp:TextBox>
<label style="margin-left: 10px; width: 85%;" for="<%= TxtFechaFinRecurrencia.ClientID.ToString()%>"></label>
<span class="input-group-btn " style="width: 28px">
<asp:LinkButton ID="imgFechaFinRecurrenciaAdd" class="btn default" runat="server" Style="padding-left: 8px; padding-top: 5px;" Height="28px" Width="28px"><i class="fa fa-calendar"></i></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaFinRecurrenciaAdd" runat="server" TargetControlID="TxtFechaFinRecurrencia" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarioFechaFinRecurrenciaAdd" TargetControlID="TxtFechaFinRecurrencia" PopupButtonID="ImgFechaFinRecurrenciaAdd" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<%--<asp:RequiredFieldValidator ID="RFVFechaFinRecurrenciaAdd" runat="server" ControlToValidate="TxtFechaFinRecurrencia" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor ingréselo."></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFechaFinRecurrenciaAdd" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaFinRecurrenciaAdd" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row" style="width: 100%; float: left; margin-bottom: 10px; margin-left: 0px;display:none">
<hr style="margin-top: 5px; margin-bottom: 10px;" />
<div class="col-md-3" style="padding-left: 0px; padding-right: 0px;">
<asp:CheckBox Text="Gasto Recurrente:" ClientIDMode="Static" runat="server" ID="ChkGastoRecurrente" />
</div>
<div class="form-group col-md-4 form-md-line-input input-iconright" style="padding: 0px !important; margin-top: -5px; margin-left: 0px">
<div class="input-group input-sm" style="padding-top: 0px; padding-left: 0px; padding-right: 0px;">
<asp:TextBox runat="server" ClientIDMode="Static" CssClass="form-control" ID="TxtImporteGastoRecurrente" Width="100px" onkeyup="FormatoMoneda(this)" />
<label style="margin-top: 5px; margin-left: -15px;" for="<%= TxtImporteGastoRecurrente.ClientID.ToString()%>"></label>
<%--<ajax:MaskedEditExtender ID="MEEgastoRecurrente" runat="server" TargetControlID="TxtImporteGastoRecurrente" Mask="999,999.99" MaskType="Number" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>--%>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:HiddenField runat="server" ID="HdnCveEvento" ClientIDMode="Static" Value="-1" />
<%--<div style="display:none">
<asp:Button ID="BtnGuardar" OnClick="BtnGuardar_Click" runat="server" ClientIDMode="Static" Text="Guardar" CssClass="btn btn-primary" ValidationGroup="VGGuardarAgenda" />
<asp:Button ID="BtnEliminar" runat="server" CssClass="btn btn-danger" OnClick="BtnEliminar_Click" Text="Eliminar" Style="display: none" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea continuar?" data-btn-ok-label="si" />
</div>--%>
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</div>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script>
function FechaFinSet(RB, TXT) {
RB = "#" + RB
TXT = "#" + TXT
$(RB).prop('checked', true);
$(TXT).val('');
}
function AyudaHora(txt) {
Hora = txt;
var opt = $get("HdnHora").value;
if (opt == "1") {
$("#TxtHoraInicioAdd").val(txt);
$("#TxtHoraFinAdd").val(txt);
} else if (opt == "2") {
$("#TxtHoraFinAdd").val(txt);
} else if (opt == "3") {
$("#TxtHoraInicioUpdate").val(txt);
$("#TxtHoraFinUpdate").val(txt);
} else if (opt == "4") {
$("#TxtHoraFinUpdate").val(txt);
}
$get('DivHora').style.display = 'none';
}
var currentUpdateEvent;
var addStartDate;
var addEndDate;
var globalAllDay;
function selectDate(start, end, allDay) {
$('#ModalAgenda').modal('show');
$("#SpanTituloAgenda").html("Agregar Evento");;
//$("#< %=BtnGuardar.ClientID%>").val('Guardar');
//$("#< %=BtnEliminar.ClientID%>").css("display", "none");
$("#HdnCveEvento").val(-1);
$("#DdlAgedaTipo").val("-1");
$("#DdlPrioridad").val("1");
$("#TxtAsuntoAgenda").val("");
$("#TxtDescripcionAgenda").val("");
$("#TxtFechaInicioAgenda").val("" + start.format("DD/MM/YYYY 08:00"));
$("#TxtFechaFinAgenda").val("" + start.format("DD/MM/YYYY 09:00"));
$("#UpRecurrencia").hide();
$("#CheckRecurrencia").prop('checked', false);
$get("HdnDiasSemanaAgendar").value = -1;
$('#<%=RBLRecurrencia.ClientID %>').find("input[value='1']").prop("checked", true);
$('#<%=TrDiasSemanaAdd.ClientID %>').css("display", "none");
$("#DivDescripcionUpdate").css("display", "none");
$("#<%=TxtDescripcionAgenda.ClientID%>").css("display", "block");
$('#<%=LblTextoFrecuencia.ClientID%>').html("Hora(s)");
$("#TxtFrecuencia").val("1");
$("#TxtNumeroOcurrencias").val("");
$("#TxtFechaFinRecurrencia").val("");
$("#ChkGastoRecurrente").prop('checked', false);
$("#TxtImporteGastoRecurrente").val("");
}
function updateEvent(event, element) {
$('#ModalAgenda').modal('show');
//$("#SpanTituloAgenda").html("Actualizar Evento");;
//$("#< %=BtnGuardar.ClientID%>").val('Actualizar');
//$("#< %=BtnEliminar.ClientID%>").css("display", "");
$("#DivDescripcionUpdate").css("display", "block");
$("#<%=TxtDescripcionAgenda.ClientID%>").css("display", "none");
$("#HdnCveEvento").val(event.id);
$("#TxtNumeroOcurrencias").val('');
$("#TxtFechaFinRecurrencia").val('');
$("#TxtFrecuencia").val('');
$("#TxtAsuntoAgenda").val(event.title);
//SE MUESTRA EL TEXTO HTML EN EL DIV DE LA DESCRIPCION SIN PERMITIR EDITAR,
//SE ASIGNA -1 EN EL TEXBOX PARA QUE NO REALICE CAMBIOS EN BD
$("#DivDescripcionUpdate").html(event.description);
$("#TxtDescripcionAgenda").val("-1");
$("#DdlAgedaTipo").val(event.cveagendatipo);
$("#DdlPrioridad").val(event.prioridad);
$('#LblSubProyecto').text(event.SubProyecto);
$("#TxtFechaInicioAgenda").val("" + event.start.format("DD/MM/YYYY HH:mm"));
$("#TxtFechaFinAgenda").val("" + event.end.format("DD/MM/YYYY HH:mm"));
//Identifica el tipo de Fecha Termino de la Recurrencia
if (event.recurrenciafin == 0) {
//$("#RBSinFechaFinUpdate").prop('checked', true);
$("#TxtFrecuencia").val('0');
} else if (!isNaN(event.recurrenciafin)) {
$("#RBNumeroOcurrencias").prop('checked', true);
$("#TxtNumeroOcurrencias").val(event.recurrenciafin);
} else {
$("#RBFechaFin").prop('checked', true);
$("#TxtFechaFinRecurrencia").val("" + event.recurrenciafin);
}
//GASTO RECURRENTE
//Si el evento es tipo 10 = Gasto Mes, activa gasto recurrente
if (event.CveTipoEvento == 10) {
$("#ChkGastoRecurrente").prop('checked', true);
$("#TxtImporteGastoRecurrente").val(event.Importe);
} else {
$("#ChkGastoRecurrente").prop('checked', false);
$("#TxtImporteGastoRecurrente").val('');
}
//Verifica que hay Recurrencia para activar los campos y poner sus valores respectivos
if (event.recurrenciatipo > 0) {
$("#CheckRecurrencia").prop('checked', true);
// CHECKEA EL TIPO DE RECURRENCIA QUE TENGA EL EVENTO
var text = event.recurrenciatipo;
var radio = $("[id*=RBLRecurrencia] label:contains('" + text + "')").closest("td").find("input");
radio.attr("checked", "checked");
// CHECKEA LOS DIAS SELECCIONADOS DE LA RECURRENCIA DE SEMANA
$get("HdnDiasSemanaAgendar").value = event.diassemana;
//LLENA TEXTO DE FRECUENCIA DE RECURRENCIA
$("#TxtFrecuencia").val("" + event.frecuencia);
} else {
$("#CheckRecurrencia").prop('checked', false);
}
//ESCONDE O MUESTRA EL DIV DE LAS OPCIONES DE RECURRENCIA
if ($get('CheckRecurrencia').checked) {
$("#UpRecurrencia").show();
} else {
$("#UpRecurrencia").hide();
}
//LLAMA EL INDEXCHANGED DEL RADIOBUTTONLIST DE LOS TIPOS DE RECURRENCIA
$("#BtnActualizaAdd").click();
//Muestra nombre de la empresa si esta tarea sea asigno desde EmpresaCRM
if (event.EmpresaCRM != "") {
$("#<%=LblEmpresaCRM.ClientID%>").css("display", "")
$("#<%=LblEmpresaCRM.ClientID%>").text(event.EmpresaCRM);
} else {
$("#<%=LblEmpresaCRM.ClientID%>").css("display", "none")
}
}
function RadionButtonSelectedValueSet(name, SelectdValue) {
$('input[name="' + name + '"][value="' + SelectdValue + '"]').prop('checked', true);
}
function CheckUpdate(check) {
if (check.checked) {
$("#UpRecurrenciaUpdate").show("slow");
} else {
$("#UpRecurrenciaUpdate").hide("slow");
}
}
function CheckAdd(check) {
if (check.checked) {
$("#UpRecurrencia").show("slow");
} else {
$("#UpRecurrencia").hide("slow");
}
}
function deleteEvent() {
//var id = $get('HdnId').val;
//PageMethods.EliminaEvento(id, deleteSuccess);
}
function updateSuccess(updateResult) {
//alert(updateResult);
}
function deleteSuccess(deleteResult) {
//alert("eliminado exitosamente: " + deleteResult);
}
function addSuccess(addResult) {
// if addresult is -1, means event was not added
// alert("added key: " + addResult);
if (addResult != -1) {
$('#calendar').fullCalendar('renderEvent',
{
title: $("#addEventName").val(),
start: addStartDate,
end: addEndDate,
id: addResult,
description: $("#addEventDesc").val(),
allDay: globalAllDay
},
true // make the event "stick"
);
$('#calendar').fullCalendar('unselect');
}
}
function UpdateTimeSuccess(updateResult, userContext, methodName) {
//alert(userContext);
}
function updateEventOnDropResize(event, allDay) {
//alert("allday: " + allDay);
var eventToUpdate = {
id: event.id,
start: event.start
};
// FullCalendar 1.x
//if (allDay) {
// eventToUpdate.start.setHours(0, 0, 0);
//}
if (event.end === null) {
eventToUpdate.end = eventToUpdate.start;
}
else {
eventToUpdate.end = event.end;
}
// FullCalendar 2.x
var endDate;
if (!event.allDay) {
endDate = new Date(eventToUpdate.end + 60 * 60000);
endDate = endDate.toJSON();
}
else {
endDate = eventToUpdate.end.toJSON();
}
eventToUpdate.start = eventToUpdate.start.toJSON();
eventToUpdate.end = eventToUpdate.end.toJSON(); //endDate;
eventToUpdate.allDay = event.allDay;
PageMethods.ActualizaEvento(eventToUpdate, UpdateTimeSuccess);
}
function eventDropped(event, dayDelta, minuteDelta, allDay, revertFunc) {
if ($(this).data("qtip")) $(this).qtip("destroy");
updateEventOnDropResize(event);
}
function eventResized(event, dayDelta, minuteDelta, revertFunc) {
if ($(this).data("qtip")) $(this).qtip("destroy");
updateEventOnDropResize(event);
}
function checkForSpecialChars(stringToCheck) {
var pattern = /[^A-Za-z0-9 ]/;
return pattern.test(stringToCheck);
}
function isAllDay(startDate, endDate) {
var allDay;
if (startDate.format("HH:mm:ss") == "00:00:00" && endDate.format("HH:mm:ss") == "00:00:00") {
allDay = true;
globalAllDay = true;
}
else {
allDay = false;
globalAllDay = false;
}
return allDay;
}
var view = null;
var date = null;
function GetView() {
view = $('#calendar').fullCalendar('getView');
date = $('#calendar').fullCalendar('getDate');
}
function SetView() {
$('#calendar').fullCalendar('gotoDate', date.format());
$('#calendar').fullCalendar('changeView', view.name);
}
function Calendario() {
//$get('DivActualizarEvento').style.display = 'none';
//$get('DivAgregarEvento').style.display = 'none';
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
var h = {};
if ($('#calendar').width() <= 400) {
$('#calendar').addClass("mobile");
h = {
left: 'title, prev, next',
center: '',
right: 'today,month,agendaWeek,agendaDay'
};
} else {
$('#calendar').removeClass("mobile");
h = {
left: 'title',
center: '',
right: 'prev,next,today,month,agendaWeek,agendaDay'
};
}
$('#calendar').fullCalendar('destroy'); // destroy the calendar
$('#calendar').fullCalendar({ //re-initialize the calendar
header: h,
monthNames: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"],
monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
dayNames: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
dayNamesShort: ['Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb'],
buttonText: {
today: 'Hoy',
week: 'Semana',
month: 'Mes',
day: 'Día'
},
eventClick: updateEvent,
selectable: true,
selectHelper: true,
select: selectDate,
editable: true,
events: {
url: '/Ashx/CargaEventos.ashx',
type: 'GET',
data: {
U: ' <%= UsuarioActual.CveUsuario %>',
E: '<%= UsuarioActual.CveEmpresa %>',
METODO:'servicio_domicilio'
}
},
eventDrop: eventDropped,
eventResize: eventResized
});
}
function InitCalendar() {
$(document).ready(function () {
Calendario();
});
}
</script>
</asp:Content>

View File

@@ -0,0 +1,273 @@
Option Explicit On
Option Strict On
Imports Extensiones
Imports System.Data
Imports Microsoft.Reporting.WebForms
Imports System.Web.Services
Partial Class OS_RepServicioDomicilio
Inherits ClsPaginas
#Region "PROPIEDADES"
Private Property DtDatos As DataTable
Get
DtDatos = DirectCast(ViewState("DtDatos"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtDatos") = value
End Set
End Property
Private Property DtColor As DataTable
Get
Return DirectCast(ViewState("DtColor"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtColor") = value
End Set
End Property
Private Property Agrupador As String
Get
Return ViewState("Agrupador").ToString
End Get
Set(value As String)
ViewState("Agrupador") = value
End Set
End Property
Private Property TCEspecifico As Double
Get
Return ViewState("TCEspecifico").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TCEspecifico") = value
End Set
End Property
Private Property TipoCambio As Integer
Get
Return ViewState("TipoCambio").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("TipoCambio") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CargarCentrosDeCosto(Nothing, Nothing, Nothing, LblSubProyectoEtiqueta)
InicializaCalendar()
End If
End Sub
#Region "CARGAS"
Private Sub SetValues()
End Sub
Private Sub CargaDatos()
End Sub
#End Region
#Region " FULL CALENDAR "
Private Sub InicializaCalendar()
RegistraScript("InitCalendar();")
HdnU.Value = UsuarioActual.CveUsuario.ToString
HdnE.Value = UsuarioActual.CveEmpresa.ToString
DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True
CargaTiposAgenda()
CheckRecurrencia.Attributes.Add("onclick", "CheckAdd(this);")
End Sub
Private Sub CargaTiposAgenda()
Dim ObjEventos As New ClsOIEventos
If ObjEventos.GetAgendaTipo() Then
DdlAgedaTipo.DataSource = ObjEventos.DtResultados
DdlAgedaTipo.DataBind()
DdlAgedaTipo.Items.Insert(0, New ListItem("Seleccione", "-1"))
Else
Alert("Ocurrió un error al obtener los tipos de agenda. Por favor recargue la página", TipoMensaje.MsgError)
End If
ObjEventos.Dispose()
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
Dim ObjEventos As New ClsOIEventos
Dim FechaInicio = TxtFechaInicioAgenda.Text.ToDateTime()
Dim FechaFin = TxtFechaFinAgenda.Text.ToDateTime()
RegistraScript("GetView();")
Dim RecurrenciaTipo = 0, Frecuencia = -1, DiasSemana = "-1", Dias = -1, Mes = -1, RecurrenciaFin = "-1"
If CheckRecurrencia.Checked Then
RecurrenciaTipo = RBLRecurrencia.SelectedValue.ToEntero
Frecuencia = TxtFrecuencia.Text.ToEntero
'OBTENEMOS LOS DIAS SELECCIONADOS EN LA OPCION DE RECURRENCIA POR SEMANA
Select Case RecurrenciaTipo
Case 3
Dim StringDias = ""
For Each item As ListItem In CheckDiasSemana.Items
If item.Selected Then
If StringDias.Length > 0 Then
StringDias += ","
End If
StringDias += item.Value
End If
Next
If StringDias.Length > 0 Then
DiasSemana = StringDias
End If
End Select
'If RBSinFechaFinAdd.Checked Then
' RecurrenciaFin = "-1"
'Else
If RBNumeroOcurrencias.Checked Then
RecurrenciaFin = TxtNumeroOcurrencias.Text
ElseIf RBFechaFin.Checked Then
RecurrenciaFin = TxtFechaFinRecurrencia.Text
Else
RecurrenciaFin = "-1"
End If
Else
If HdnCveEvento.Value.ToEntero > 0 Then
Frecuencia = -2 : DiasSemana = "-2" : Dias = -2 : Mes = -2 : RecurrenciaFin = "-2"
End If
End If
'11/05/2018 - GASTO RECURRENTE
Dim CveTipoEvento As Integer = IIf(ChkGastoRecurrente.Checked, 10, 2).ToString().ToEntero()
Dim Importe As Double = Convert.ToDouble(IIf(ChkGastoRecurrente.Checked, TxtImporteGastoRecurrente.Text, "-1"))
If HdnCveEvento.Value.ToEntero > 0 Then
If ObjEventos.UpdateEvento(TxtAsuntoAgenda.Text, TxtDescripcionAgenda.Text, DdlPrioridad.SelectedValue.ToEntero, DdlAgedaTipo.SelectedValue.ToEntero, -1, FechaInicio, FechaFin, -1, "-1", HdnCveEvento.Value.ToEntero, "-1",
RecurrenciaTipo, Frecuencia, DiasSemana, Dias, Mes, RecurrenciaFin, Importe:=Importe) Then
Alert("El Evento se actualizó correctamente", TipoMensaje.MsgInformacion)
Else
Alert("Ocurrió un error al actualizar el evento", TipoMensaje.MsgAdvertencia)
End If
Else
If ObjEventos.AddEventoAgenda(DdlAgedaTipo.SelectedValue.ToEntero, TxtAsuntoAgenda.Text, TxtDescripcionAgenda.Text, DdlPrioridad.SelectedValue.ToEntero, FechaInicio, FechaFin, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
RecurrenciaTipo:=RecurrenciaTipo, Frecuencia:=Frecuencia, DiasSemana:=DiasSemana, Dia:=Dias, Mes:=Mes, RecurrenciaFin:=RecurrenciaFin, CveTipoEvento:=CveTipoEvento, Importe:=Importe) Then
Alert("El Evento se guardó correctamente", TipoMensaje.MsgInformacion)
Else
Alert("Ocurrió un error al Guardar el evento", TipoMensaje.MsgAdvertencia)
End If
End If
ObjEventos.Dispose()
RegistraScript("Calendario();SetView();$('#ModalAgenda').modal('hide');", "1234")
LimpiaModalAgenda()
End Sub
Private Sub LimpiaModalAgenda()
TxtDescripcionAgenda.Text = ""
TxtAsuntoAgenda.Text = ""
DdlPrioridad.SelectedValue = "1"
TxtNumeroOcurrencias.Text = ""
TxtFechaFinRecurrencia.Text = ""
RBFechaFin.Checked = False
RBNumeroOcurrencias.Checked = False
RBLRecurrencia.SelectedValue = "1"
CheckDiasSemana.ClearSelection()
RBLRecurrencia_SelectedIndexChanged(RBLRecurrencia, EventArgs.Empty)
TxtFrecuencia.Text = "1"
LblEmpresaCRM.Text = ""
End Sub
Protected Sub BtnEliminar_Click(sender As Object, e As EventArgs)
Dim ObjEventos As New ClsOIEventos
RegistraScript("GetView();")
If ObjEventos.RemoveEvento(HdnCveEvento.Value.ToEntero, UsuarioActual.CveEmpresa) Then
RegistraScript("Calendario();SetView();$('#ModalAgenda').modal('hide');", "1234")
Alert("El evento se eliminó correctamente", TipoMensaje.MsgInformacion)
Else
Alert("Ocurrió un error al eliminar el evento, por favor intente de nuevo.", TipoMensaje.MsgError)
End If
ObjEventos.Dispose()
End Sub
<WebMethod()> <Script.Services.ScriptMethodAttribute()>
Public Shared Function EliminaEvento(CveEvento As Integer, CveEmpresa As Integer) As String
Dim ObjEventos As New ClsOIEventos
ObjEventos.RemoveEvento(CveEvento, CveEmpresa)
ObjEventos.Dispose()
Return CveEvento.ToString
End Function
<WebMethod()> <Script.Services.ScriptMethodAttribute()>
Public Shared Function ActualizaEvento(ClsEvent As CalendarEvent) As String
Dim ObjEventos As New ClsOIEventos
Dim FechaInicio = DateTimeOffset.Parse(ClsEvent.start).DateTime
Dim FechaFin = DateTimeOffset.Parse(ClsEvent.end).DateTime
If ObjEventos.UpdateEvento("-1", "-1", -1, -1, -1, FechaInicio, FechaFin, -1, "-1", ClsEvent.id) Then
End If
ObjEventos.Dispose()
Return "a"
End Function
Protected Sub RBLRecurrencia_SelectedIndexChanged(sender As Object, e As EventArgs)
Select Case RBLRecurrencia.SelectedValue.ToEntero
Case 1
LblTextoFrecuencia.Text = "Hora(s)"
TrDiasSemanaAdd.Style("display") = "none"
Case 2
LblTextoFrecuencia.Text = "Dia(s)"
TrDiasSemanaAdd.Style("display") = "none"
Case 3
LblTextoFrecuencia.Text = "Semana(s)"
TrDiasSemanaAdd.Style("display") = "block"
'Chequea los dias seleccionados en la recurrencia
For Each item As ListItem In CheckDiasSemana.Items
If HdnDiasSemanaAgendar.Value.Contains(item.Value) Then
item.Selected = True
Else
item.Selected = False
End If
Next
Case 4
LblTextoFrecuencia.Text = "Mes(es)"
TrDiasSemanaAdd.Style("display") = "none"
Case 5
LblTextoFrecuencia.Text = "Año(s)"
TrDiasSemanaAdd.Style("display") = "none"
Case Else
End Select
UpRecurrencia.Update()
End Sub
Protected Sub BtnActualizaAdd_Click(sender As Object, e As EventArgs)
RBLRecurrencia_SelectedIndexChanged(RBLRecurrencia, EventArgs.Empty)
End Sub
#End Region
End Class

View File

@@ -42,16 +42,34 @@
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-lg-1">
Empresa:
</div>
<div class="col-lg-4">
</div>
</div>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="SubTotales">
<td>Empresa:
<td style="width:500px!important">Empresa:
<asp:DropDownList ID="DdlEmpresa" runat="server" AppendDataBoundItems="true" DataTextField="Empresa" DataValueField="CveEmpresa" Class="form-control input-sm select2me " Style="width: 400px !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td>
<td style="width:200px!important">Estatus:
<asp:DropDownList ID="DdlEsatus" runat="server" AppendDataBoundItems="true" Class="form-control input-sm select2me " Style="width: 100px !important;">
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Activos" Value="1" Selected="True"></asp:ListItem>
<asp:ListItem Text="Inactivos" Value="0"></asp:ListItem>
</asp:DropDownList>
</td>
<td style="text-align:right!important">
<asp:Button ID="consultar" runat="server" Text="Consultar" OnClick="consultar_Click" class="btn btn-primary" />
</td>
</tr>
</table>
</ContentTemplate>

View File

@@ -70,7 +70,7 @@ Partial Class Sistemas_Usuarios
Public Sub CargaDatos()
Dim Usuario As New ClsSisUsuarios
If Usuario.GetUsuarios(-1, -1) Then
If Usuario.GetUsuarios(-1, -1, Estatus:=DdlEsatus.SelectedValue.ToEntero) Then
If UsuarioActual.CveRol <> 1 Then
DtUsuarios = Usuario.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0} AND CveRol <> 1", DdlEmpresa.SelectedValue))
'DtUsuarios = Usuario.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)

File diff suppressed because it is too large Load Diff

View File

@@ -319,7 +319,10 @@ Partial Class Ventas_ClientesAbonar
Private Sub CargaCuentas()
DdlCuenta.Items.Clear()
Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa, CveTipoCuenta:=2)
Dim CveTipoCuenta As Integer = 2
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then CveTipoCuenta = -1 'que se muestren todas, para empresa acumuladores
Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa, CveTipoCuenta:=CveTipoCuenta)
If ChkPagarPesos.Checked Then
dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", 1))
@@ -783,7 +786,7 @@ Partial Class Ventas_ClientesAbonar
Dim SeriesPago As New List(Of String)
Dim MsgError As String = ""
Dim NCGeneradas As New List(Of Modelos.Factura.MMensajeFactura)
Dim NCGeneradas As New List(Of RespuestaNotaCredrito)
Dim ListaFacturasGenerarNC As New List(Of Modelos.Factura)
Dim ImporteSeleccionado As Decimal = 0
@@ -1560,13 +1563,14 @@ Partial Class Ventas_ClientesAbonar
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso MsgError = "" Then
If MsgError = "" Then
If ListaFacturasGenerarNC.Count > 0 Then
For Each Fac As Modelos.Factura In ListaFacturasGenerarNC
Dim ListaNC As New List(Of Modelos.Factura)
ListaNC.Add(Fac)
Dim Resp As Modelos.Factura.MMensajeFactura = GenerarNC(ObjIE.IniciaTransacSQL(), ObjConta, ListaNC)
Dim Resp = GenerarNC(ObjIE.IniciaTransacSQL(), ObjConta, ListaNC)
If Resp.CveVenta > 0 Then
If Resp IsNot Nothing AndAlso Resp.Respuesta IsNot Nothing AndAlso Resp.Respuesta.CveVenta > 0 Then
NCGeneradas.Add(Resp)
Else
MsgError = "No se pudo generar la nota de crédito"
@@ -1688,8 +1692,20 @@ Partial Class Ventas_ClientesAbonar
Dim TextoComplementoPago = EmitirComplementoPago(CveIE, CveVentasPago, SeriesPago)
For Each NC In NCGeneradas
StrMsg.AppendFormat("Nota de crédito generada correctamente.<br/><br/> Folio: <a href='/Ventas/Ventas.aspx?CveVenta={0}' target='_blank' class='Texto'>{1}</a><br/>", NC.CveVenta, NC.SerieFolio)
For Each RespuestaNotaCredito In NCGeneradas
If RespuestaNotaCredito IsNot Nothing AndAlso RespuestaNotaCredito.Respuesta IsNot Nothing Then
Try
Dim ObjTimbradoNC As New Timbrado
Dim TimbroNC = ObjTimbradoNC.TimbrarFactura(UsuarioActual, RespuestaNotaCredito.ObjFacturaNC)
If Not TimbroNC Then
Alert(ObjTimbradoNC.MensajeErrorCFDI, TipoMensaje.MsgError)
End If
ObjTimbradoNC = Nothing
Catch ex As Exception
OnError("Ocurrió un error al timbrar la NC.", ex)
End Try
StrMsg.AppendFormat("Nota de crédito generada correctamente.<br/><br/> Folio: <a href='/Ventas/Ventas.aspx?CveVenta={0}' target='_blank' class='Texto'>{1}</a><br/>", RespuestaNotaCredito.Respuesta.CveVenta, RespuestaNotaCredito.Respuesta.SerieFolio)
End If
Next
Alert($"{StrMsg.ToString}<br/><br/>{TextoComplementoPago}", TipoMensaje.MsgInformacion, If(ChkSeguirRegistrando.Checked, "location.href =""#""", "location.href =""/Bancos/RepCxCCliente.aspx"""))
@@ -1738,177 +1754,335 @@ Partial Class Ventas_ClientesAbonar
End Function
#Region " N O T A - D E - C R E D I T O"
Private Class RespuestaNotaCredrito
Public Property ObjFacturaNC As Modelos.Factura
Public Property Respuesta As Modelos.Factura.MMensajeFactura
End Class
Private Function GenerarNC(SqlTransaccion As SqlClient.SqlTransaction, ObjConta As ClsContPAQi, ListaVentasGenerarNC As List(Of Modelos.Factura)) As Modelos.Factura.MMensajeFactura
Dim ObjFacturaDevolucion = New Modelos.Factura(UsuarioActual)
ObjFacturaDevolucion.TipoMensajeRespuesta = Modelos.TipoMensajeRespuesta.HTML
ObjFacturaDevolucion.CveUsuario = UsuarioActual.CveUsuario
ObjFacturaDevolucion.UsuarioCreo = UsuarioActual.Usuario
Private Function GenerarNC(SqlTransaccion As SqlClient.SqlTransaction, ObjConta As ClsContPAQi, ListaVentasGenerarNC As List(Of Modelos.Factura)) As RespuestaNotaCredrito
Dim Retorno As New RespuestaNotaCredrito()
Try
Dim CveSubProyecto As Integer = Me.CveSubProyecto
Dim CveMoneda As Integer = Me.CveMoneda
Dim CveCliente As Integer = Me.CveCliente
Dim ObjFacturaDevolucion = New Modelos.Factura(UsuarioActual)
ObjFacturaDevolucion.TipoMensajeRespuesta = Modelos.TipoMensajeRespuesta.HTML
ObjFacturaDevolucion.CveUsuario = UsuarioActual.CveUsuario
ObjFacturaDevolucion.UsuarioCreo = UsuarioActual.Usuario
If CveSubProyecto <= 0 Then
CveSubProyecto = ListaVentasGenerarNC(0).CveSubProyecto
End If
If CveMoneda <= 0 Then
CveMoneda = ListaVentasGenerarNC(0).CveMoneda
End If
If CveCliente <= 0 Then
CveCliente = ListaVentasGenerarNC(0).CveCliente
End If
Dim Folio As Integer = -1
Dim Serie As String = "-1"
ObjFacturaDevolucion.CveEmpresa = UsuarioActual.CveEmpresa
ObjFacturaDevolucion.TipoCambio = If(Me.CveMoneda = 1, 1, GlobalTipoCambio(Now).FormatoNumero(4).ToDecimal())
ObjFacturaDevolucion.ConvertirPesos = False
ObjFacturaDevolucion.CveMoneda = CveMoneda
ObjFacturaDevolucion.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {CveMoneda}")
ObjFacturaDevolucion.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {CveMoneda}")
ObjFacturaDevolucion.Serie = Serie
ObjFacturaDevolucion.Folio = Folio
ObjFacturaDevolucion.Fecha = Now
ObjFacturaDevolucion.CvePrePoliza = -1
ObjFacturaDevolucion.CveMetodoPago = 0
ObjFacturaDevolucion.CondicionesPago = 0 ' 0 - Contado, 1 - Credito (CHECAR)
ObjFacturaDevolucion.FormaPago = 0
ObjFacturaDevolucion.TipoDocto = "Egs"
ObjFacturaDevolucion.Fecha = Now
ObjFacturaDevolucion.Version = "3.3"
ObjFacturaDevolucion.CveMetodoPago33 = 1
ObjFacturaDevolucion.MetodoPago33 = "Pago en una sola exhibición"
ObjFacturaDevolucion.ClaveMetodoPagoSAT = "PUE"
ObjFacturaDevolucion.CveFormaPago33 = 21
ObjFacturaDevolucion.FormaPago33 = "Aplicación de anticipos"
ObjFacturaDevolucion.FormaPagoSAT33 = "30"
ObjFacturaDevolucion.MetodoPago = ""
ObjFacturaDevolucion.ClaveMetodoPagoSAT = GlobalDTMetodosPago.FiltroPrimeroValor("ClaveSAT", $"CveMetodoPago = {ObjFacturaDevolucion.CveMetodoPago33}")
ObjFacturaDevolucion.CveSubProyecto = CveSubProyecto
ObjFacturaDevolucion.SetSubProyecto()
ObjFacturaDevolucion.CveCliente = CveCliente
ObjFacturaDevolucion.SetCliente()
Dim ObjCliente As New ClsClientes
If ObjCliente.GetClientes(ObjFacturaDevolucion.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
ObjFacturaDevolucion.CveUsoCFDI = ObjCliente.CveUsoCFDI
ObjFacturaDevolucion.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
ObjFacturaDevolucion.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
ObjFacturaDevolucion.DtDetalle = CreaDTDetalleNC()
CargaImpuestos(ObjFacturaDevolucion, ListaVentasGenerarNC, ObjCliente.DesglosaIEPS, ObjCliente.RetIVA, ObjCliente.RetISR)
Dim CveSubProyecto As Integer = Me.CveSubProyecto
Dim CveMoneda As Integer = Me.CveMoneda
Dim CveCliente As Integer = Me.CveCliente
If CveSubProyecto <= 0 Then
CveSubProyecto = ListaVentasGenerarNC(0).CveSubProyecto
End If
End If
If ObjCliente.GetSucursales(CveCliente) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
ObjFacturaDevolucion.CveClienteSucursal = If(String.IsNullOrEmpty(ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'")), -1, ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'").ToEntero())
If CveMoneda <= 0 Then
CveMoneda = ListaVentasGenerarNC(0).CveMoneda
End If
If CveCliente <= 0 Then
CveCliente = ListaVentasGenerarNC(0).CveCliente
End If
Dim Folio As Integer = -1
Dim Serie As String = "-1"
ObjFacturaDevolucion.CveEmpresa = UsuarioActual.CveEmpresa
ObjFacturaDevolucion.TipoCambio = If(Me.CveMoneda = 1, 1, GlobalTipoCambio(Now).FormatoNumero(4).ToDecimal())
ObjFacturaDevolucion.ConvertirPesos = False
ObjFacturaDevolucion.CveMoneda = CveMoneda
ObjFacturaDevolucion.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {CveMoneda}")
ObjFacturaDevolucion.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {CveMoneda}")
ObjFacturaDevolucion.Serie = Serie
ObjFacturaDevolucion.Folio = Folio
ObjFacturaDevolucion.Fecha = Now
ObjFacturaDevolucion.CvePrePoliza = -1
ObjFacturaDevolucion.CveMetodoPago = 0
ObjFacturaDevolucion.CondicionesPago = 0 ' 0 - Contado, 1 - Credito (CHECAR)
ObjFacturaDevolucion.FormaPago = 0
ObjFacturaDevolucion.TipoDocto = "Egs"
ObjFacturaDevolucion.Fecha = Now
If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
ObjFacturaDevolucion.Version = "4.0"
'If ObjFacturaDevolucion.Cliente Is Nothing Then
' ObjFacturaDevolucion.Cliente = New Modelos.ClienteModel
'End If
'ObjFacturaDevolucion.Cliente.CodigoRegimenFiscal = ClienteCodigoRegimenFiscal
'ObjFacturaDevolucion.Cliente.RegimenFiscal = ClienteRegimenFiscal
Else
ObjFacturaDevolucion.CveClienteSucursal = -1
ObjFacturaDevolucion.Version = "3.3"
End If
ObjFacturaDevolucion.CveMetodoPago33 = 1
ObjFacturaDevolucion.MetodoPago33 = "PUE - Pago en una sola exhibición"
ObjFacturaDevolucion.ClaveMetodoPagoSAT = "PUE"
ObjFacturaDevolucion.CveFormaPago33 = 21
ObjFacturaDevolucion.FormaPago33 = "30 - Aplicación de anticipos"
ObjFacturaDevolucion.FormaPagoSAT33 = "30"
ObjFacturaDevolucion.CveSubProyecto = CveSubProyecto
ObjFacturaDevolucion.SetSubProyecto()
ObjFacturaDevolucion.CveCliente = CveCliente
ObjFacturaDevolucion.SetCliente()
Dim ObjCliente As New ClsClientes
If ObjCliente.GetClientes(ObjFacturaDevolucion.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
ObjFacturaDevolucion.CveUsoCFDI = ObjCliente.CveUsoCFDI
ObjFacturaDevolucion.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
ObjFacturaDevolucion.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
ObjFacturaDevolucion.DtDetalle = CreaDTDetalleNC()
CargaImpuestos(ObjFacturaDevolucion, ListaVentasGenerarNC, ObjCliente.DesglosaIEPS, ObjCliente.RetIVA, ObjCliente.RetISR)
End If
End If
If ObjCliente.GetSucursales(CveCliente) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
ObjFacturaDevolucion.CveClienteSucursal = If(String.IsNullOrEmpty(ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'")), -1, ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'").ToEntero())
Else
ObjFacturaDevolucion.CveClienteSucursal = -1
End If
End If
ObjCliente.Dispose()
ObjFacturaDevolucion.CveTipoRelacion = 1
ObjFacturaDevolucion.TipoRelacion = "01"
ObjFacturaDevolucion.DtVentasRelacionadas = New DataTable
ObjFacturaDevolucion.DtVentasRelacionadas.Columns.Add("CveVenta", GetType(Integer))
Dim Fol As New List(Of String)
For Each Fac In ListaVentasGenerarNC
Fol.Add(Fac.FolioFiscal)
Dim RowVenta As DataRow = ObjFacturaDevolucion.DtVentasRelacionadas.NewRow
RowVenta("CveVenta") = Fac.CveVenta
ObjFacturaDevolucion.DtVentasRelacionadas.Rows.Add(RowVenta)
Next
ObjFacturaDevolucion.UUIDRelacionados = Fol
Select Case ObjFacturaDevolucion.TipoDocto
Case "Ing"
ObjFacturaDevolucion.TipoDocumento = "Factura"
Case "REM"
ObjFacturaDevolucion.TipoDocumento = "Remision"
Case "Cot"
ObjFacturaDevolucion.TipoDocumento = "Cotizacion"
Case "Egs"
ObjFacturaDevolucion.TipoDocumento = "Nota de Crédito"
Case "Dev"
ObjFacturaDevolucion.TipoDocumento = "Nota de Devolución"
Case Else
ObjFacturaDevolucion.TipoDocumento = ""
End Select
ObjFacturaDevolucion.FechaPago = Now
ObjFacturaDevolucion.CveCorte = -1
ObjFacturaDevolucion.CveMesa = -1
ObjFacturaDevolucion.NumeroPersonas = 0
ObjFacturaDevolucion.CveContrato = -1
ObjFacturaDevolucion.DescripcionContrato = ""
ObjFacturaDevolucion.CveClienteSucursal = -1
ObjFacturaDevolucion.Entrega = ""
ObjFacturaDevolucion.CveAlmacen = -1
Dim DtVentasNC = InicializaDTVentasNC()
Dim TotalImporte As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("TotalImporte")
Dim ImporteIVA As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteIVA")
Dim ImporteRetIVA As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteRetIVA")
Dim ImporteRetISR As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteRetISR")
Dim ImporteIEPS As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteIEPS")
Dim Descuento As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("Descuento")
Dim Amortizacion As Decimal = 0
Dim Total As Decimal = (TotalImporte + ImporteIVA + ImporteIEPS) - (ImporteRetIVA + ImporteRetISR + Descuento + Amortizacion)
'DETALLES
ObjFacturaDevolucion.SubTotal = TotalImporte
ObjFacturaDevolucion.Descuento = Descuento
ObjFacturaDevolucion.Amortizacion = Amortizacion
ObjFacturaDevolucion.IVA = ImporteIVA
ObjFacturaDevolucion.RetIVA = ImporteRetIVA
ObjFacturaDevolucion.RetISR = ImporteRetISR
ObjFacturaDevolucion.IEPS = ImporteIEPS
ObjFacturaDevolucion.Total = Total
ObjFacturaDevolucion.TotalOtrosConceptos = 0
For Each Fac In ListaVentasGenerarNC
Dim Drt = DtVentasNC.NewRow
Drt("CveVenta") = Fac.CveVenta
Drt("Importe") = Fac.DescuentoProntoPago
Drt("FolioFiscal") = Fac.FolioFiscal
DtVentasNC.Rows.Add(Drt)
Next
DtVentasNC.AcceptChanges()
ObjFacturaDevolucion.DtVentasNC = DtVentasNC
ObjFacturaDevolucion.Timbre = PreParaTimbre(ObjFacturaDevolucion, ListaVentasGenerarNC)
Try
Dim Resp = ObjFacturaDevolucion.EmitirFactura(False, Transac:=SqlTransaccion, ObjContPaqTransac:=ObjConta)
Retorno.Respuesta = Resp
Catch ex As Exception
OnError("Ocurrió un error al guardar la NC de pronto pago", ex)
Retorno.Respuesta = Nothing
End Try
Retorno.ObjFacturaNC = ObjFacturaDevolucion
Catch ex As Exception
OnError("Ocurrió un error al generar la NC de pronto pago", ex)
Retorno = Nothing
End Try
Return Retorno
End Function
Private Function PreParaTimbre(Obj As Modelos.Factura, ListaVentasGenerarNC As List(Of Modelos.Factura)) As CFDITimbre
Dim Timbre As New CFDITimbre
Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", ""))
Timbre.Comprobante.Folio = Obj.Folio.ToString()
Timbre.Comprobante.Serie = Obj.Serie
Timbre.Comprobante.Fecha = Obj.FechaCP
Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33
Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33
Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT
Timbre.Comprobante.SubTotal = Obj.SubTotal
Timbre.Comprobante.Descuentos = Obj.Descuento
Timbre.Comprobante.Moneda = Obj.MonedaSAT
Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString())
Timbre.Comprobante.Total = Obj.Total
Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP
If Timbre.Comprobante.LugarExpedicion = "" Then
Dim aa As String = "no se guardo lugar de expedicion"
aa.GuardaLog()
End If
ObjCliente.Dispose()
ObjFacturaDevolucion.CveTipoRelacion = 7
ObjFacturaDevolucion.TipoRelacion = "07"
ObjFacturaDevolucion.DtVentasRelacionadas = New DataTable
ObjFacturaDevolucion.DtVentasRelacionadas.Columns.Add("CveVenta", GetType(Integer))
Timbre.Comprobante.Confirmacion = ""
Dim Fol As New List(Of String)
For Each Fac In ListaVentasGenerarNC
Fol.Add(Fac.FolioFiscal)
If Obj.FacturarSucursal Then
Timbre.Receptor.RFC = Obj.ClienteSucursal.RFC
Timbre.Receptor.Nombre = Obj.ClienteSucursal.Nombre
Timbre.Receptor.DomicilioFiscalReceptor = Obj.ClienteSucursal.CP
Else
Timbre.Receptor.RFC = Obj.Cliente.RFC
If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
Timbre.Receptor.Nombre = Obj.Cliente.Nombre
Else
Timbre.Receptor.Nombre = Obj.Cliente.Nombre + " " + Obj.Cliente.RegimenSociedad
End If
Timbre.Receptor.DomicilioFiscalReceptor = Obj.Cliente.CP
End If
Dim RowVenta As DataRow = ObjFacturaDevolucion.DtVentasRelacionadas.NewRow
RowVenta("CveVenta") = Fac.CveVenta
Timbre.Receptor.RegimenFiscalReceptor = Obj.Cliente.CodigoRegimenFiscal
ObjFacturaDevolucion.DtVentasRelacionadas.Rows.Add(RowVenta)
Timbre.Receptor.ResidenciaFiscal = ""
Timbre.Receptor.NumeroRegistroTributario = ""
Timbre.Receptor.UsoCFDI = Obj.ClaveUsoCFDI
If ListaVentasGenerarNC IsNot Nothing Then
Timbre.CFDIRelacionados.UUID.Clear()
Dim RowTipoRelacion As DataRow = GlobalDTVtaTiposRelacion().FiltroPrimero($"CveTipoRelacion = {Obj.CveTipoRelacion}")
Timbre.CFDIRelacionados.TipoRelacion = RowTipoRelacion("SATClaveTipoRelacion").ToString()
Timbre.CFDIRelacionados.TipoRelacionTexto = RowTipoRelacion("SATTipoRelacion").ToString()
For Each Fac In ListaVentasGenerarNC
Timbre.CFDIRelacionados.UUID.Add(Fac.FolioFiscal)
Next
End If
Dim totSubTotal As Decimal = If(UsuarioActual.Empresa.CvePAC = 3, Obj.DtDetalle.SUMD("Total"), Obj.SubTotal) 'Obj.SubTotal
Dim totIVA As Decimal = Obj.IVA
Dim totRetIVA As Decimal = Obj.RetIVA
Dim totRetISR As Decimal = Obj.RetISR
Dim i As Integer = 1
'detalles
Dim tPS As String = ""
For Each drr As DataRow In Obj.DtDetalle.Rows
If drr("PS").ToString().Length = 1 Then
tPS = drr("Obs").ToString()
Else
If drr("PS").ToString().Length = 0 Then
tPS = ""
Else
tPS = String.Format("{0} {1}", drr("PS"), drr("Obs"))
End If
End If
tPS = tPS.Replace("|", " ")
If tPS.Length >= 1000 Then
Dim tPSRecortado = tPS.Remove(999, tPS.Length - 999)
tPS = tPSRecortado
End If
'condicionante, especial
If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" ' les comentan que no debe de ir la etiqueta de "unidad" en el producto
Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString().ToDecimal,
.Descripcion = tPS,
.ValorUnitario = drr("PU").ToString().ToDecimal,
.Importe = If(UsuarioActual.Empresa.CvePAC = 3, drr("Total").ToString().ToDecimal.RoundSQL(2), drr("TotalImporte").ToString().ToDecimal),
.Descuento = drr("Descuento").ToString().ToDecimal.RoundSQL(2),
.Unidad = drr("UM").ToString(),
.ClaveUnidad = drr("SATClaveUM").ToString(),
.ClaveProdServ = drr("SATClaveProdServ").ToString(),
.Noidentificacion = drr("Noidentificacion").ToString(),
.CuentaPredial = drr("CuentaPredial").ToString(),
.ImporteGravaIVAAdicional = drr("ImporteIEPS").ToString().ToDecimal,
.ObjetoImpuesto = drr("CodigoObjetoImpuesto").ToString()}
'verifica suma subtotales
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
End If
totSubTotal = totSubTotal - concepto.Importe
'siempre estaremos agregando el iva, auqnue sea en importe cero o tasa cero, para que se emita la factura
' If drr("ImporteIVA").ToString().ToDouble > 0 Then
'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
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
If drr("ImporteIEPS").ToString().ToDouble > 0 Then
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
If drr("ImporteRetIVA").ToString().ToDouble > 0 Then 'si hay retenciones
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
If drr("ImporteRetISR").ToString().ToDouble > 0 Then 'retención de ISR
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
Timbre.Conceptos.Add(concepto)
i += 1
Next
ObjFacturaDevolucion.UUIDRelacionados = Fol
Select Case ObjFacturaDevolucion.TipoDocto
Case "Ing"
ObjFacturaDevolucion.TipoDocumento = "Factura"
Case "REM"
ObjFacturaDevolucion.TipoDocumento = "Remision"
Case "Cot"
ObjFacturaDevolucion.TipoDocumento = "Cotizacion"
Case "Egs"
ObjFacturaDevolucion.TipoDocumento = "Nota de Crédito"
Case "Dev"
ObjFacturaDevolucion.TipoDocumento = "Nota de Devolución"
Case Else
ObjFacturaDevolucion.TipoDocumento = ""
End Select
ObjFacturaDevolucion.FechaPago = Now
ObjFacturaDevolucion.CveCorte = -1
ObjFacturaDevolucion.CveMesa = -1
ObjFacturaDevolucion.NumeroPersonas = 0
ObjFacturaDevolucion.CveContrato = -1
ObjFacturaDevolucion.DescripcionContrato = ""
ObjFacturaDevolucion.CveClienteSucursal = -1
ObjFacturaDevolucion.Entrega = ""
ObjFacturaDevolucion.CveAlmacen = -1
Dim DtVentasNC = InicializaDTVentasNC()
Dim TotalImporte As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("TotalImporte")
Dim ImporteIVA As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteIVA")
Dim ImporteRetIVA As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteRetIVA")
Dim ImporteRetISR As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteRetISR")
Dim ImporteIEPS As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteIEPS")
Dim Descuento As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("Descuento")
Dim Amortizacion As Decimal = 0
Dim Total As Decimal = (TotalImporte + ImporteIVA + ImporteIEPS) - (ImporteRetIVA + ImporteRetISR + Descuento + Amortizacion)
'DETALLES
ObjFacturaDevolucion.SubTotal = TotalImporte
ObjFacturaDevolucion.Descuento = Descuento
ObjFacturaDevolucion.Amortizacion = Amortizacion
ObjFacturaDevolucion.IVA = ImporteIVA
ObjFacturaDevolucion.RetIVA = ImporteRetIVA
ObjFacturaDevolucion.RetISR = ImporteRetISR
ObjFacturaDevolucion.IEPS = ImporteIEPS
ObjFacturaDevolucion.Total = Total
ObjFacturaDevolucion.TotalOtrosConceptos = 0
For Each Fac In ListaVentasGenerarNC
Dim Drt = DtVentasNC.NewRow
Drt("CveVenta") = Fac.CveVenta
Drt("Importe") = Fac.DescuentoProntoPago
Drt("FolioFiscal") = Fac.FolioFiscal
DtVentasNC.Rows.Add(Drt)
Next
DtVentasNC.AcceptChanges()
ObjFacturaDevolucion.DtVentasNC = DtVentasNC
Dim Resp = ObjFacturaDevolucion.EmitirFactura(False, Transac:=SqlTransaccion, ObjContPaqTransac:=ObjConta)
ObjFacturaDevolucion.Dispose()
Return Resp
Return Timbre
End Function
@@ -1975,7 +2149,10 @@ Partial Class Ventas_ClientesAbonar
Row("CveOrdenCompraDetalle") = CveOrdenCompraDetalle
Row("CveVentaDetalleRemision") = CveVentaDetalleRemision
Row("CveVentaDetalleCotizacion") = CveVentaDetalleCotizacion
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If DrPS IsNot Nothing Then
Row("CodigoObjetoImpuesto") = DrPS("CodigoObjetoImpuesto")
End If
TmpDT.Rows.Add(Row)
End Sub
@@ -2193,6 +2370,7 @@ Partial Class Ventas_ClientesAbonar
TmpDT.Columns.Add("ClaveSATUnidadAduanaDescripcion", GetType(String))
TmpDT.Columns.Add("CveTamaño", GetType(Integer))
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
TmpDT.Columns.Add("CodigoObjetoImpuesto", GetType(String))
Return TmpDT
End Function

View File

@@ -5211,7 +5211,12 @@ Partial Class PV
'SOLO VALIDA EXISTENCIAS Y COSTO: SI USA INVENTARIOS, SOLO PRODUCTOS TIPO PRODUCTO, SOLO REMISIONES E INGRESOS
If UsuarioActual.Empresa.UsaInventarios AndAlso CveTipoPS = 2 AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "PA") Or (DdlTipoComprobante.SelectedValue.Contiene("Cot") And UsuarioActual.CveEmpresa.Contiene(119, 140))) Then
Dim ObjInventarios As New ClsInventarios
Dim Existencia As Decimal = ObjInventarios.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1)
Dim CveTipoAlmacen As Integer = 1
If ChkServicioDomicilio.Checked Then
CveTipoAlmacen = 29
End If
Dim Existencia As Decimal = ObjInventarios.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, -1, CveTipoAlmacen:=CveTipoAlmacen, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
Dim Costo As Decimal = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero)
ObjInventarios.Dispose()
Dim PrecioMinimo As Decimal = 0

View File

@@ -62,9 +62,9 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
}
ObjVentas.Dispose();
GvDatos.DataSource = DtVentas.FiltraParametros("(CveEstatusFactura = 20 AND CveEstatusRefacturacion IN (0,4))");
GvDatos.DataSource = DtVentas.FiltraParametros("(CveEstatusFactura IN (20,23) AND CveEstatusRefacturacion IN (0,4))");
var DtRefacturar = DtVentas.FiltraParametros("CveEstatusRefacturacion IN (1,3) OR (CveEstatusFactura = 20 AND CveEstatusRefacturacion IN (1,2,3)) OR CveEstatusFactura = 23");
var DtRefacturar = DtVentas.FiltraParametros("CveEstatusRefacturacion IN (1,3) OR (CveEstatusFactura IN (20,23) AND CveEstatusRefacturacion IN (1,2,3))");
if (DtRefacturar != null && DtRefacturar.Rows.Count > 0)
{
DivRefacturar.Visible = true;
@@ -595,15 +595,10 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
//
//if (e.Row.DBCampo("PuedeRefacturar").ToString().ToEntero() == 1 && e.Row.DBCampo("CveEstatusFactura").ToString().ToEntero() == 23)
//{
// e.Row.FCLinkButton("LnkValidarRefac").Visible = false;
//}
if (e.Row.DBCampo("CveEstatusFactura").ToEntero() == 23)
if (e.Row.DBCampo("PuedeRefacturar").ToString().ToEntero() == 1 && e.Row.DBCampo("CveEstatusFactura").ToString().ToEntero() == 23)
{
e.Row.FCLinkButton("LnkValidarRefac").Visible = false;
}
}
if (e.Row.DBCampo("PuedeRefacturar") == "0" && e.Row.DBCampo("CveEstatusFactura") == "23" && e.Row.DBCampo("CveVentaSustitucion").ToEntero() > 0)
{

View File

@@ -2406,8 +2406,7 @@
</div>
</div>
</div>
</div>
</div>
</div> </div>
<div class="row">
<div class="col-md-12">
<div class="portlet light xspadding bordered whitoutcol" style="width: 100%;">
@@ -2418,10 +2417,12 @@
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
Emitir <asp:CheckBox ID="ChkEmitirComercioExterior" runat="server" CssClass="chksino" Text=" " OnCheckedChanged="ChkEmitirComercioExterior_CheckedChanged" AutoPostBack="true" />
<a href="javascript:;" onclick="CargaComercioExterior()" class="expand"></a>
</div>
</div>
@@ -2429,6 +2430,16 @@
<asp:UpdatePanel ID="UpComercioExterior" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="form-body">
<%-- <div class="row rowpadding">
<label class="col-md-2">Emitir:</label>
<div class="col-md-10">
</div>
</div>
<br /> --%>
<div class="row">
<label class="col-md-2 form-group form-md-line-input">Tipo Operación:</label>
<div class="col-md-3 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">

View File

@@ -5148,7 +5148,6 @@ Partial Class Ventas
'ESTATUS FACTURA
If Not (CveRemision > 0 Or CveCotizacion > 0) Then
CveEstatus = DbRowVenta("CveEstatusFactura").ToString().ToEntero()
End If
TxtTipoCambio.Text = DbRowVenta("TipoCambio").ToString()
@@ -6334,6 +6333,10 @@ Partial Class Ventas
LblTipoOperacion.Text = ObjCliente.ClaveSATTipoOperacionDescripcion
LblClavePedimento.Text = ObjCliente.ClaveSATPedimentoDescripcion
If ObjCliente.AplicaComercioExterior Then
ChkEmitirComercioExterior.Checked = True
End If
If ObjCliente.AplicaComercioExterior Then
DdlSATMotivoTraslado.DataSource = GlobalDTSATMotivoTraslado
DdlSATMotivoTraslado.DataBind()
@@ -6365,6 +6368,8 @@ Partial Class Ventas
TxtComExtCalle.Text = ObjCliente.Direccion
TxtComExtNumero.Text = ObjCliente.NoExt
TxtComExtCP.Text = ObjCliente.CP
'en comercio exterior como regla de timbrado se utiliza el TC del día anterior
TxtTipoCambio.Text = GlobalTipoCambio(TxtFecha.Text.ToDate.AddDays(-1)).ToString()
End If
@@ -7772,6 +7777,11 @@ Partial Class Ventas
e.Row.FCLiteral("LtCantidadFacturada").Text = e.Row.DBCampo("CantidadFacturadaPed2").ToDecimal.ToString("#,##0.##")
End Select
If EsCreaApartirDe Then
e.Row.FCLinkButton("imgD").Visible = True
e.Row.FCLinkButton("imgE").Visible = True
End If
'If GvInv.Rows.Count > 0 AndAlso ModalidadEdicion AndAlso DdlTipoComprobante.SelectedValue = "Rem" AndAlso e.Row.DataKey("CveVentaDetalle").ToString().ToEntero() > 0 Then
' e.Row.FCLinkButton("imgE").Enabled = False
' e.Row.FCLinkButton("imgE").ToolTip = "No se puede editar debido a que ya hay un movimiento de almacen."
@@ -8624,17 +8634,41 @@ Partial Class Ventas
If TipoDocumentoAutorizacion = "Ing" Then
If TipoAutorizacion = 1 Then
If ImporteAutorizacion < TxtTotal.Text.ToDecimal() Then
CveAutorizacion = -1
Alert($"El crédito autorizado es insuficiente. Crédito Disponible:{ImporteAutorizacion:N2}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If TieneDiasVencidos Then
CveAutorizacion = -1
Alert($"El crédito no esta autorizado. El cliente tiene días vencidos", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If ImporteAutorizacion < TxtTotal.Text.ToDecimal() Then
Dim BloquearCredito As Boolean = True
CveAutorizacion = -1
'VERIFICA SI TIENE CREDITO DISPONIBLE DENTRO DEL CLIENTE
Dim ObjCred As New ClsVentas
If ObjCred.ObtenerCreditoRestante(CveCliente, DdlSucursalCliente.SelectedValue.ToEntero()) AndAlso ObjCred.DtResultados.Rows.Count > 0 Then
'SI TIENE CREDITO DISPONIBLE NO BLOQUEAR AUNQUE LA AUTORIZACION NO TENGA EL IMPORTE DEL DOCUMENTO
If DdlSucursalCliente.SelectedValue.ToEntero() > 0 Then
If (ObjCred.DtResultados(0)("LimiteRestanteSucursal").ToString().ToDecimal - If(TxtTipoCambio.Visible, TxtTotal.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal, TxtTotal.Text.ToDecimal)) > 0 Then
BloquearCredito = False
End If
Else
If (ObjCred.DtResultados(0)("LimiteRestanteCliente").ToString().ToDecimal - If(TxtTipoCambio.Visible, TxtTotal.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal, TxtTotal.Text.ToDecimal)) > 0 Then
BloquearCredito = False
End If
End If
End If
ObjCred.Dispose()
If BloquearCredito Then
Alert($"El crédito autorizado es insuficiente. Crédito Disponible:{ImporteAutorizacion:N2}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
End If
'If TipoAutorizacion = 2 Then
@@ -11735,6 +11769,10 @@ Partial Class Ventas
Private Function PreParaTimbre(Obj As Modelos.Factura) As CFDITimbre
Dim Timbre As New CFDITimbre
Timbre.Comprobante.Version = If(UsuarioActual.Empresa.Funcionalidad(350) = "1", "4.0", "3.3")
Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", ""))
Timbre.Comprobante.Folio = Obj.Folio.ToString()
Timbre.Comprobante.Serie = Obj.Serie
@@ -11943,104 +11981,121 @@ Partial Class Ventas
i += 1
Next
Dim AplicaComercioExteriorSubProyecto As Boolean = If(GlobalDTSubProyectos(-1, Obj.CveSubProyecto, CveEmpresa:=UsuarioActual.CveEmpresa)(0)("AplicaComercioExterior").ToString() = "True", True, False)
Timbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto = AplicaComercioExteriorSubProyecto
If Obj.Cliente.AplicaComercioExterior And AplicaComercioExteriorSubProyecto Then
'DATOS GENERALES
Timbre.Complementos.ComercioExterior11.TipoOperacion = GlobalDTTipoOperacion().FiltraParametros($"CveTipoOperacion={CveTipoOperacion}")(0)("ClaveSATTipoOperacion").ToString()
Timbre.Complementos.ComercioExterior11.ClavedePedimento = GlobalDTClavePedimento().FiltraParametros($"CvePedimento={CvePedimento}")(0)("ClaveSATPedimento").ToString()
Timbre.Complementos.ComercioExterior11.CertificadoOrigen = "0"
Timbre.Complementos.ComercioExterior11.Incoterm = GlobalDTIncoterm.FiltroPrimeroValor("ClaveSATIncoterm", $"CveIncoterm={DdlIncoterm.SelectedValue}")
Timbre.Complementos.ComercioExterior11.Subdivision = "0"
Timbre.Complementos.ComercioExterior11.TipoCambioUSD = If(Obj.CveMoneda = 1, 1, Obj.TipoCambio.ToString().ToDecimal)
Timbre.Complementos.ComercioExterior11.MotivoTraslado = GlobalDTSATMotivoTraslado.FiltroPrimeroValor("ClaveSATMotivoTraslado", $"CveMotivoTraslado={DdlSATMotivoTraslado.SelectedValue}")
Dim AplicaComercioExteriorSubProyecto As Boolean
If ChkEmitirComercioExterior.Checked Then
AplicaComercioExteriorSubProyecto = If(GlobalDTSubProyectos(-1, Obj.CveSubProyecto, CveEmpresa:=UsuarioActual.CveEmpresa)(0)("AplicaComercioExterior").ToString() = "True", True, False)
Timbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto = AplicaComercioExteriorSubProyecto
If Obj.Cliente.AplicaComercioExterior And AplicaComercioExteriorSubProyecto Then
'DATOS GENERALES
Timbre.Comprobante.Exportacion = "02"
Timbre.Complementos.ComercioExterior11.TipoOperacion = GlobalDTTipoOperacion().FiltraParametros($"CveTipoOperacion={CveTipoOperacion}")(0)("ClaveSATTipoOperacion").ToString()
Timbre.Complementos.ComercioExterior11.ClavedePedimento = GlobalDTClavePedimento().FiltraParametros($"CvePedimento={CvePedimento}")(0)("ClaveSATPedimento").ToString()
Timbre.Complementos.ComercioExterior11.CertificadoOrigen = "0"
Timbre.Complementos.ComercioExterior11.Incoterm = GlobalDTIncoterm.FiltroPrimeroValor("ClaveSATIncoterm", $"CveIncoterm={DdlIncoterm.SelectedValue}")
Timbre.Complementos.ComercioExterior11.Subdivision = "0"
Timbre.Complementos.ComercioExterior11.TipoCambioUSD = If(Obj.CveMoneda = 1, 1, Obj.TipoCambio.ToString().ToDecimal)
Timbre.Complementos.ComercioExterior11.MotivoTraslado = GlobalDTSATMotivoTraslado.FiltroPrimeroValor("ClaveSATMotivoTraslado", $"CveMotivoTraslado={DdlSATMotivoTraslado.SelectedValue}")
'EMISOR
Dim Dr As DataRow
Dr = Nothing
If GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).Rows.Count > 0 Then
Dr = GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa)(0)
End If
Timbre.Complementos.ComercioExterior11.Emisor.CURP = UsuarioActual.Empresa.CURP
Timbre.Complementos.ComercioExterior11.Emisor.Calle = Dr("Calle").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.NumeroExterior = Dr("NoExt").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.NumeroInterior = Dr("NoInt").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.Colonia = Dr("ClaveSATColonia").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.Localidad = ""
Timbre.Complementos.ComercioExterior11.Emisor.Municipio = Dr("ClaveSATMunicipio").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.Estado = Dr("ClaveSATEstado").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.Pais = Dr("ClaveSATPais").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.CP = Dr("ClaveSATCP").ToString()
'RECEPTOR
Timbre.Complementos.ComercioExterior11.Receptor.NumRegIdTrib = "" ' EN LA VERSION 3.3 NO DEBE DE REGISTRARSE ESTE VALOR
Timbre.Complementos.ComercioExterior11.Receptor.Calle = Obj.Cliente.Direccion
Timbre.Complementos.ComercioExterior11.Receptor.NumeroExterior = Obj.Cliente.NoExt
Timbre.Complementos.ComercioExterior11.Receptor.NumeroInterior = Obj.Cliente.NoInt
Timbre.Complementos.ComercioExterior11.Receptor.Colonia = Obj.Cliente.ClaveSATColonia
Timbre.Complementos.ComercioExterior11.Receptor.Localidad = ""
Timbre.Complementos.ComercioExterior11.Receptor.Referencia = Obj.Cliente.ReferenciaFiscal
Timbre.Complementos.ComercioExterior11.Receptor.Municipio = Obj.Cliente.Ciudad
Timbre.Complementos.ComercioExterior11.Receptor.CP = Obj.Cliente.CP
Timbre.Complementos.ComercioExterior11.Receptor.Estado = Obj.Cliente.ClaveSATEstado
Timbre.Complementos.ComercioExterior11.Receptor.Pais = Obj.Cliente.ClaveSATPais
Timbre.Receptor.ResidenciaFiscal = Obj.Cliente.ClaveSATPais
Timbre.Receptor.NumeroRegistroTributario = Obj.Cliente.NumRegIdTrib
'EMISOR
Dim Dr As DataRow
Dr = Nothing
If GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).Rows.Count > 0 Then
Dr = GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa)(0)
End If
Timbre.Complementos.ComercioExterior11.Emisor.CURP = UsuarioActual.Empresa.CURP
Timbre.Complementos.ComercioExterior11.Emisor.Calle = Dr("Calle").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.NumeroExterior = Dr("NoExt").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.NumeroInterior = Dr("NoInt").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.Colonia = Dr("ClaveSATColonia").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.Localidad = ""
Timbre.Complementos.ComercioExterior11.Emisor.Municipio = Dr("ClaveSATMunicipio").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.Estado = Dr("ClaveSATEstado").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.Pais = Dr("ClaveSATPais").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.CP = Dr("ClaveSATCP").ToString()
Dim ComExtPais, ComExtEstado, ComExtMunicipio, ComExtColonia, ComExtCalle, ComExtNumero, ComExtCP As String
ComExtColonia = "" : ComExtMunicipio = ""
ComExtPais = GlobalDTGralPaises.FiltroPrimeroValor("ClaveSATPais", $"CvePais={DdlComExtPais.SelectedValue}")
ComExtCalle = TxtComExtCalle.Text.Trim
ComExtNumero = TxtComExtNumero.Text.Trim
ComExtCP = TxtComExtCP.Text.Trim
If ComExtPais = "MEX" Then
ComExtEstado = GlobalDTGralEstados(ComExtPais).FiltroPrimeroValor("ClaveSATEstado", $"CveEstado={DdlComExtEstado.SelectedValue}")
ComExtMunicipio = GlobalDTGralMunicipios(ComExtEstado).FiltroPrimeroValor("ClaveSATMunicipio", $"CveMunicipio={DdlComExtMunicipio.SelectedValue}")
ComExtColonia = GlobalDTGralColonias("-1", "-1", "-1", CveColonia:=DdlComExtColonia.SelectedValue.ToEntero).FiltroPrimeroValor("ClaveSATColonia", "")
Else
If ComExtPais.Contiene("USA", "CAN") Then
'RECEPTOR
Timbre.Complementos.ComercioExterior11.Receptor.NumRegIdTrib = If(Timbre.Comprobante.Version = "4.0", Obj.Cliente.NumRegIdTrib, "") ' EN LA VERSION 3.3 NO DEBE DE REGISTRARSE ESTE VALOR
Timbre.Complementos.ComercioExterior11.Receptor.Calle = Obj.Cliente.Direccion
Timbre.Complementos.ComercioExterior11.Receptor.NumeroExterior = Obj.Cliente.NoExt
Timbre.Complementos.ComercioExterior11.Receptor.NumeroInterior = Obj.Cliente.NoInt
Timbre.Complementos.ComercioExterior11.Receptor.Colonia = Obj.Cliente.ClaveSATColonia
Timbre.Complementos.ComercioExterior11.Receptor.Localidad = ""
Timbre.Complementos.ComercioExterior11.Receptor.Referencia = Obj.Cliente.ReferenciaFiscal
Timbre.Complementos.ComercioExterior11.Receptor.Municipio = Obj.Cliente.Ciudad
Timbre.Complementos.ComercioExterior11.Receptor.CP = Obj.Cliente.CP
Timbre.Complementos.ComercioExterior11.Receptor.Estado = Obj.Cliente.ClaveSATEstado
Timbre.Complementos.ComercioExterior11.Receptor.Pais = Obj.Cliente.ClaveSATPais
Timbre.Receptor.ResidenciaFiscal = Obj.Cliente.ClaveSATPais
Timbre.Receptor.NumeroRegistroTributario = Obj.Cliente.NumRegIdTrib
Dim ComExtPais, ComExtEstado, ComExtMunicipio, ComExtColonia, ComExtCalle, ComExtNumero, ComExtCP As String
ComExtColonia = "" : ComExtMunicipio = ""
ComExtPais = GlobalDTGralPaises.FiltroPrimeroValor("ClaveSATPais", $"CvePais={DdlComExtPais.SelectedValue}")
ComExtCalle = TxtComExtCalle.Text.Trim
ComExtNumero = TxtComExtNumero.Text.Trim
ComExtCP = TxtComExtCP.Text.Trim
If ComExtPais = "MEX" Then
ComExtEstado = GlobalDTGralEstados(ComExtPais).FiltroPrimeroValor("ClaveSATEstado", $"CveEstado={DdlComExtEstado.SelectedValue}")
ComExtMunicipio = GlobalDTGralMunicipios(ComExtEstado).FiltroPrimeroValor("ClaveSATMunicipio", $"CveMunicipio={DdlComExtMunicipio.SelectedValue}")
ComExtColonia = GlobalDTGralColonias("-1", "-1", "-1", CveColonia:=DdlComExtColonia.SelectedValue.ToEntero).FiltroPrimeroValor("ClaveSATColonia", "")
Else
ComExtEstado = TxtComExtEstado.Text.Trim
If ComExtPais.Contiene("USA", "CAN") Then
ComExtEstado = GlobalDTGralEstados(ComExtPais).FiltroPrimeroValor("ClaveSATEstado", $"CveEstado={DdlComExtEstado.SelectedValue}")
Else
ComExtEstado = TxtComExtEstado.Text.Trim
End If
ComExtMunicipio = TxtComExtMunicipio.Text.Trim
ComExtColonia = TxtComExtColonia.Text.Trim
End If
ComExtMunicipio = TxtComExtMunicipio.Text.Trim
ComExtColonia = TxtComExtColonia.Text.Trim
'DESTINATARIO
Timbre.Complementos.ComercioExterior11.Destinatario.Nombre = TxtDestinatarioNombre.Text.Trim
Timbre.Complementos.ComercioExterior11.Destinatario.Calle = ComExtCalle
Timbre.Complementos.ComercioExterior11.Destinatario.NumeroExterior = ComExtNumero
Timbre.Complementos.ComercioExterior11.Destinatario.NumeroInterior = ""
Timbre.Complementos.ComercioExterior11.Destinatario.Colonia = ComExtColonia
Timbre.Complementos.ComercioExterior11.Destinatario.Localidad = ""
Timbre.Complementos.ComercioExterior11.Destinatario.Referencia = Obj.Cliente.ReferenciaFiscal
Timbre.Complementos.ComercioExterior11.Destinatario.Municipio = ComExtMunicipio
Timbre.Complementos.ComercioExterior11.Destinatario.CP = ComExtCP
Timbre.Complementos.ComercioExterior11.Destinatario.Estado = ComExtEstado
Timbre.Complementos.ComercioExterior11.Destinatario.Pais = ComExtPais
Timbre.Complementos.ComercioExterior11.Destinatario.NumRegIdTrib = TxtNumRegIdTrib.Text.Trim
'MERCANCIAS
For Each Gvr As GridViewRow In GvComercioExterior.Rows
Dim mercancia As New CFDIComercioExterior11Mercancias With {.CantidadAduana = Gvr.FCTextBox("TxtCantidad").Text.ToDecimal,
.FraccionArancelaria = Gvr.DataKey("ClaveSATFraccionArancelaria").ToString(),
.UnidadAduana = Gvr.DataKey("ClaveSATUnidadAduana").ToString(),
.ValorDolares = Math.Round(Gvr.FCTextBox("TxtCantidad").Text.ToDecimal * Gvr.FCTextBox("TxtValorUnitario").Text.ToDecimal, 2),
.ValorUnitarioAduana = Gvr.FCTextBox("TxtValorUnitario").Text.ToDecimal,
.NoIdentificacion = Gvr.DataKey("Codigo")}
If Gvr.FCTextBox("TxtMarca").Text <> "" Then
mercancia.DescripcionesEspecificas.Marca = Gvr.FCTextBox("TxtMarca").Text
End If
Timbre.Complementos.ComercioExterior11.Mercancias.Add(mercancia)
i += 1
Next
End If
'DESTINATARIO
Timbre.Complementos.ComercioExterior11.Destinatario.Nombre = TxtDestinatarioNombre.Text.Trim
Timbre.Complementos.ComercioExterior11.Destinatario.Calle = ComExtCalle
Timbre.Complementos.ComercioExterior11.Destinatario.NumeroExterior = ComExtNumero
Timbre.Complementos.ComercioExterior11.Destinatario.NumeroInterior = ""
Timbre.Complementos.ComercioExterior11.Destinatario.Colonia = ComExtColonia
Timbre.Complementos.ComercioExterior11.Destinatario.Localidad = ""
Timbre.Complementos.ComercioExterior11.Destinatario.Referencia = Obj.Cliente.ReferenciaFiscal
Timbre.Complementos.ComercioExterior11.Destinatario.Municipio = ComExtMunicipio
Timbre.Complementos.ComercioExterior11.Destinatario.CP = ComExtCP
Timbre.Complementos.ComercioExterior11.Destinatario.Estado = ComExtEstado
Timbre.Complementos.ComercioExterior11.Destinatario.Pais = ComExtPais
Timbre.Complementos.ComercioExterior11.Destinatario.NumRegIdTrib = TxtNumRegIdTrib.Text.Trim
'MERCANCIAS
For Each Gvr As GridViewRow In GvComercioExterior.Rows
Dim mercancia As New CFDIComercioExterior11Mercancias With {.CantidadAduana = Gvr.FCTextBox("TxtCantidad").Text.ToDecimal,
.FraccionArancelaria = Gvr.DataKey("ClaveSATFraccionArancelaria").ToString(),
.UnidadAduana = Gvr.DataKey("ClaveSATUnidadAduana").ToString(),
.ValorDolares = Math.Round(Gvr.FCTextBox("TxtCantidad").Text.ToDecimal * Gvr.FCTextBox("TxtValorUnitario").Text.ToDecimal, 2),
.ValorUnitarioAduana = Gvr.FCTextBox("TxtValorUnitario").Text.ToDecimal,
.NoIdentificacion = Gvr.DataKey("Codigo")}
If Gvr.FCTextBox("TxtMarca").Text <> "" Then
mercancia.DescripcionesEspecificas.Marca = Gvr.FCTextBox("TxtMarca").Text
End If
Timbre.Complementos.ComercioExterior11.Mercancias.Add(mercancia)
i += 1
Next
Else
Timbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto = False
End If
Return Timbre
End Function
@@ -15615,16 +15670,12 @@ Partial Class Ventas
Dim TipoMovimiento As Boolean = True
Dim Concepto As String = VentaActual.SerieFolio
Dim Referencia As String = VentaActual.SerieFolio
CveIEAnticipo = gvr.DataKey("CveIE").ToEntero()
Select Case gvr.DataKey("CveConceptoContable").ToString()
Case "3"
CveIEAnticipo = gvr.DataKey("CveIE").ToEntero()
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal - ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("TotalAnticipo").ToDecimal) * gvr.DataKey("IVAAnticipo").ToDecimal)
' TipoCambioGeneral = tipoCambioPago
' IdCtaContable = IdCtaContAnticipos
If importeMovimiento <> 0 Then
Dim Pago As New VentaPago
@@ -15682,6 +15733,8 @@ Partial Class Ventas
Pago.TipoPago = "NC"
Pago.CveVentaAmortizacion = gvr.DataKey("CveVenta").ToEntero()
Pago.AplicaTraslado = gvr.DataKey("RegresarImpuesto") = "1"
Pago.Referencia = gvr.DataKey("Folio")
Pago.CveConceptoPago = 251
ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta)
SimplificaPrePoliza = False
@@ -15689,7 +15742,7 @@ Partial Class Ventas
Case "66"
If gvr.DataKey("CveIE").ToEntero() > 0 Then
CveIEAnticipo = gvr.DataKey("CveIE").ToEntero()
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
IdCtaContable = IdCtaContClientes
@@ -15702,6 +15755,7 @@ Partial Class Ventas
Pago.TipoPago = "A"
Pago.CveVentaAmortizacion = gvr.DataKey("CveVenta").ToEntero()
Pago.AplicaTraslado = gvr.DataKey("RegresarImpuesto") = "1"
Pago.Referencia = gvr.DataKey("Folio")
ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta)
@@ -29293,8 +29347,9 @@ Partial Class Ventas
Private Sub CargaEstado()
DdlComExtEstado.Items.Clear()
If DdlComExtPais.SelectedValue.ToEntero() > 0 Then
DdlComExtEstado.DataSource = GlobalDTGralEstados("-1", CvePais:=DdlComExtPais.SelectedValue.ToEntero)(0)("ClaveSATPais").ToString()
DdlComExtEstado.DataSource = GlobalDTGralEstados("-1", CvePais:=DdlComExtPais.SelectedValue.ToEntero) '(0)("ClaveSATPais").ToString()
End If
DdlComExtEstado.Visible = True
DdlComExtEstado.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlComExtEstado.DataBind()
End Sub
@@ -33151,6 +33206,15 @@ Partial Class Ventas
UpFacturar.Update()
End If
ObjVentas.Dispose()
'REGENERAR EL PDF
Try
Dim strURLHOST = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port)
Dim Hilo As New System.Threading.Thread(Sub() RegenerarPDF(CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, strURLHOST))
Hilo.Start()
Catch ex As Exception
OnError("Ocurrió un error al regenerar el PDF", ex)
End Try
End Sub
Private Function DeshabilitarAplicarNotaDeCredito(RFC As String) As Boolean
@@ -34981,5 +35045,10 @@ Partial Class Ventas
End Function
Protected Sub ChkEmitirComercioExterior_CheckedChanged(sender As Object, e As EventArgs)
End Sub
End Class