This commit is contained in:
rakcsle
2022-07-05 19:32:14 -07:00
27 changed files with 8517 additions and 1315 deletions

View File

@@ -190,8 +190,8 @@ Partial Class AC_RegDevengadoIngresos
'Detalles de PrePoliza 'Detalles de PrePoliza
If Not ErrorAC Then If Not ErrorAC Then
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDouble, "", 30, "", Now, 0, -1, CveIE) Then If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, 30, "", "", -1, CveIE) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDouble, "", 4, "", Now, 0, -1, CveIE) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, 4, "", "", -1, CveIE) Then
ErrorAC = True ErrorAC = True
End If End If
Else Else

View File

@@ -165,8 +165,8 @@ Partial Class AC_RegRecaudado
'Detalles de PrePoliza 'Detalles de PrePoliza
If Not ErrorAC Then If Not ErrorAC Then
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDouble, "", 30, "", Fecha, 0, -1, CveIE, CveCliente:=CveCliente) Then If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, 30, "", "", 0, CveIE, CveCliente:=CveCliente) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDouble, "", 4, "", Fecha, 0, -1, CveIE, CveCliente:=CveCliente) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, 4, "", "", 0, CveIE, CveCliente:=CveCliente) Then
ErrorAC = True ErrorAC = True
End If End If
Else Else

View File

@@ -1014,7 +1014,7 @@ Public Class ClsContabilidad
Return Retorno Return Retorno
End Function End Function
Public Function AddPrePolizasDetalle(CvePrePoliza As Integer, TipoMovimiento As Boolean, Importe As Decimal, ImporteMN As Decimal, Referencia As String, CveConceptoContable As Integer, Concepto As String, IdCtaContable As Integer, Public Function AddPrePolizasDetalle(CvePrePoliza As Integer, TipoMovimiento As Boolean, Importe As Decimal, ImporteMN As Decimal, CveConceptoContable As Integer, Referencia As String, Concepto As String, IdCtaContable As Integer,
Optional CveIE As Integer = -1, Optional CveVenta As Integer = -1, Optional CveCompra As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional CveCliente As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveIE As Integer = -1, Optional CveVenta As Integer = -1, Optional CveCompra As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional CveCliente As Integer = -1, Optional CveProveedor As Integer = -1,
Optional CvePersonal As Integer = -1, Optional CveMovimientoAlmacen As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveColectiva As Integer = -1, Optional CveCreditoDetalle As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveMovimientoAlmacen As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveColectiva As Integer = -1, Optional CveCreditoDetalle As Integer = -1,
Optional CveOC As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveVentaAmortizacion As Integer = -1, Optional CveCompraAmortizacion As Integer = -1, Optional ImporteME As Decimal = 0, Optional CveOC As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveVentaAmortizacion As Integer = -1, Optional CveCompraAmortizacion As Integer = -1, Optional ImporteME As Decimal = 0,

View File

@@ -3267,6 +3267,29 @@ Public Class ClsNominas
Return retorno Return retorno
End Function End Function
Public Function PreNominaTotalSemana(numeroPeriodo As Int32, cveEmpresa As Int32, cveSubProyecto As Int32, cveTipoNomina As Int32, tipoTrabajador As String, ejercicio As Int32, facturado As Boolean) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_RH_PreNominaTotalSemana", CommandType.StoredProcedure)
addParameters("@NumeroPeriodo", SqlDbType.Int, numeroPeriodo)
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
addParameters("@CveSubProyecto", SqlDbType.Int, cveSubProyecto)
addParameters("@CveTipoNomina", SqlDbType.Int, cveTipoNomina)
addParameters("@TipoTrabajador", SqlDbType.VarChar, tipoTrabajador)
addParameters("@Ejercicio", SqlDbType.Int, ejercicio)
addParameters("@Facturado", SqlDbType.Bit, facturado)
retorno = RunQuery("Ocurrió un error al obtener el PA_RH_PreNominaTotalSemana.")
Return retorno
End Function
Public Function Embarque_TableroGet(cveEmpresa As Int32, cveSubproyecto As Int32, cveEstatus As Int32, cveCultivoCuadro As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Agro_Embarque_TableroGet", CommandType.StoredProcedure)
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
addParameters("@CveSubproyecto", SqlDbType.Int, cveSubproyecto)
addParameters("@CveEstatus", SqlDbType.Int, cveEstatus)
addParameters("@CveCultivoCuadro", SqlDbType.Int, cveCultivoCuadro)
retorno = RunQuery("Ocurrió un error al obtener el PA_Agro_Embarque_TableroGet.")
Return retorno
End Function
#Region "IDisposable Support" #Region "IDisposable Support"
' IDisposable ' IDisposable

View File

@@ -3899,7 +3899,7 @@ Public Class ClsPaginas
Application("GlobalDTPaqueteriaGuiaTipos") = value Application("GlobalDTPaqueteriaGuiaTipos") = value
End Set End Set
End Property End Property
Property GlobalDTClasificacionPorcentaje(CveEmpresa As Integer, Optional CveClasicacionPorcentaje As Integer = -1, Optional CveClasicacion As Integer = -1, Public Shared Property GlobalDTClasificacionPorcentaje(CveEmpresa As Integer, Optional CveClasicacionPorcentaje As Integer = -1, Optional CveClasicacion As Integer = -1,
Optional PorcentajeIVA As Double = -1) As DataTable Optional PorcentajeIVA As Double = -1) As DataTable
Get Get
@@ -3909,15 +3909,15 @@ Public Class ClsPaginas
If CveClasicacionPorcentaje <> -1 Then Str.AppendFormat(" {0} CveClasicacionPorcentaje = {1}", If(Str.Length > 0, "AND", ""), CveClasicacionPorcentaje) If CveClasicacionPorcentaje <> -1 Then Str.AppendFormat(" {0} CveClasicacionPorcentaje = {1}", If(Str.Length > 0, "AND", ""), CveClasicacionPorcentaje)
If CveClasicacion <> -1 Then Str.AppendFormat(" {0} CveClasicacion = {1}", If(Str.Length > 0, "AND", ""), CveClasicacion) If CveClasicacion <> -1 Then Str.AppendFormat(" {0} CveClasicacion = {1}", If(Str.Length > 0, "AND", ""), CveClasicacion)
If PorcentajeIVA <> -1 Then Str.AppendFormat(" {0} PorcentajeIVA = {1}", If(Str.Length > 0, "AND", ""), PorcentajeIVA) If PorcentajeIVA <> -1 Then Str.AppendFormat(" {0} PorcentajeIVA = {1}", If(Str.Length > 0, "AND", ""), PorcentajeIVA)
Dim Dv As New DataView(DirectCast(Application("GlobalDTClasificacionPorcentaje"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTClasificacionPorcentaje"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTClasificacionPorcentaje = Dv.ToTable GlobalDTClasificacionPorcentaje = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
GlobalDTClasificacionPorcentaje = DirectCast(Application("GlobalDTClasificacionPorcentaje"), DataTable) GlobalDTClasificacionPorcentaje = DirectCast(HttpContext.Current.Application("GlobalDTClasificacionPorcentaje"), DataTable)
End If End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Application("GlobalDTClasificacionPorcentaje") = value HttpContext.Current.Application("GlobalDTClasificacionPorcentaje") = value
End Set End Set
End Property End Property
Property GlobalDTPaqueterias(CveEmpresa As Integer, Optional TipoPaqueteria As Integer = -1) As DataTable Property GlobalDTPaqueterias(CveEmpresa As Integer, Optional TipoPaqueteria As Integer = -1) As DataTable

View File

@@ -11,6 +11,13 @@ Public Class ClsRH
#Region "Campos" #Region "Campos"
'SQL 'SQL
Private noguardoXcurp As Boolean = False
Public ReadOnly Property noguardoXcurpb As Boolean
Get
noguardoXcurpb = noguardoXcurp
End Get
End Property
Private SqlConexion As SqlConnection Private SqlConexion As SqlConnection
Private SqlAdapter As SqlDataAdapter Private SqlAdapter As SqlDataAdapter
Private SqlTransacc As SqlTransaction Private SqlTransacc As SqlTransaction
@@ -1916,7 +1923,6 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
Return Retorno Return Retorno
End Function End Function
Public Function AddPersonal(Codigo As String, APaterno As String, AMaterno As String, Nombres As String, Correo As String, FechaIngreso As Date, CveTipoPeriodo As Integer, NumeroSS As String, SeInscribioSS As Boolean, SalarioDiarioPago As Double, SalarioDiario As Double, SDI As Double, Public Function AddPersonal(Codigo As String, APaterno As String, AMaterno As String, Nombres As String, Correo As String, FechaIngreso As Date, CveTipoPeriodo As Integer, NumeroSS As String, SeInscribioSS As Boolean, SalarioDiarioPago As Double, SalarioDiario As Double, SDI As Double,
SalarioDiarioSS As Double, Bono As Double, NumDiasAguinaldo As Integer, PorPrimaVacacional As Double, CveMetodoPago As Integer, FechaInicioContrato As Date, FechaFinContrato As String, SalarioDiarioSS As Double, Bono As Double, NumDiasAguinaldo As Integer, PorPrimaVacacional As Double, CveMetodoPago As Integer, FechaInicioContrato As Date, FechaFinContrato As String,
CveTipoContrato As Integer, Ubicacion As String, CveTurno As Integer, CvePuesto As Integer, CveDepartamento As Integer, CveRuta As Integer, CveEscolaridad As Integer, CveTipoContrato As Integer, Ubicacion As String, CveTurno As Integer, CvePuesto As Integer, CveDepartamento As Integer, CveRuta As Integer, CveEscolaridad As Integer,
@@ -1928,7 +1934,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
Optional Pensionado As Boolean = False, Optional CveMedioTransporte As Integer = -1, Optional CveRegistroPatronal As Integer = -1, Optional CveEmpresaAsignado As Integer = -1) As Boolean Optional Pensionado As Boolean = False, Optional CveMedioTransporte As Integer = -1, Optional CveRegistroPatronal As Integer = -1, Optional CveEmpresaAsignado As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
Dim noguardoXcurp = False
SqlDataAdapter("PA_RH_PersonalAdd") SqlDataAdapter("PA_RH_PersonalAdd")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -2034,6 +2040,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
Alert("El nuevo personal no se guardo debido a que se presento un problema al calcular el salario", TipoMensaje.MsgAdvertencia) Alert("El nuevo personal no se guardo debido a que se presento un problema al calcular el salario", TipoMensaje.MsgAdvertencia)
GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", "Ocurrió un error al guardar el nuevo personal.", Ex1.ToString, vbCrLf, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())) GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", "Ocurrió un error al guardar el nuevo personal.", Ex1.ToString, vbCrLf, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()))
ElseIf Ex1.Message.Contains("dbo.Vw_Val_Nom_Curps") Then ElseIf Ex1.Message.Contains("dbo.Vw_Val_Nom_Curps") Then
Retorno = True
noguardoXcurp = True
Alert(String.Format("El nuevo personal no se guardo, ya existe un personal con esta curp '{0}'", CURP), TipoMensaje.MsgAdvertencia) Alert(String.Format("El nuevo personal no se guardo, ya existe un personal con esta curp '{0}'", CURP), TipoMensaje.MsgAdvertencia)
GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", "Ocurrió un error al guardar el nuevo personal.", Ex1.ToString, vbCrLf, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())) GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", "Ocurrió un error al guardar el nuevo personal.", Ex1.ToString, vbCrLf, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()))
Else Else

View File

@@ -5397,7 +5397,7 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function GetAutorizacionLimite(CveEmpresa As Integer, CveCliente As Integer, CveVendedor As Integer, TipoDocumento As String, Optional CveEstatus As Integer = -1, Optional FechaI As DateTime = MinFecha, Optional FechaF As DateTime = MaxFecha) As Boolean Public Function GetAutorizacionLimite(CveEmpresa As Integer, CveCliente As Integer, CveVendedor As Integer, TipoDocumento As String, Optional CveEstatus As Integer = -1, Optional FechaI As DateTime = MinFecha, Optional FechaF As DateTime = MaxFecha, Optional CveUsuarioConsulta As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_AutorizacionLimitesGet") DataAdapter("PA_Vta_AutorizacionLimitesGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -5408,6 +5408,7 @@ Public Class ClsVentas
.Add("@TipoDocumento", SqlDbType.VarChar).Value = TipoDocumento .Add("@TipoDocumento", SqlDbType.VarChar).Value = TipoDocumento
.Add("@FechaI", SqlDbType.Date).Value = FechaI .Add("@FechaI", SqlDbType.Date).Value = FechaI
.Add("@FechaF", SqlDbType.Date).Value = FechaF .Add("@FechaF", SqlDbType.Date).Value = FechaF
.Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -2251,13 +2251,13 @@ Namespace Modelos
For Each RowInv As DataRow In DtMovimientosEntrada.Rows For Each RowInv As DataRow In DtMovimientosEntrada.Rows
ValorInventario = DtMovimientosEntrada.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL ValorInventario = DtMovimientosEntrada.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, -ValorInventario, Concepto, tCveConcepto, Concepto, tFecha, -1, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=-ValorInventario, CveSubProyecto:=tCveSubProyecto) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, -ValorInventario, -ValorInventario, tCveConcepto, Concepto, Concepto, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, CveSubProyecto:=tCveSubProyecto) Then
CveMovimiento = -1 CveMovimiento = -1
Exit For Exit For
End If End If
Next Next
If CveMovimiento > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, -DtMovimientosEntrada.SUMD("Total").RoundSQL, Concepto, 68, Concepto, tFecha, -1, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=-DtMovimientosEntrada.SUMD("Total").RoundSQL) Then If CveMovimiento > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, -DtMovimientosEntrada.SUMD("Total").RoundSQL, -DtMovimientosEntrada.SUMD("Total").RoundSQL, 68, Concepto, Concepto, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento) Then
CveMovimiento = -1 CveMovimiento = -1
End If End If
End If End If

View File

@@ -1529,6 +1529,144 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
xfile.SetAttributeValue("EXT", Path.GetExtension(urfile)) xfile.SetAttributeValue("EXT", Path.GetExtension(urfile))
xfile.SetAttributeValue("urlfile", urfile) xfile.SetAttributeValue("urlfile", urfile)
xfolder.Add(xfile) xfolder.Add(xfile)
Dim fecha As String = ""
Dim uuid As String = ""
If Path.GetExtension(urfile).ToUpper() = ".XML" Then
fecha = ""
uuid = ""
Dim settings As System.Xml.XmlReaderSettings = New System.Xml.XmlReaderSettings()
settings.ConformanceLevel = System.Xml.ConformanceLevel.Fragment
settings.IgnoreWhitespace = True
settings.IgnoreComments = True
Using xtr As System.Xml.XmlReader = System.Xml.XmlReader.Create(urfile, settings)
Dim canread As Boolean = True
Dim keyComprobante As String = "cfdi:Comprobante"
Dim keyCfdiRelacionados As String = "cfdi:CfdiRelacionados"
Dim keyEmisor As String = "cfdi:Emisor"
Dim keyReceptor As String = "cfdi:Receptor"
Dim keyConceptos As String = "cfdi:Conceptos"
Dim keyImpuestos As String = "cfdi:Impuestos"
Dim keyComplemento As String = "cfdi:Complemento"
xtr.Read()
While xtr.Read()
If xtr.NodeType = System.Xml.XmlNodeType.Element AndAlso xtr.Name = keyComprobante Then
Dim Nivel As Integer = xtr.Depth
Dim cont As Boolean = xtr.MoveToFirstAttribute()
While cont
Select Case xtr.Name.ToUpper()
Case "XMLNS:CFDI"
'xmlCFDI.comprobante.xmlns_cfdi = xtr.Value
Case "XMLNS:XSI"
'xmlCFDI.comprobante.xmlns_xsi = xtr.Value
'Case "XSI:SCHEMALOCATION"
' xmlCFDI.comprobante.xsi_schemaLocation = xtr.Value
'Case "VERSION"
' xmlCFDI.comprobante.Version = xtr.Value
'Case "SERIE"
' xmlCFDI.comprobante.Serie = xtr.Value
'Case "FOLIO"
' xmlCFDI.comprobante.Folio = xtr.Value
Case "FECHA"
fecha = xtr.Value
'Case "MONEDA"
' xmlCFDI.comprobante.Moneda = xtr.Value
'Case "SUBTOTAL"
' Dim SubTotal As Decimal = 0
' Decimal.TryParse(xtr.Value, SubTotal)
' xmlCFDI.comprobante.SubTotal = SubTotal
'Case "TOTAL"
' Dim Total As Decimal = 0
' Decimal.TryParse(xtr.Value, Total)
' xmlCFDI.comprobante.Total = Total
'Case "DESCUENTO"
' Dim Descuento As Decimal = 0
' Decimal.TryParse(xtr.Value, Descuento)
' xmlCFDI.comprobante.Descuento = Descuento
'Case "TIPOCAMBIO"
' Dim TipoCambio As Decimal = 0
' Decimal.TryParse(xtr.Value, TipoCambio)
' xmlCFDI.comprobante.TipoCambio = TipoCambio
'Case "TIPODECOMPROBANTE"
' xmlCFDI.comprobante.TipoDeComprobante = xtr.Value
'Case "FORMAPAGO"
' xmlCFDI.comprobante.FormaPago = xtr.Value
'Case "FORMADEPAGO"
' xmlCFDI.comprobante.FormaPago = xtr.Value
'Case "METODOPAGO"
' xmlCFDI.comprobante.MetodoPago = xtr.Value
'Case "METODODEPAGO"
' xmlCFDI.comprobante.MetodoPago = xtr.Value
'Case "CONDICIONESDEPAGO"
' xmlCFDI.comprobante.CondicionesDePago = xtr.Value
'Case "LUGAREXPEDICION"
' xmlCFDI.comprobante.LugarExpedicion = xtr.Value
'Case "CONFIRMACION"
' xmlCFDI.comprobante.Confirmacion = xtr.Value
'Case "NOCERTIFICADO"
' xmlCFDI.comprobante.NoCertificado = xtr.Value
'Case "SELLO"
' xmlCFDI.comprobante.Sello = xtr.Value
'Case "CERTIFICADO"
' xmlCFDI.comprobante.Certificado = xtr.Value
End Select
cont = xtr.MoveToNextAttribute()
End While
cont = xtr.MoveToFirstAttribute()
While xtr.Read() AndAlso xtr.NodeType <> System.Xml.XmlNodeType.Element
End While
End If
If xtr.NodeType = System.Xml.XmlNodeType.Element AndAlso xtr.Name = keyComplemento Then
Dim cDepth As Integer = xtr.Depth
While xtr.Read() AndAlso xtr.NodeType <> System.Xml.XmlNodeType.Element
End While
While xtr.Read() AndAlso xtr.Depth > cDepth
If xtr.NodeType = System.Xml.XmlNodeType.Element AndAlso xtr.LocalName = "TimbreFiscalDigital" Then
'xmlCFDI.complemento.xmlns_tfd = xtr.GetAttribute("xmlns:tfd")
'xmlCFDI.complemento.xsi_schemaLocation = xtr.GetAttribute("xsi:schemaLocation")
'xmlCFDI.complemento.Version = xtr.GetAttribute("Version")
uuid = xtr.GetAttribute("UUID")
'xmlCFDI.complemento.FechaTimbrado = xtr.GetAttribute("FechaTimbrado")
'xmlCFDI.complemento.RfcProvCertif = xtr.GetAttribute("RfcProvCertif")
'xmlCFDI.complemento.SelloCFD = If((xmlCFDI.comprobante.Version = "3.3" OrElse xmlCFDI.comprobante.Version = "4.0"), xtr.GetAttribute("SelloCFD"), xtr.GetAttribute("selloCFD"))
'xmlCFDI.complemento.NoCertificadoSAT = If(xmlCFDI.comprobante.Version = "3.3", xtr.GetAttribute("NoCertificadoSAT"), xtr.GetAttribute("noCertificadoSAT"))
'xmlCFDI.complemento.SelloSAT = If((xmlCFDI.comprobante.Version = "3.3" OrElse xmlCFDI.comprobante.Version = "4.0"), xtr.GetAttribute("SelloSAT"), xtr.GetAttribute("selloSAT"))
End If
End While
End If
End While
xtr.Close()
xtr.
End Using
If (System.IO.File.Exists(urfile)) Then
Dim fechita As DateTime = fecha.ToDateTime()
Dim direct As String = $"C:\Users\caudi\Desktop\Nueva carpeta\APH20210302\{fechita:yyyyMMdd}\"
If Not System.IO.Directory.Exists(direct) Then
System.IO.Directory.CreateDirectory(direct)
End If
Dim fileurl As String = $"{direct}{Path.GetFileName(urfile)}"
If uuid.Length Then
fileurl = $"{direct}{uuid}{Path.GetExtension(urfile)}"
End If
System.IO.File.Move(urfile, fileurl)
Dim x = ""
End If
End If
Next Next
xmlarchivos.Add(xfolder) xmlarchivos.Add(xfolder)

View File

@@ -183,7 +183,7 @@ Partial Class Bancos_CreditosPagoMultiple
Protected Sub BtnIEGuardar_Click(sender As Object, e As EventArgs) Handles BtnIEGuardar.Click Protected Sub BtnIEGuardar_Click(sender As Object, e As EventArgs) Handles BtnIEGuardar.Click
Dim Total As Double = 0 Dim Total As Decimal = 0
For Each gvr As GridViewRow In GvV.Rows For Each gvr As GridViewRow In GvV.Rows
If gvr.FCCheckBox("Chk").Checked Then If gvr.FCCheckBox("Chk").Checked Then
Total += gvr.DataKey("Total").ToDouble Total += gvr.DataKey("Total").ToDouble
@@ -205,7 +205,7 @@ Partial Class Bancos_CreditosPagoMultiple
Dim CveConceptoContable As Integer = 30 Dim CveConceptoContable As Integer = 30
Dim CveConceptoCompra As Integer = 48 Dim CveConceptoCompra As Integer = 48
' Dim CveCreditoDetalle As Integer = -1 ' Dim CveCreditoDetalle As Integer = -1
Dim CIF As Double = 0 Dim CIF As Decimal = 0
Dim CvePlantillaPoliza As Integer = 5 Dim CvePlantillaPoliza As Integer = 5
Dim TC As Double = 1.0 Dim TC As Double = 1.0
Dim Estatus As Integer = 2 Dim Estatus As Integer = 2
@@ -260,8 +260,8 @@ Partial Class Bancos_CreditosPagoMultiple
ObjIE.UpdateCreditosDetalle(Estatus, CveCreditoDetalle) ObjIE.UpdateCreditosDetalle(Estatus, CveCreditoDetalle)
Dim IVA As Double = 0 ' TxtImporte.Text.ToDouble * HdnProvPorIVA.Value.ToDouble Dim IVA As Decimal = 0 ' TxtImporte.Text.ToDouble * HdnProvPorIVA.Value.ToDouble
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, gvr.DataKey("Total").ToDouble - IVA - CIF, TxtObservaciones.Text, CveConceptoCompra, TxtObservaciones.Text, Now, 0, -1, CveIE, CveProveedor:=CveProveedor, CveCreditoDetalle:=CveCreditoDetalle) Then If ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, gvr.DataKey("Total").ToDecimal - IVA - CIF, TxtObservaciones.Text, CveConceptoCompra, TxtObservaciones.Text, Now, 0, -1, CveIE, CveProveedor:=CveProveedor, CveCreditoDetalle:=CveCreditoDetalle) Then
If IVA > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, IVA, TxtObservaciones.Text, 19, TxtObservaciones.Text, Now, 0, -1, CveIE, CveProveedor:=CveProveedor, CveCreditoDetalle:=CveCreditoDetalle) Then If IVA > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, IVA, TxtObservaciones.Text, 19, TxtObservaciones.Text, Now, 0, -1, CveIE, CveProveedor:=CveProveedor, CveCreditoDetalle:=CveCreditoDetalle) Then
MsgError = "Detalle" MsgError = "Detalle"
End If End If

View File

@@ -354,7 +354,7 @@ Partial Class Bancos_OtrosIE
If CvePrePoliza > 0 Then If CvePrePoliza > 0 Then
Dim Importe As Double = 0 Dim Importe As Decimal = 0
Dim TipoMovto As Boolean = False Dim TipoMovto As Boolean = False
'INSERTO LAS COMPRAS QUE VOY A PAGAR 'INSERTO LAS COMPRAS QUE VOY A PAGAR

View File

@@ -198,27 +198,110 @@ Partial Class PopUpVerFactura
End If End If
If Request("onlyPrint") IsNot Nothing Then If Request("onlyPrint") IsNot Nothing Then
If Request("onlyPrint").ToString() = "Pallet" Then If Request("onlyPrint").ToString() = "Pallet" AndAlso Not IsNothing(Request("CvePallet")) Then
imprimirpallet2(Request("CvePallet").ToString.ToEntero()) imprimirpallet2(Request("CvePallet").ToString.ToEntero())
End If End If
If Request("onlyPrint").ToString() = "PalletCaja" Then If Request("onlyPrint").ToString() = "PalletCaja" AndAlso Not IsNothing(Request("CvePallet")) Then
imprimirpallet(Request("CvePallet").ToString.ToEntero()) imprimirpallet(Request("CvePallet").ToString.ToEntero())
End If End If
If Request("onlyPrint").ToString() = "manifiesto" Then If Request("onlyPrint").ToString() = "manifiesto" AndAlso Not IsNothing(Request("cveEmbarqueManifiesto")) Then
imprimirManifiesto(Request("cveEmbarqueManifiesto").ToString.ToEntero()) imprimirManifiesto(Request("cveEmbarqueManifiesto").ToString.ToEntero())
End If End If
If Request("onlyPrint").ToString() = "manifiestoRemision" Then If Request("onlyPrint").ToString() = "manifiestoRemision" AndAlso Not IsNothing(Request("cveEmbarqueManifiesto")) Then
imprimirManifiestoRemision(Request("cveEmbarqueManifiesto").ToString.ToEntero()) imprimirManifiestoRemision(Request("cveEmbarqueManifiesto").ToString.ToEntero())
End If End If
If Request("onlyPrint").ToString() = "manifiestoCartaPorte" Then If Request("onlyPrint").ToString() = "manifiestoCartaPorte" AndAlso Not IsNothing(Request("cveEmbarqueManifiesto")) Then
imprimirManifiestoCartaPorte(Request("cveEmbarqueManifiesto").ToString.ToEntero()) imprimirManifiestoCartaPorte(Request("cveEmbarqueManifiesto").ToString.ToEntero())
End If End If
If Request("onlyPrint").ToString() = "rfctxtvalidar" Then
rfctxtvalidar()
End If
If Request("onlyPrint").ToString() = "Recibo" Then
ReciboAgropecuaria()
End If
End If End If
End If End If
End Sub End Sub
Private Sub ReciboAgropecuaria()
Dim numeroPeriodo As Integer = 0
Dim cveSubProyecto As Integer = -1
Dim cveTipoNomina As Integer = -1
Dim ejercicio As Integer = 0
Dim cvePersonal As Integer = 0
Dim tipoTrabajador As String = ""
Dim facturado As Boolean = False
If Not IsNothing(Request("numeroPeriodo")) Then
numeroPeriodo = Request("numeroPeriodo").ToString.ToEntero()
End If
If Not IsNothing(Request("ejercicio")) Then
ejercicio = Request("ejercicio").ToString.ToEntero()
End If
If Not IsNothing(Request("cvePersonal")) Then
cvePersonal = Request("cvePersonal").ToString.ToEntero()
End If
Dim params As New List(Of ReportParameter)
Dim lrds As New List(Of ReportDataSource)
Using objnom As New ClsNominas
If objnom.PreNominaTotalSemana(numeroPeriodo, UsuarioActual.CveEmpresa, cveSubProyecto, cveTipoNomina, tipoTrabajador, ejercicio, facturado) Then
Dim dt As New DataTable
dt = objnom.DtResultados.FiltraParametros("CvePersonal >0")
If (cvePersonal > 0) Then
dt = dt.FiltraParametros($"CvePersonal ={cvePersonal }")
End If
lrds.Add(New ReportDataSource With {.Name = "DataSet1", .Value = dt})
End If
End Using
'endimg
'"Empresas/Grales/Formatos/EquiposGPS.rdlc"
'"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc"
ImprimirPDF("GPS/ReciboNom.rdlc", lrds, params, "Pallet", Content_Disposition:="Inline")
End Sub
Private Sub rfctxtvalidar()
Dim numeroPeriodo As Integer = 0
Dim cveSubProyecto As Integer = -1
Dim cveTipoNomina As Integer = -1
Dim ejercicio As Integer = 0
Dim cvePersonal As Integer = 0
Dim tipoTrabajador As String = ""
Dim facturado As Boolean = False
If Not IsNothing(Request("numeroPeriodo")) Then
numeroPeriodo = Request("numeroPeriodo").ToString.ToEntero()
End If
If Not IsNothing(Request("ejercicio")) Then
ejercicio = Request("ejercicio").ToString.ToEntero()
End If
If Not IsNothing(Request("cvePersonal")) Then
cvePersonal = Request("cvePersonal").ToString.ToEntero()
End If
Dim RFCs As New StringBuilder
Dim contador = 0
Using objnom As New ClsNominas
If objnom.PreNominaTotalSemana(numeroPeriodo, UsuarioActual.CveEmpresa, cveSubProyecto, cveTipoNomina, tipoTrabajador, ejercicio, facturado) Then
For Each item As DataRow In objnom.DtResultados.Select("CvePersonal > 0")
Dim rfc As String = item("RFC").ToString().Trim()
If rfc.Length > 0 Then
contador = contador + 1
RFCs.AppendLine(String.Format("{0}|{1}", contador, rfc))
End If
Next
End If
End Using
Response.Clear()
Response.ContentType = "text/plain"
Response.AppendHeader("content-disposition", "attachment;filename=RFCs_Validacion_Masiva.txt")
'Response.Write(contador.ToString())
Response.Write(RFCs.ToString())
Response.End()
End Sub
Private Sub imprimirManifiesto(cveEmbarqueManifiesto As Integer) Private Sub imprimirManifiesto(cveEmbarqueManifiesto As Integer)
Dim NoEmbarque As String = "" Dim NoEmbarque As String = ""
@@ -506,7 +589,6 @@ Partial Class PopUpVerFactura
ImprimirPDF("GPS/EmbarqueManifiestoRemision.rdlc", lrds, params, "Remisión", Content_Disposition:="Inline") ImprimirPDF("GPS/EmbarqueManifiestoRemision.rdlc", lrds, params, "Remisión", Content_Disposition:="Inline")
End Sub End Sub
Private Sub imprimirManifiestoCartaPorte(cveEmbarqueManifiesto As Integer) Private Sub imprimirManifiestoCartaPorte(cveEmbarqueManifiesto As Integer)
Dim NoEmbarque As String = "" Dim NoEmbarque As String = ""
Dim Fecha As String = "" Dim Fecha As String = ""
@@ -675,7 +757,6 @@ Partial Class PopUpVerFactura
End Sub End Sub
Private Sub imprimirpallet2(cvePallet As Integer) Private Sub imprimirpallet2(cvePallet As Integer)
Dim Envase As String = "" Dim Envase As String = ""
Dim Tamano As String = "" Dim Tamano As String = ""

6663
GPS/ReciboNom.rdlc Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -247,6 +247,7 @@
<asp:BoundField DataField="IMEI" ItemStyle-Width="12.5%" HeaderText="IMEI" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField DataField="IMEI" ItemStyle-Width="12.5%" HeaderText="IMEI" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="FechaIng" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="12.5%" HeaderText="Fecha Ingreso" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField DataField="FechaIng" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="12.5%" HeaderText="Fecha Ingreso" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="FechaAlta" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="12.5%" HeaderText="Fecha Alta" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField DataField="FechaAlta" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="12.5%" HeaderText="Fecha Alta" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="FechaBaja" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="15%" HeaderText="Fecha Baja" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-Width="12.5%" HeaderText="Estatus" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField ItemStyle-Width="12.5%" HeaderText="Estatus" ItemStyle-HorizontalAlign="Center">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="LblEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Label> <asp:Label ID="LblEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Label>

View File

@@ -81,6 +81,7 @@
<asp:BoundField DataField="IMEI" ItemStyle-Width="10%" HeaderText="IMEI" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="IMEI" ItemStyle-Width="10%" HeaderText="IMEI" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="NumeroTelefono" ItemStyle-Width="20%" HeaderText="Número Teléfono" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField DataField="NumeroTelefono" ItemStyle-Width="20%" HeaderText="Número Teléfono" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Ultimaconexion" ItemStyle-Width="15%" HeaderText="Ultima conexión" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="Ultimaconexion" ItemStyle-Width="15%" HeaderText="Ultima conexión" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="FechaBaja" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="15%" HeaderText="Fecha Baja" ItemStyle-HorizontalAlign="Left" />
</Columns> </Columns>
</asp:GridView> </asp:GridView>

View File

@@ -2372,6 +2372,10 @@ Partial Class General_SaldosIniciales
Dim CvePersonal As Integer = GlobalDTRHPersonal(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePersonal", $"NombreCompletoNombre = '{NombreCompleto}'").ToString.ToEntero() Dim CvePersonal As Integer = GlobalDTRHPersonal(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePersonal", $"NombreCompletoNombre = '{NombreCompleto}'").ToString.ToEntero()
If Not (CvePersonal > 0) Then
CvePersonal = GlobalDTRHPersonal(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePersonal", $"CURP = '{CURP}'").ToString.ToEntero()
End If
'PENDIENTES POR MEJORAR 'PENDIENTES POR MEJORAR
Dim CveSATRegimenContratacion As Integer = 1 Dim CveSATRegimenContratacion As Integer = 1
@@ -2430,8 +2434,11 @@ Partial Class General_SaldosIniciales
-1, -1, -1, CveMetodoPago, FechaIn, FechaFn.ToString, CveTipoContrato, Direccion, CveTurno, CvePuesto, CveDepartamento, -1, CveEscolaridad, CveEstadoCivil, CveGenero, -1, FechaBaja, CveEstatusPersonal, FechaNac, -1, -1, -1, CveMetodoPago, FechaIn, FechaFn.ToString, CveTipoContrato, Direccion, CveTurno, CvePuesto, CveDepartamento, -1, CveEscolaridad, CveEstadoCivil, CveGenero, -1, FechaBaja, CveEstatusPersonal, FechaNac,
LugarNacimiento, Direccion, "", "", "", CodigoPostal, Ciudad, CveEstado, Telefono, Celular, RFC, CURP, NombrePadre, NombreMadre, -1, CveSATRiesgoPuesto, CveSATRegimenContratacion, -1, CveSubProyecto, "", -1, LugarNacimiento, Direccion, "", "", "", CodigoPostal, Ciudad, CveEstado, Telefono, Celular, RFC, CURP, NombrePadre, NombreMadre, -1, CveSATRiesgoPuesto, CveSATRegimenContratacion, -1, CveSubProyecto, "", -1,
ClabeInterbancaria, "", CveJornada, CveJornada, "", -1, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveUsuarioNomina, CveRegistroPatronal:=CveRegistroPatronal) Then ClabeInterbancaria, "", CveJornada, CveJornada, "", -1, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveUsuarioNomina, CveRegistroPatronal:=CveRegistroPatronal) Then
If (ObjRH.noguardoXcurpb) Then
Else
ErrorRH = True ErrorRH = True
Exit For Exit For
End If
Else Else
ContadorAgregados = ContadorAgregados + 1 ContadorAgregados = ContadorAgregados + 1
End If End If

View File

@@ -5,8 +5,6 @@ Imports System.Data
Imports System.IO Imports System.IO
Imports Extensiones Imports Extensiones
'Imports DocumentFormat.OpenXml.Wordprocessing
Partial Class Inventarios_EntradasSalidas Partial Class Inventarios_EntradasSalidas
Inherits ClsPaginas Inherits ClsPaginas
@@ -345,9 +343,6 @@ Partial Class Inventarios_EntradasSalidas
End Select End Select
If Request("CveMovimiento") IsNot Nothing AndAlso Request("CveMovimiento").ToString.ToEntero > 0 Then If Request("CveMovimiento") IsNot Nothing AndAlso Request("CveMovimiento").ToString.ToEntero > 0 Then
If UsuarioActual.CveRol = 1 AndAlso UsuarioActual.CveEmpresa = 140 Then
LnkGenerarVirtual.Visible = True
End If
CargaDatos(Request("CveMovimiento").ToString.ToEntero) CargaDatos(Request("CveMovimiento").ToString.ToEntero)
'CargaGvPaqueteria() 'CargaGvPaqueteria()
@@ -708,6 +703,10 @@ Partial Class Inventarios_EntradasSalidas
End If End If
End If End If
If UsuarioActual.CveRol = 1 AndAlso UsuarioActual.CveEmpresa = 140 AndAlso Mov.CveMovimientoVirtual <= 0 Then
LnkGenerarVirtual.Visible = True
End If
'DATOS DE CONSIGNACION 'DATOS DE CONSIGNACION
If DtMov.Rows(0)("SerieFolio").ToString.Length > 0 Then If DtMov.Rows(0)("SerieFolio").ToString.Length > 0 Then
RowConsignacion.Visible = True RowConsignacion.Visible = True
@@ -3773,6 +3772,12 @@ Partial Class Inventarios_EntradasSalidas
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 205, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveCompra:=CveCompra, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 205, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveCompra:=CveCompra, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then
ErrorMovInv = True ErrorMovInv = True
End If End If
Else
If ObjInventario.Modulo.Contiene("M/CU") Then
Contabilizable = True
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 278, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveCompra:=CveCompra, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then
ErrorMovInv = True
End If
Else Else
If ObjInventario.Modulo.Contiene("TA/G1", "Recons") Then If ObjInventario.Modulo.Contiene("TA/G1", "Recons") Then
Contabilizable = False Contabilizable = False
@@ -3830,6 +3835,7 @@ Partial Class Inventarios_EntradasSalidas
End If End If
End If End If
End If End If
End If
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen={DdlAlmacen.SelectedValue.ToEntero}").ToEntero IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen={DdlAlmacen.SelectedValue.ToEntero}").ToEntero
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then
@@ -4548,11 +4554,11 @@ Partial Class Inventarios_EntradasSalidas
'MOVIMIENTOS 'MOVIMIENTOS
If DtMovimientosCambioVigencias.Rows.Count > 0 Then If DtMovimientosCambioVigencias.Rows.Count > 0 Then
FolioSalida = ObjInventario.GetFolioSiguiente(8, UsuarioActual.CveEmpresa) FolioSalida = ObjInventario.GetFolioSiguiente(47, UsuarioActual.CveEmpresa)
CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacen, 8, 1, Fecha, FolioSalida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObsCambioVigencia.Text.Trim, Modulo:="ES/CV1") CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacen, 47, 1, Fecha, FolioSalida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObsCambioVigencia.Text.Trim, Modulo:="ES/CV1")
FolioEntrada = ObjInventario.GetFolioSiguiente(9, UsuarioActual.CveEmpresa) FolioEntrada = ObjInventario.GetFolioSiguiente(48, UsuarioActual.CveEmpresa)
CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacen, 9, 1, Fecha, FolioEntrada, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObsCambioVigencia.Text.Trim, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="ES/CV2") CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacen, 48, 1, Fecha, FolioEntrada, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObsCambioVigencia.Text.Trim, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="ES/CV2")
End If End If
@@ -5298,7 +5304,7 @@ Partial Class Inventarios_EntradasSalidas
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 Then If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 Then
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, If(tOrigen > 0, 36, 37), 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveMovimientoRelacionado:=CveMovimiento, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="ES/GV") CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, If(tOrigen > 0, 36, 37), 1, TxtFecha.text.todate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveMovimientoRelacionado:=CveMovimiento, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="ES/GV")
FolioVirtual = ObjInventario.Folio FolioVirtual = ObjInventario.Folio
For Each RowUsado As DataRow In DtPSVirtual.Rows For Each RowUsado As DataRow In DtPSVirtual.Rows

View File

@@ -12,6 +12,7 @@
.table-hover > tbody > tr:hover { .table-hover > tbody > tr:hover {
background-color: #e5e5e5; background-color: #e5e5e5;
} }
.table-striped > tbody > tr:nth-of-type(odd).ADSRow, .table-striped > tbody > tr:nth-of-type(odd).ADSRow,
table > tbody > tr.ADSRow > td, table.table > tbody > tr.ADSRow > td, table > tbody > tr.ADSRow > td, table.table > tbody > tr.ADSRow > td,
table > tr.ADSRow > td, table.table > tr.ADSRow > td, table > tr.ADSRow > td, table.table > tr.ADSRow > td,
@@ -2997,3 +2998,7 @@ div.mypaste * {
.btn-circle.btn-sm btn-xs { .btn-circle.btn-sm btn-xs {
line-height: 1; line-height: 1;
} }
table > tbody > tr.hidetrad {
display: none;
}

View File

@@ -216,8 +216,12 @@ public partial class Nomina_Nomina2 : ClsPaginas
using (ClsNominas objnom = new ClsNominas()) using (ClsNominas objnom = new ClsNominas())
{ {
objnom.GetNominasSinTimbrar(-1, UsuarioActual.CveEmpresa); objnom.GetNominasSinTimbrar(-1, UsuarioActual.CveEmpresa);
if (objnom.DTSetResultados.Tables.Count > 0)
{
GVNominaPendiente.DataSource = objnom.DTSetResultados.Tables[0]; GVNominaPendiente.DataSource = objnom.DTSetResultados.Tables[0];
GVNominaPendiente.DataBind(); GVNominaPendiente.DataBind();
}
if (GVNominaPendiente.Rows.Count > 0) if (GVNominaPendiente.Rows.Count > 0)
{ {
RegistraScript("$('#ModalNominaPendiente').modal();"); RegistraScript("$('#ModalNominaPendiente').modal();");
@@ -2203,7 +2207,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
DataRow drow = dtempleados.FiltroPrimero(string.Format("CvePersonal = {0}", SRCvePersonal)); DataRow drow = dtempleados.FiltroPrimero(string.Format("CvePersonal = {0}", SRCvePersonal));
TxtCCSysSalarioMinimo.Text = ""; TxtCCSysSalarioMinimo.Text = "";
TxtCCSysUMA.Text = "$89.62"; TxtCCSysUMA.Text = "$96.22";
if (drow != null) if (drow != null)
{ {
TxtCCSysSalarioMinimo.Text = string.Format("${0:N2}", drow["SalarioMinimo"]); TxtCCSysSalarioMinimo.Text = string.Format("${0:N2}", drow["SalarioMinimo"]);
@@ -2245,7 +2249,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
if (drow != null) if (drow != null)
{ {
int Fechafin = string.Format("{0:yyyyMMdd}", drow["FechaFin"]).ToEntero(); int Fechafin = string.Format("{0:yyyyMMdd}", drow["FechaFin"]).ToEntero();
decimal UMA = 89.62M; decimal UMA = 96.22M;
decimal SalarioDiarioIMSS = drow["SalarioDiarioIMSS"].ToString().ToDecimal(); decimal SalarioDiarioIMSS = drow["SalarioDiarioIMSS"].ToString().ToDecimal();
decimal DiasIMSS = drow["DiasIMSS"].ToString().ToDecimal(); decimal DiasIMSS = drow["DiasIMSS"].ToString().ToDecimal();
decimal importeparacuota = SalarioDiarioIMSS > (3 * UMA) ? SalarioDiarioIMSS - (3 * UMA) : 0M; decimal importeparacuota = SalarioDiarioIMSS > (3 * UMA) ? SalarioDiarioIMSS - (3 * UMA) : 0M;
@@ -2298,13 +2302,13 @@ public partial class Nomina_Nomina2 : ClsPaginas
DataRow drow = dtempleados.FiltroPrimero(string.Format("CvePersonal = {0}", SRCvePersonal)); DataRow drow = dtempleados.FiltroPrimero(string.Format("CvePersonal = {0}", SRCvePersonal));
if (drow != null) if (drow != null)
{ {
decimal UMA = 89.62M; decimal UMA = 96.22M;
decimal HorasDobles = drow["HorasDobles"].ToString().ToDecimal(); decimal HorasDobles = drow["HorasDobles"].ToString().ToDecimal();
decimal HorasTriples = drow["HorasTriples"].ToString().ToDecimal(); decimal HorasTriples = drow["HorasTriples"].ToString().ToDecimal();
decimal ImporteHora = drow["SalarioDiario"].ToString().ToDecimal() / 8; decimal ImporteHora = drow["SalarioDiario"].ToString().ToDecimal() / 8;
decimal Semanaslaboradas = Decimal.Truncate((drow["DiasLaborados"].ToString().ToDecimal() / 7)); decimal Semanaslaboradas = Decimal.Truncate((drow["DiasLaborados"].ToString().ToDecimal() / 7M));
bool seExentandobles = !(drow["SalarioDiario"].ToString().ToDecimal() > drow["SalarioMinimo"].ToString().ToDecimal()); bool seExentandobles = !(drow["SalarioDiario"].ToString().ToDecimal() > drow["SalarioMinimo"].ToString().ToDecimal());
decimal TopeHorasDobles = Semanaslaboradas * 9; decimal TopeHorasDobles = Semanaslaboradas * 9M;
decimal HorasExcentas = HorasDobles > TopeHorasDobles ? TopeHorasDobles : HorasDobles; decimal HorasExcentas = HorasDobles > TopeHorasDobles ? TopeHorasDobles : HorasDobles;
decimal ImporteHorasExtrasAntes = HorasExcentas * ImporteHora * (seExentandobles ? 2 : 1); decimal ImporteHorasExtrasAntes = HorasExcentas * ImporteHora * (seExentandobles ? 2 : 1);
decimal TopeImporte = Semanaslaboradas * 5 * UMA; decimal TopeImporte = Semanaslaboradas * 5 * UMA;

View File

@@ -336,12 +336,12 @@
<div class="portlet light smmallpadding bordered"> <div class="portlet light smmallpadding bordered">
<div class="portlet-title"> <div class="portlet-title">
<div class="caption"> <div class="caption">
<i class="icon-user"></i><span class="caption-subject bold uppercase" style="font-size: 18px;">Personal</span> <i class="icon-user"></i><span class="caption-subject bold uppercase" style="font-size: 18px;">Personal (<span id="contaper" ></span>)</span>
</div> </div>
<div class="tools"> <div class="tools">
<div style="display: inline-block"> <div style="display: inline-block">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px; height: 25px; border-color: #89C4F4;" /> <input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTablaClass('TxtBusqueda','{0}','contaper')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px; height: 25px; border-color: #89C4F4;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <a href="javascript:;" onclick="<%= String.Format("FiltrarTablaClass('TxtBusqueda','{0}','contaper')", GvDatos.ClientID) %>" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div> </div>
<a href="javascript:;" class="collapse" data-original-title="" title=""></a> <a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div> </div>
@@ -1293,6 +1293,11 @@
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script> <script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
Sys.Application.add_load(function (s, e) {
<%= String.Format("FiltrarTablaClass('TxtBusqueda','{0}','contaper');", GvDatos.ClientID) %>
});
function OrdenarGV() { function OrdenarGV() {
} }
@@ -2168,8 +2173,6 @@
return homonimio; return homonimio;
} }
function fnCalculaCURP(pstNombre, pstPaterno, pstMaterno, dfecha, pstSexo, pnuCveEntidad) { function fnCalculaCURP(pstNombre, pstPaterno, pstMaterno, dfecha, pstSexo, pnuCveEntidad) {
pstCURP = ""; pstCURP = "";

View File

@@ -1560,7 +1560,7 @@ Partial Class RH_Personal
CHKRFCValidado.Checked = drow("RFCValidado").ToString() = "1" CHKRFCValidado.Checked = drow("RFCValidado").ToString() = "1"
'ChkPensionado.Checked = drow("Pensionado").ToString().ToUpper().Contiene("1", "TRUE") 'ChkPensionado.Checked = drow("Pensionado").ToString().ToUpper().Contiene("1", "TRUE")
ChkSindicalizado.Checked = drow("Sindicalizado").ToString().ToUpper().Contiene("1", "TRUE") ChkSindicalizado.Checked = drow("Sindicalizado").ToString().ToUpper().Contiene("1", "TRUE")
TxtMailrecibonomina.Text = drow("MaiReciboNomina").ToString() 'TxtMailrecibonomina.Text = drow("MaiReciboNomina").ToString()
'Carga Datos Personales 'Carga Datos Personales
LtlPersonal.Text = ObjPersonal.NombreCompleto LtlPersonal.Text = ObjPersonal.NombreCompleto
NombreCompleto = ObjPersonal.NombreCompleto NombreCompleto = ObjPersonal.NombreCompleto

View File

@@ -70,15 +70,31 @@ function log(mensaje) {
console.log(mensaje); console.log(mensaje);
} }
function FiltrarTabla(idtxt, idtable, idcontador) { function FiltrarTabla(idtxt, idtable, idcontador) {
if ($('#' + idtxt).val() == '') { $('table#' + idtable + ' tr').css('display', 'table-row'); } if ($('#' + idtxt).val() == '') { $('table#' + idtable + ' tr').css('display', ''); }
else { else {
$('table#' + idtable + ' tr:not(.ADtr)').css('display', 'none'); $('table#' + idtable + ' tr:contains("' + $('#' + idtxt).val() + '")').css('display', 'table-row'); $('table#' + idtable + ' tr:not(.ADtr)').css('display', 'none'); $('table#' + idtable + ' tr:contains("' + $('#' + idtxt).val() + '")').css('display', '');
$('div.ADScroller .ADScroller-header table#' + idtable + ' tr:not(.ADtr)').css('display', ''); $('div.ADScroller .ADScroller-header table#' + idtable + ' tr:not(.ADtr)').css('display', '');
} }
if ($('#' + idcontador).length > 0) { if ($('#' + idcontador).length > 0) {
$('#' + idcontador).html($('#' + idtable + ' tr:visible').length); $('#' + idcontador).html($('#' + idtable + ' tr:visible').length);
} }
} }
function FiltrarTablaClass(idtxt, idtable, idcontador, resta) {
if (resta == null) {
resta =1
}
if ($('#' + idtxt).val() == '') { $('table#' + idtable + ' tr').removeClass('hidetrad') }
else {
$('table#' + idtable + ' tr:not(.ADtr)').addClass('hidetrad'); $('table#' + idtable + ' tr:contains("' + $('#' + idtxt).val() + '")').removeClass('hidetrad');
$('div.ADScroller .ADScroller-header table#' + idtable + ' tr:not(.ADtr)').removeClass('hidetrad');
}
if ($('#' + idcontador).length > 0) {
let numconta = $('#' + idtable + ' tr:not(.hidetrad):not(.ADtr)').length;
if (numconta > 0) { numconta - resta}
$('#' + idcontador).html(numconta );
}
}
function FiltrarTablaV2(idtxt, idtable, idcontador) { function FiltrarTablaV2(idtxt, idtable, idcontador) {
if ($(idtxt).val() == '') { $(idtable + ' tr').css('display', ''); } if ($(idtxt).val() == '') { $(idtable + ' tr').css('display', ''); }

View File

@@ -77,7 +77,7 @@ Partial Class Ventas_CatAutorizacionLimites
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim.ToDate, MaxFecha) FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim.ToDate, MaxFecha)
Dim ObjGral As New ClsVentas Dim ObjGral As New ClsVentas
If ObjGral.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedorFiltro.SelectedValue.ToEntero(), "-1", CveEstatus:=DdlEstatus.SelectedValue.ToEntero(), FechaI:=FechaI, FechaF:=FechaF) Then If ObjGral.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedorFiltro.SelectedValue.ToEntero(), "-1", CveEstatus:=DdlEstatus.SelectedValue.ToEntero(), FechaI:=FechaI, FechaF:=FechaF, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
GvDatos.DataSource = ObjGral.DtResultados GvDatos.DataSource = ObjGral.DtResultados
End If End If
ObjGral.Dispose() ObjGral.Dispose()

View File

@@ -4502,7 +4502,7 @@
<asp:TemplateField HeaderText="Cargo" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="Cargo" ItemStyle-HorizontalAlign="Center">
<ItemTemplate> <ItemTemplate>
<asp:CheckBox ID="ChkCargo" runat="server"></asp:CheckBox> <asp:CheckBox ID="ChkCargo" runat="server" Visible="false" Checked="false"></asp:CheckBox>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Bonificación" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="Bonificación" ItemStyle-HorizontalAlign="Center">

View File

@@ -9219,13 +9219,13 @@ Partial Class Clientes
Dim FacturadoCargo As Boolean = Boolean.Parse(e.Row.DataKey("FacturadoCargo")) Dim FacturadoCargo As Boolean = Boolean.Parse(e.Row.DataKey("FacturadoCargo"))
Dim FacturadoBonificacion As Boolean = Boolean.Parse(e.Row.DataKey("FacturadoBonificacion")) Dim FacturadoBonificacion As Boolean = Boolean.Parse(e.Row.DataKey("FacturadoBonificacion"))
If FacturadoCargo Then 'If FacturadoCargo Then
e.Row.FCCheckBox("ChkCargo").Checked = False ' e.Row.FCCheckBox("ChkCargo").Checked = False
e.Row.FCCheckBox("ChkCargo").Visible = False ' e.Row.FCCheckBox("ChkCargo").Visible = False
Else 'Else
e.Row.FCCheckBox("ChkCargo").Checked = False ' e.Row.FCCheckBox("ChkCargo").Checked = False
e.Row.FCCheckBox("ChkCargo").Visible = False 'True ' e.Row.FCCheckBox("ChkCargo").Visible = False 'True
End If 'End If
If FacturadoBonificacion Then If FacturadoBonificacion Then
e.Row.FCCheckBox("ChkBonificacion").Checked = False e.Row.FCCheckBox("ChkBonificacion").Checked = False
@@ -9240,6 +9240,10 @@ Partial Class Clientes
ElseIf e.Row.DBCampo("EsUsadoAjuste") = "1" Then ElseIf e.Row.DBCampo("EsUsadoAjuste") = "1" Then
e.Row.FCCheckBox("ChkBonificacion").Visible = False e.Row.FCCheckBox("ChkBonificacion").Visible = False
End If End If
If e.Row.DBCampo("ImporteBonificacion").ToDecimal() = 0 Then
e.Row.FCCheckBox("ChkBonificacion").Visible = False
End If
End If End If
Else Else
@@ -10231,9 +10235,19 @@ Partial Class Clientes
TxtNombreComercial.Enabled = True TxtNombreComercial.Enabled = True
End If End If
' DdlRegimenFiscal.SelectedIndex = -1 ' DdlRegimenFiscal.SelectedIndex = -1
Dim dt As DataTable = GlobalDTRegimenesFiscales(RdTipoPersona.SelectedValue.ToEntero).FiltraParametros("", "CodigoRegimenFiscal")
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
'verifico que sino existe el valor. lo limpie
Dim Val As String = dt.FiltroPrimeroValor("CveRegimenFiscal", "CveRegimenFiscal = " & DdlRegimenFiscal.SelectedValue)
If Val = "" Then 'sino encuentra valor, lo limpia
DdlRegimenFiscal.Items.Clear() DdlRegimenFiscal.Items.Clear()
DdlRegimenFiscal.SelectedValue = Nothing DdlRegimenFiscal.SelectedValue = Nothing
DdlRegimenFiscal.DataSource = GlobalDTRegimenesFiscales(RdTipoPersona.SelectedValue.ToEntero).FiltraParametros("", "CodigoRegimenFiscal") End If
End If
DdlRegimenFiscal.DataSource = dt
DdlRegimenFiscal.DataBind() DdlRegimenFiscal.DataBind()
UpDatos.Update() UpDatos.Update()

View File

@@ -343,6 +343,14 @@ Partial Class Ventas
ViewState("DTRemisiones") = value ViewState("DTRemisiones") = value
End Set End Set
End Property End Property
Private Property ListaDescuentos As List(Of Descuentos)
Get
Return If(IsNothing(ViewState("ListaDescuentos")), Nothing, CType(ViewState("ListaDescuentos"), List(Of Descuentos)))
End Get
Set(value As List(Of Descuentos))
ViewState("ListaDescuentos") = value
End Set
End Property
Private Property RemisionesLista As List(Of Integer) Private Property RemisionesLista As List(Of Integer)
Get Get
Return If(IsNothing(ViewState("RemisionesLista")), Nothing, CType(ViewState("RemisionesLista"), List(Of Integer))) Return If(IsNothing(ViewState("RemisionesLista")), Nothing, CType(ViewState("RemisionesLista"), List(Of Integer)))
@@ -2318,6 +2326,8 @@ Partial Class Ventas
RemisionesLista = New List(Of Integer) RemisionesLista = New List(Of Integer)
Pedidos2Lista = New List(Of Integer) Pedidos2Lista = New List(Of Integer)
CotizacionesLista = New List(Of Integer) CotizacionesLista = New List(Of Integer)
ListaDescuentos = New List(Of Descuentos)
CuentasContablesInvalidas = New StringBuilder CuentasContablesInvalidas = New StringBuilder
CvePrePoliza = 0 CvePrePoliza = 0
TotalOtrosConceptos = 0 TotalOtrosConceptos = 0
@@ -4400,19 +4410,143 @@ Partial Class Ventas
CveVenta = If(CvePedido > 0, CvePedido, CveVenta) CveVenta = If(CvePedido > 0, CvePedido, CveVenta)
Dim DtAntRelacionados As DataTable = Nothing Dim DtAntRelacionados As DataTable = Nothing
Dim SerieFolioPadre As String
Dim DbRowVenta As DataRow = Nothing
Dim ObjVentas As New ClsVentas() 'CARGA DTs DE VENTAS
If CveVenta > 0 Then
Using ObjVentas As New ClsVentas()
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
DbRowVenta = ObjVentas.DtResultados.Copy().Rows(0)
Else
ViewState("CveVenta") = -1
Alert("El documento solicitado no existe, favor de revisar su búsqueda.", TipoMensaje.MsgAdvertencia)
End If
End If
If DbRowVenta IsNot Nothing Then
If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
DtAntRelacionados = ObjVentas.DtResultados.FiltraParametros("TipoDocto IN ('Ing','Ant','Egs','Dev')") DtAntRelacionados = ObjVentas.DtResultados.FiltraParametros("TipoDocto IN ('Ing','Ant','Egs','Dev')")
End If End If
Dim SerieFolioPadre As String 'CargaDetalle
If ObjVentas.GetVentaDetalle(CveVenta) Then
TmpDT = ObjVentas.DtResultados.Copy()
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
TmpDT.Columns.Add("TieneProntoPago", GetType(String))
TmpDT.Columns.Add("ImporteProntoPago", GetType(Decimal))
End If
'CargaFirmas
If ObjVentas.GetVentasFirmas(CveVenta) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
DTmpF = ObjVentas.DtResultados.Copy()
End If
End If
'CARGA IMPUESTOS LOCALES
If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
TmpDTImpuestos = ObjVentas.DtResultados.Copy()
End If
End If
'CARGA ANTICIPOS
If Not (CveRemision > 0 Or CveCotizacion > 0) Then
If DbRowVenta("TipoDocto").ToString().Contiene("Ing", "Ant") Then
'carga as notas de credito vinculadas
If ObjVentas.GetVentasAntNC(CveVenta, -1) Then
TmpDTDocumentosRelacionados = ObjVentas.DtResultados.Copy()
GvAntNC.DataSource = TmpDTDocumentosRelacionados
GvAntNC.Caption = " <table width='100%'><tr><td style='text-align:center'>(Anticipos/NC/IxC) Vinculados</td></tr></table>"
GvAntNC.DataBind()
End If
End If
If DbRowVenta("TipoDocto").ToString().Contiene("Egs", "Dev", "Ant") Then
Dim AplicaAmortizacion As Boolean = False
If DbRowVenta("TipoDocto").ToString().Contiene("Ant") Then AplicaAmortizacion = True
If ObjVentas.GetVentasAntNC(-1, CveVenta, AplicaAmortizacion) Then
TmpDTNCVinculadas = ObjVentas.DtResultados.Copy()
GvNC.DataSource = TmpDTNCVinculadas
GvNC.Caption = " <table width='100%'><tr><td style='text-align:center'>Ventas Aplicadas</td></tr></table>"
GvNC.DataBind()
InicializaDTVentasNC()
For Each Dr As DataRow In TmpDTNCVinculadas.Rows
If Dr("CveConceptoContable").ToString().ToEntero() = 91 Then
CargaNCDT(Dr("CveVenta").ToString().ToEntero(), Dr("Importe").ToString().ToDecimal, Dr("FolioFiscal").ToString(), TC:=Dr("TipoCambio").ToString().ToDecimal)
End If
Next
If GvNC.Rows.Count > 0 Then
ImgAntiPend.Visible = False
End If
End If
End If
End If
'CARGA REMISIONES
If ObjVentas.GetRemisionesRelacionadas(CveVenta, DbRowVenta("TipoDocto").ToString()) Then
GvRemisiones.Caption = " <table width='100%'><tr><td style='text-align:center'>Remisiones/Facturas</td></tr></table>"
GvRemisiones.DataSource = ObjVentas.DtResultados.Copy()
GvCancelarRemisiones.DataSource = ObjVentas.DtResultados.Copy()
GvRemisiones.DataBind()
GvCancelarRemisiones.DataBind()
'[IPP] SI ES REMISION PARA CANCELARLA NO DEBE TENER NINGUNA FACTURADA RELACIONADA - 24Abril2018
If DbRowVenta("TipoDocto").ToString().Contiene("Rem") And GvRemisiones.Rows.Count > 0 Then
LbCancelarDocumento.Visible = False
End If
'SI TIENE REMISIONES Y VA A CANCELAR ES NECESARIO EL MOVIMIENTO DE DEVOLUCION
If DbRowVenta("TipoDocto").ToString().Contiene("Ing", "Ant") AndAlso GvRemisiones.Rows.Count > 0 Then
ChkDevAlm.Checked = True
ChkDevAlm.Enabled = False
'LiDevolucionAlmacen.Visible = False
End If
End If
'SI ES COTIZACION PUEDE GENERAR UNA OC PARA MODIFICAR LOS IMPORTES
If DbRowVenta("TipoDocto").ToString() = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(583) = "1" Then
Dim DtOCGeneradas As DataTable = Nothing
If ObjVentas.GetVentasCotizacionesOC(Me.CveVenta, -1, UsuarioActual.CveEmpresa) Then
DtOCGeneradas = ObjVentas.DtResultados.Copy()
End If
If DtOCGeneradas IsNot Nothing AndAlso DtOCGeneradas.Rows.Count > 0 Then
LtGenerarOC.Visible = False
Else
LtGenerarOC.Visible = True
End If
End If
'CARGA GV DE OC RELACIONADAS
If ObjVentas.GetOCRelacionadas(CveVenta) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
DivOCRelacionadas.Visible = True
GvOCRelacionadas.DataSource = ObjVentas.DtResultados
GvOCRelacionadas.DataBind()
End If
End If
End If
End Using
End If
If DbRowVenta IsNot Nothing Then
'CARGAR PS
GvPS.DataSource = TmpDT
GvPS.DataBind()
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
Dim DbRowVenta As DataRow = ObjVentas.DtResultados.Rows(0)
Dim CveCliente As Integer = DbRowVenta("CveCliente").ToString().ToEntero() Dim CveCliente As Integer = DbRowVenta("CveCliente").ToString().ToEntero()
HdnCveVenta.Value = CveVenta.ToString() HdnCveVenta.Value = CveVenta.ToString()
@@ -4432,13 +4566,10 @@ Partial Class Ventas
Else Else
DivAdjuntar.Visible = False DivAdjuntar.Visible = False
End If End If
ViewState("CveSubProyectoVenta") = DbRowVenta("CveSubProyecto").ToString().ToEntero() ViewState("CveSubProyectoVenta") = DbRowVenta("CveSubProyecto").ToString().ToEntero()
Me.CveEstatusFacturaPadre = DbRowVenta("CveEstatusFacturaPadre").ToString().ToEntero() Me.CveEstatusFacturaPadre = DbRowVenta("CveEstatusFacturaPadre").ToString().ToEntero()
'CargaEncabezado 'CargaEncabezado
If Not (CveRemision > 0 Or CveCotizacion > 0) Then If Not (CveRemision > 0 Or CveCotizacion > 0) Then
@@ -4518,21 +4649,6 @@ Partial Class Ventas
TrServicioDomicilio.Visible = True TrServicioDomicilio.Visible = True
End If End If
'CargaDetalle
If ObjVentas.GetVentaDetalle(CveVenta) Then
TmpDT = ObjVentas.DtResultados
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
TmpDT.Columns.Add("TieneProntoPago", GetType(String))
TmpDT.Columns.Add("ImporteProntoPago", GetType(Decimal))
GvPS.DataSource = ObjVentas.DtResultados
GvPS.DataBind()
'IEPS A NIVEL DETALLE
'TxtIEPS.Text = If(TmpDT.SUM("IEPS") > 0, TmpDT.SUM("IEPS").FormatoNumero, TxtIEPS.Text)
End If
If UsuarioActual.TienePermisoProceso(318) Then If UsuarioActual.TienePermisoProceso(318) Then
If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev") AndAlso String.IsNullOrEmpty(DbRowVenta("FolioFiscal").ToString.Trim) Then HplFolioFiscalModal.Visible = True If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev") AndAlso String.IsNullOrEmpty(DbRowVenta("FolioFiscal").ToString.Trim) Then HplFolioFiscalModal.Visible = True
End If End If
@@ -4957,9 +5073,6 @@ Partial Class Ventas
TrTipoRelacion2.Visible = True TrTipoRelacion2.Visible = True
LblTipoRelacion.Text = DbRowVenta("TipoRelacion").ToString() LblTipoRelacion.Text = DbRowVenta("TipoRelacion").ToString()
HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString() HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString()
End If End If
@@ -5149,29 +5262,17 @@ Partial Class Ventas
GvPS.Columns(19).Visible = False GvPS.Columns(19).Visible = False
GvPS.Columns(20).Visible = False GvPS.Columns(20).Visible = False
'CargaFirmas GvFirmas.DataSource = DTmpF
If ObjVentas.GetVentasFirmas(CveVenta) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
DTmpF = ObjVentas.DtResultados
GvFirmas.DataSource = ObjVentas.DtResultados
GvFirmas.DataBind() GvFirmas.DataBind()
Else
GvFirmas.DataSource = Nothing
End If
End If
'CARGA IMPUESTOS LOCALES If TmpDTImpuestos IsNot Nothing AndAlso TmpDTImpuestos.Rows.Count > 0 Then
If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
TrOtros.Visible = True TrOtros.Visible = True
TmpDTImpuestos = ObjVentas.DtResultados GvImpuestosLocales2.DataSource = TmpDTImpuestos
GvImpuestosLocales2.DataSource = ObjVentas.DtResultados
GvImpuestosLocales2.DataBind() GvImpuestosLocales2.DataBind()
GvImpuestosLocales2.Enabled = False GvImpuestosLocales2.Enabled = False
GvImpuestosLocales2.Visible = True GvImpuestosLocales2.Visible = True
End If End If
End If
DdlVendedor.SelectedValue = If(DbRowVenta("CveVendedor").ToString = "", "0", DbRowVenta("CveVendedor").ToString) 'si viene dbnull, que ponga cero. DdlVendedor.SelectedValue = If(DbRowVenta("CveVendedor").ToString = "", "0", DbRowVenta("CveVendedor").ToString) 'si viene dbnull, que ponga cero.
DdlTipoComprobante.Enabled = False DdlTipoComprobante.Enabled = False
@@ -5273,64 +5374,6 @@ Partial Class Ventas
'JJMQ 20160506: Se agrego para la validacion de pago de contado. 'JJMQ 20160506: Se agrego para la validacion de pago de contado.
'CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "") 'CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "")
'CARGA ANTICIPOS
If Not (CveRemision > 0 Or CveCotizacion > 0) Then
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") Then
'carga as notas de credito vinculadas
If ObjVentas.GetVentasAntNC(CveVenta, -1) Then
GvAntNC.DataSource = ObjVentas.DtResultados
TmpDTDocumentosRelacionados = ObjVentas.DtResultados
GvAntNC.Caption = " <table width='100%'><tr><td style='text-align:center'>(Anticipos/NC/IxC) Vinculados</td></tr></table>"
GvAntNC.DataBind()
End If
End If
If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev", "Ant") Then
Dim AplicaAmortizacion As Boolean = False
If DdlTipoComprobante.SelectedValue.Contiene("Ant") Then AplicaAmortizacion = True
If ObjVentas.GetVentasAntNC(-1, CveVenta, AplicaAmortizacion) Then
GvNC.DataSource = ObjVentas.DtResultados
TmpDTNCVinculadas = ObjVentas.DtResultados
GvNC.Caption = " <table width='100%'><tr><td style='text-align:center'>Ventas Aplicadas</td></tr></table>"
GvNC.DataBind()
InicializaDTVentasNC()
For Each Dr As DataRow In ObjVentas.DtResultados.Rows
If Dr("CveConceptoContable").ToString().ToEntero() = 91 Then
CargaNCDT(Dr("CveVenta").ToString().ToEntero(), Dr("Importe").ToString().ToDecimal, Dr("FolioFiscal").ToString(), TC:=Dr("TipoCambio").ToString().ToDecimal)
End If
Next
End If
End If
End If
If GvNC.Rows.Count > 0 Then
ImgAntiPend.Visible = False
End If
'CARGA REMISIONES
If ObjVentas.GetRemisionesRelacionadas(CveVenta, DdlTipoComprobante.SelectedValue) Then
GvRemisiones.Caption = " <table width='100%'><tr><td style='text-align:center'>Remisiones/Facturas</td></tr></table>"
GvRemisiones.DataSource = ObjVentas.DtResultados
GvCancelarRemisiones.DataSource = ObjVentas.DtResultados
GvRemisiones.DataBind()
GvCancelarRemisiones.DataBind()
'[IPP] SI ES REMISION PARA CANCELARLA NO DEBE TENER NINGUNA FACTURADA RELACIONADA - 24Abril2018
If DdlTipoComprobante.SelectedValue.Contiene("Rem") And GvRemisiones.Rows.Count > 0 Then
LbCancelarDocumento.Visible = False
End If
'SI TIENE REMISIONES Y VA A CANCELAR ES NECESARIO EL MOVIMIENTO DE DEVOLUCION
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant") AndAlso GvRemisiones.Rows.Count > 0 Then
ChkDevAlm.Checked = True
ChkDevAlm.Enabled = False
'LiDevolucionAlmacen.Visible = False
End If
End If
tdVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot") tdVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot")
tdFechaVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot") tdFechaVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot")
@@ -5391,10 +5434,22 @@ Partial Class Ventas
'If ObjUsados.GetVentasGarantiaPendiente(CveVenta, -1, Now, UsuarioActual.CveEmpresa) Then 'If ObjUsados.GetVentasGarantiaPendiente(CveVenta, -1, Now, UsuarioActual.CveEmpresa) Then
' DtGarantiasPendientes = ObjUsados.DtResultados.Copy() ' DtGarantiasPendientes = ObjUsados.DtResultados.Copy()
'End If 'End If
ObjUsados.Dispose() ObjUsados.Dispose()
Dim SaldoAlmacenExA As Decimal = 0
'Dim SaldoAlmacenUsados As Decimal = 0
Using ObjInventarios As New ClsInventarios
'VERIFICA SI HACE FALTA DEVOLVER PRODUCTOS Y USADOS EN ESPECIFICO
If ObjInventarios.GetSaldoVentaDetalleAlmacen(CveVenta, UsuarioActual.CveEmpresa) Then
SaldoAlmacenExA = ObjInventarios.DtResultados.SUMD("SaldoAlmacen", $"CveTipoAlmacen = 10")
'SaldoAlmacenUsados = ObjInventarios.DtResultados.SUMD("SaldoAlmacen", $"CveTipoAlmacen = 22")
End If
End Using
'Si ya se surtió y recibió 'Si ya se surtió y recibió
If DbRowVenta("SaldoAlmacen").ToString().ToDecimal > 0 OrElse TmpDT.MAX("CveTipoPS") = "1" Then If SaldoAlmacenExA > 0 OrElse TmpDT.MAX("CveTipoPS") = "1" Then
BtnsFacturar.Visible = True BtnsFacturar.Visible = True
End If End If
@@ -5460,19 +5515,6 @@ Partial Class Ventas
CargaCodigoUnico() CargaCodigoUnico()
'SI ES COTIZACION PUEDE GENERAR UNA OC PARA MODIFICAR LOS IMPORTES
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(583) = "1" Then
Dim DtOCGeneradas As DataTable = Nothing
If ObjVentas.GetVentasCotizacionesOC(Me.CveVenta, -1, UsuarioActual.CveEmpresa) Then
DtOCGeneradas = ObjVentas.DtResultados.Copy()
End If
If DtOCGeneradas IsNot Nothing AndAlso DtOCGeneradas.Rows.Count > 0 Then
LtGenerarOC.Visible = False
Else
LtGenerarOC.Visible = True
End If
End If
DdlTipoRetencion.SelectedValueExist(DbRowVenta("CveTipoRetencion").ToString()) DdlTipoRetencion.SelectedValueExist(DbRowVenta("CveTipoRetencion").ToString())
Me.FacturarSucursal = CBool(DbRowVenta("FacturarSucursal").ToString()) Me.FacturarSucursal = CBool(DbRowVenta("FacturarSucursal").ToString())
@@ -5483,17 +5525,6 @@ Partial Class Ventas
CargaPS(-1, DdlPS) CargaPS(-1, DdlPS)
'CARGA GV DE OC RELACIONADAS
If CveVenta > 0 AndAlso ObjVentas.GetOCRelacionadas(CveVenta) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
DivOCRelacionadas.Visible = True
GvOCRelacionadas.DataSource = ObjVentas.DtResultados
End If
End If
GvOCRelacionadas.DataBind()
'Verifico si tiene la funcionalidad (135) 'Verifico si tiene la funcionalidad (135)
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") Then If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") Then
@@ -5560,12 +5591,7 @@ Partial Class Ventas
UpEstatus.Update() UpEstatus.Update()
Retorno = True Retorno = True
Else
ViewState("CveVenta") = -1
Alert("El documento solicitado no existe, favor de revisar su búsqueda.", TipoMensaje.MsgAdvertencia)
End If End If
End If
ObjVentas.Dispose()
Return Retorno Return Retorno
End Function End Function
@@ -7952,13 +7978,25 @@ Partial Class Ventas
End If End If
End If End If
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso ListaDescuentos IsNot Nothing AndAlso ObjDescuento IsNot Nothing Then
Dim ConsecEliminar = TmpDT.Rows(e.RowIndex)("Consec").ToString().ToEntero()
If ConsecEliminar > 0 Then
Dim descEliminar = ListaDescuentos.FirstOrDefault(Function(x) x.Consec = ConsecEliminar)
If descEliminar IsNot Nothing Then
ListaDescuentos.Remove(descEliminar)
End If
End If
End If
If TmpDT.Rows(e.RowIndex)("CvePS").ToString() <> GvPS.Rows(e.RowIndex).FCDropDownLost("DdlPS").SelectedValue Then If TmpDT.Rows(e.RowIndex)("CvePS").ToString() <> GvPS.Rows(e.RowIndex).FCDropDownLost("DdlPS").SelectedValue Then
'eliminar y cargar el ps *** 'eliminar y cargar el ps ***
Dim DdlUM As DropDownList = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida") Dim DdlUM As DropDownList = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida")
Dim DdlCla As DropDownList = GvPS.Rows(e.RowIndex).FCDropDownList("DdlClasificacion") Dim DdlCla As DropDownList = GvPS.Rows(e.RowIndex).FCDropDownList("DdlClasificacion")
If DtPromociones IsNot Nothing AndAlso DtPromociones.Rows.Count > 0 Then
ObjDescuento = CalcularDescuentos(GvPS.Rows(e.RowIndex).FCDropDownLost("DdlPS").SelectedValue.ToEntero(), Cantidad, PU)
End If
TmpDT.Rows.Remove(TmpDT.Rows(e.RowIndex)) TmpDT.Rows.Remove(TmpDT.Rows(e.RowIndex))
CalculaUsados() CalculaUsados()
AgregarProductoServicio(Cantidad, DdlUM.SelectedValue.ToEntero(), DdlUM.SelectedItem.Text, DdlCla.SelectedValue.ToEntero(), DdlCla.SelectedItem.Text, AgregarProductoServicio(Cantidad, DdlUM.SelectedValue.ToEntero(), DdlUM.SelectedItem.Text, DdlCla.SelectedValue.ToEntero(), DdlCla.SelectedItem.Text,
@@ -7966,18 +8004,17 @@ Partial Class Ventas
GvPS.Rows(e.RowIndex).FCTextBox("TxtObsPS").Text.Trim, PU, ObjDescuento.ImporteDescuento, GvPS.Rows(e.RowIndex).FCTextBox("TxtObsPS").Text.Trim, PU, ObjDescuento.ImporteDescuento,
GvPS.Rows(e.RowIndex).FCDropDownList("DdlProyecto").SelectedValue.ToEntero(), GvPS.Rows(e.RowIndex).FCDropDownList("DdlProyecto").SelectedItem.Text, GvPS.Rows(e.RowIndex).FCDropDownList("DdlProyecto").SelectedValue.ToEntero(), GvPS.Rows(e.RowIndex).FCDropDownList("DdlProyecto").SelectedItem.Text,
GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero(), GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedItem.Text, GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero(), GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedItem.Text,
CuentaPredial:=CuentaPredial, CveVentaDetalle:=GvPS.Rows(e.RowIndex).DataKey("CveVentaDetalle").ToString().ToEntero(), SeActualiza:=True, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle) CuentaPredial:=CuentaPredial, CveVentaDetalle:=GvPS.Rows(e.RowIndex).DataKey("CveVentaDetalle").ToString().ToEntero(), SeActualiza:=True, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle, ObjDescuento:=ObjDescuento)
' TmpDT.Rows(e.RowIndex)("CveUM") = Ddl.SelectedValue ' TmpDT.Rows(e.RowIndex)("CveUM") = Ddl.SelectedValue
' TmpDT.Rows(e.RowIndex)("UM") = Ddl.SelectedItem.Text ' TmpDT.Rows(e.RowIndex)("UM") = Ddl.SelectedItem.Text
If UsuarioActual.Empresa.Funcionalidad(533).ToEntero() > 0 Then
GvPS.EditIndex = -1 GvPS.EditIndex = -1
GvPS.DataSource = TmpDT GvPS.DataSource = TmpDT
DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2") DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
GvPS.DataBind() GvPS.DataBind()
CargaGVInv(DtInv) CargaGVInv(DtInv)
If UsuarioActual.Empresa.Funcionalidad(533).ToEntero() > 0 Then
CalculaUsados() CalculaUsados()
End If End If
@@ -8055,6 +8092,12 @@ Partial Class Ventas
TmpDT.Rows(e.RowIndex)("CveSubProyecto") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedValue TmpDT.Rows(e.RowIndex)("CveSubProyecto") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedValue
End If End If
'RELACIONAL PS CON EL DESCUENTO
If ObjDescuento IsNot Nothing Then
ObjDescuento.Consec = TmpDT.Rows(e.RowIndex)("Consec").ToString().ToEntero()
End If
DrPS = Nothing DrPS = Nothing
GvPS.EditIndex = -1 GvPS.EditIndex = -1
@@ -8065,6 +8108,10 @@ Partial Class Ventas
CalculaUsados() CalculaUsados()
End If End If
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso ListaDescuentos IsNot Nothing AndAlso ObjDescuento IsNot Nothing Then
ListaDescuentos.Add(ObjDescuento)
End If
CalculaTotalesVenta() CalculaTotalesVenta()
'SI EL PORLET DE COMERCIO EXTERIOR EXTERIOR ESTA VISIBLE SE ACTUALIZAN LOS PRODUCTOS DEL GRIDVIEW 'SI EL PORLET DE COMERCIO EXTERIOR EXTERIOR ESTA VISIBLE SE ACTUALIZAN LOS PRODUCTOS DEL GRIDVIEW
@@ -8083,6 +8130,16 @@ Partial Class Ventas
End Sub End Sub
Protected Sub GvPS_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvPS.RowDeleting Protected Sub GvPS_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvPS.RowDeleting
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso ListaDescuentos IsNot Nothing Then
Dim ConsecEliminar = TmpDT.Rows(e.RowIndex)("Consec").ToString().ToEntero()
If ConsecEliminar > 0 Then
Dim descEliminar = ListaDescuentos.FirstOrDefault(Function(x) x.Consec = ConsecEliminar)
If descEliminar IsNot Nothing Then
ListaDescuentos.Remove(descEliminar)
End If
End If
End If
Dim DbRow As DataRow = Nothing Dim DbRow As DataRow = Nothing
DbRow = TmpDT.Rows(e.RowIndex) DbRow = TmpDT.Rows(e.RowIndex)
TmpDT.Rows.Remove(DbRow) TmpDT.Rows.Remove(DbRow)
@@ -17835,8 +17892,11 @@ Partial Class Ventas
End If End If
End If End If
Dim Cant As Integer = 1 Dim Cant As Integer = 1
Dim CveMarcaPromocion As Integer = -1
If dr IsNot Nothing Then If dr IsNot Nothing Then
CveMarcaPromocion = dr("CveMarca").ToString().ToEntero()
TipoPromo = dr("TipoPromocion").ToString().ToEntero() TipoPromo = dr("TipoPromocion").ToString().ToEntero()
CantMinima = dr("CantidadMinima").ToString().ToEntero() CantMinima = dr("CantidadMinima").ToString().ToEntero()
IncluyeImpuestos = dr("IncluyeImpuestos").ToString() = "True" IncluyeImpuestos = dr("IncluyeImpuestos").ToString() = "True"
@@ -17954,6 +18014,26 @@ Partial Class Ventas
End If End If
'YOKOHAMA
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso CveRinTamañoPS > 0 AndAlso CveMarcaPromocion.Contiene(800, 912, 1238, 1381, 1456, 1528, 1600, 1672, 1807) Then
Dim DtRines As DataTable = Nothing
Dim ObjGral As New ClsGenerales
If ObjGral.GetRimTamanios(UsuarioActual.CveEmpresa) Then
DtRines = ObjGral.DtResultados.Copy()
End If
ObjGral.Dispose()
If CveMarcaPromocion > 0 Then
ObjDescuento.NombrePromo = "YOKOHAMA VERANO" 'dr("NombrePromocion").ToString()
ObjDescuento.CveMarca = CveMarcaPromocion
Dim Rin As String = DtRines.FiltroPrimeroValor("RinTamaño", $"CveRinTamaño = {CveRinTamañoPS}")
Dim PromoDescuento = (Descuento * (1 + If(IncluyeImpuestos, PorcentajeIVA, 0))).RoundSQL(2)
ObjDescuento.ObsDescuento = String.Format("RIN {0} BONO ${1:N2}", Rin, PromoDescuento)
End If
End If
ObjDescuento.ImporteDescuento = Descuento.RoundSQL(2) ObjDescuento.ImporteDescuento = Descuento.RoundSQL(2)
ObjDescuento.CvePromocionDetalle = CvePromocionDetalle ObjDescuento.CvePromocionDetalle = CvePromocionDetalle
If SeAjustoPU Then If SeAjustoPU Then
@@ -17993,10 +18073,14 @@ Partial Class Ventas
CvePS, "", TxtObsPS.Text.TrimEnd, PU, ObjDescuento.ImporteDescuento, CvePS, "", TxtObsPS.Text.TrimEnd, PU, ObjDescuento.ImporteDescuento,
DdlProyecto.SelectedValue.ToEntero(), DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedItem.Text, DdlProyecto.SelectedValue.ToEntero(), DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedItem.Text,
Serie:=If(DIVCod.Visible, TxtCodigoSerie.Text.Trim, ""), TiempoEntrega:=TxtTiempoEntrega.Text, CuentaPredial:=TxtCuentaPredial.Text.Trim, RegeneraIEPS:=ClienteDesglosaIEPS, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle, Serie:=If(DIVCod.Visible, TxtCodigoSerie.Text.Trim, ""), TiempoEntrega:=TxtTiempoEntrega.Text, CuentaPredial:=TxtCuentaPredial.Text.Trim, RegeneraIEPS:=ClienteDesglosaIEPS, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle,
ImporteProntoPago:=ObjDescuento.ImporteProntoPago) ImporteProntoPago:=ObjDescuento.ImporteProntoPago, ObjDescuento:=ObjDescuento)
CalculaUsados() CalculaUsados()
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso ListaDescuentos IsNot Nothing AndAlso ObjDescuento IsNot Nothing Then
ListaDescuentos.Add(ObjDescuento)
End If
CalculaTotalesVenta() CalculaTotalesVenta()
LimpiaAgregar() LimpiaAgregar()
@@ -18128,7 +18212,7 @@ Partial Class Ventas
Optional EntregaDirecta As Integer = 0, Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0, Optional EntregaDirecta As Integer = 0, Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0,
Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0, Optional CuentaPredial As String = "", Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0, Optional CuentaPredial As String = "",
Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional SeActualiza As Boolean = False, Optional CvePromocionDetalle As Integer = -1, Optional EsCargo As Boolean = False, Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional SeActualiza As Boolean = False, Optional CvePromocionDetalle As Integer = -1, Optional EsCargo As Boolean = False,
Optional ImporteProntoPago As Decimal = 0) As Boolean Optional ImporteProntoPago As Decimal = 0, Optional ByRef ObjDescuento As Descuentos = Nothing) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
Try Try
@@ -18393,6 +18477,11 @@ Partial Class Ventas
End If End If
End If End If
'RELACIONAL PS CON EL DESCUENTO
If ObjDescuento IsNot Nothing Then
ObjDescuento.Consec = Row("Consec").ToString().ToEntero()
End If
'RECARGAR GV 'RECARGAR GV
TmpDT.Rows.Add(Row) TmpDT.Rows.Add(Row)
@@ -19152,6 +19241,26 @@ Partial Class Ventas
CargaGVInv(DtInv) CargaGVInv(DtInv)
End If End If
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso ListaDescuentos IsNot Nothing AndAlso ListaDescuentos.Count > 0 Then
TxtObsFact.Text = ""
Dim Titulo As String = ListaDescuentos.FirstOrDefault().NombrePromo
Dim strPromos As New StringBuilder
If Not String.IsNullOrEmpty(Titulo) Then
For Each Promo As Descuentos In ListaDescuentos
strPromos.AppendFormat("{0}, ", Promo.ObsDescuento)
Next
If strPromos.Length > 2 Then
strPromos.Remove(strPromos.Length - 2, 2)
End If
End If
TxtObsFact.Text = String.Format("{0} {1}", Titulo, strPromos.ToString())
End If
UPObservaciones.Update()
UpContado.Update() UpContado.Update()
UpPS.Update() UpPS.Update()
RegistraScript("BorraDescuentos();", "BorraDescuentos") RegistraScript("BorraDescuentos();", "BorraDescuentos")
@@ -19849,7 +19958,42 @@ Partial Class Ventas
Return MovDTCuadrados Return MovDTCuadrados
End Function End Function
Private Function GenerarMovimientoAlmacen(ByRef ObjInventario As ClsInventarios, DtMovDetalle As DataTable, CveAlmacen As Integer, ConceptoEntrada As Integer, CveMoneda As Integer, CveVenta As Integer, Optional MovimientoPrePoliza As Boolean = False, Private Function SalidaEntradaAlmacen(ByRef ObjInventario As ClsInventarios, CveRemision As Integer, ByRef ObjConta As ClsContabilidad) As Boolean
Dim OcurrioError As Boolean = False
Dim DtMovimientos As DataTable
Dim DtMovimientosDetalles As DataTable
'Obtenemos los movimientos detalle
If ObjInventario.GetInv_Mov(CveRemision, UsuarioActual.CveEmpresa) Then
If ObjInventario.DtResultados.Rows.Count > 0 Then
DtMovimientos = ObjInventario.DtResultados.FiltraParametros("", DistinctColumns:={"CveMovimiento"})
DtMovimientosDetalles = ObjInventario.DtResultados.FiltraParametros("CvePS > 0")
For Each dr As DataRow In DtMovimientos.Rows
'Obtenemos los Movimientos de salida
If ObjInventario.GetMovimientos(dr("CveMovimiento").ToString().ToEntero(), 3, -1, UsuarioActual.CveEmpresa) Then
Dim CveAlmacenSalida As Integer = ObjInventario.DtResultados(0)("CveAlmacen").ToString().ToEntero()
Dim CveMoneda As Integer = ObjInventario.DtResultados(0)("CveMoneda").ToString().ToEntero()
'Le damos entrada
If Not GenerarMovimientoAlmacen(ObjInventario, DtMovimientosDetalles.FiltraParametros($"CveMovimiento = {dr("CveMovimiento")}"), CveAlmacenSalida, 2, CveMoneda, CveRemision) > 0 Then
OcurrioError = True
End If
End If
Next
End If
End If
Return Not OcurrioError
End Function
Private Function GenerarMovimientoAlmacen(ByRef ObjInventario As ClsInventarios, DtMovDetalle As DataTable, CveAlmacen As Integer, ConceptoEntrada As Integer, CveMoneda As Integer, CveVenta As Integer, Optional MovimientoPrePoliza As Boolean = True,
Optional ByRef ObjConta As ClsContabilidad = Nothing, Optional CveMovimientoRelacionado As Integer = -1, Optional AplicaMovimientoDetalleEntrada As Boolean = False, Optional ObjContPaq As ClsContPAQi = Nothing) As Integer Optional ByRef ObjConta As ClsContabilidad = Nothing, Optional CveMovimientoRelacionado As Integer = -1, Optional AplicaMovimientoDetalleEntrada As Boolean = False, Optional ObjContPaq As ClsContPAQi = Nothing) As Integer
Dim OcurrioError As Boolean = False Dim OcurrioError As Boolean = False
Dim ContadorMovtosDetalles = 0 Dim ContadorMovtosDetalles = 0
@@ -19948,7 +20092,6 @@ Partial Class Ventas
Dim DtCostos = ObjInventario.DtResultados.Copy Dim DtCostos = ObjInventario.DtResultados.Copy
Dim DtCostosDistinct As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"}) Dim DtCostosDistinct As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"})
Dim IdCtaContable As Integer = 0 Dim IdCtaContable As Integer = 0
Dim CveCuenta As Integer = 0
Dim ValorInventario As Decimal Dim ValorInventario As Decimal
Dim TotalCostoAcumulado As Decimal = 0D Dim TotalCostoAcumulado As Decimal = 0D
Dim Cont As Integer = 1 Dim Cont As Integer = 1
@@ -19966,7 +20109,7 @@ Partial Class Ventas
Try Try
'If ValorInventario <> 0 Then 'If ValorInventario <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ValorInventario, ObjFactura.SerieFolio, 69, ObjFactura.SerieFolio, Now, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta, CveSubProyecto:=ObjFactura.CveSubProyecto) Then If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ValorInventario, ValorInventario, 69, ObjFactura.SerieFolio, ObjFactura.SerieFolio, IdCtaContable, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, CveSubProyecto:=ObjFactura.CveSubProyecto) Then
OcurrioError = True OcurrioError = True
Exit For Exit For
End If End If
@@ -19980,7 +20123,7 @@ Partial Class Ventas
If Not OcurrioError Then If Not OcurrioError Then
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero() IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero()
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, TotalCosto, ObjFactura.SerieFolio, 68, ObjFactura.SerieFolio, Now, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=ObjFactura.CveSubProyecto) Then If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, TotalCosto, TotalCosto, 68, ObjFactura.SerieFolio, ObjFactura.SerieFolio, IdCtaContable, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, CveSubProyecto:=ObjFactura.CveSubProyecto) Then
OcurrioError = True OcurrioError = True
End If End If
End If End If
@@ -26690,6 +26833,33 @@ Partial Class Ventas
'GvRemisionesNCBon.DataSource = Me.TmpDTRNCBonificacionesSeleccionadas 'GvRemisionesNCBon.DataSource = Me.TmpDTRNCBonificacionesSeleccionadas
'GvRemisionesNCBon.DataBind() 'GvRemisionesNCBon.DataBind()
Dim SaldoMaximoUtilizable As Decimal = 0
If CargarSoloGarantias Then
Dim SaldoMaximo As Decimal = DtNC.SUMD("Saldo", "TipoRNC = 1 AND EsGarantia = True")
If SaldoMaximo > 0 Then
SaldoMaximoUtilizable = SaldoMaximo
Else
SaldoMaximoUtilizable = 0
End If
Else
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
DivSMU.Visible = True
Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
If SaldoMaximo > 0 Then
SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
Else
SaldoMaximoUtilizable = 0
End If
Else
SaldoMaximoUtilizable = 0
End If
ObjAcum.Dispose()
End If
If CveVentaUsado > 0 Then If CveVentaUsado > 0 Then
DivSMU.Visible = True DivSMU.Visible = True
@@ -26702,44 +26872,21 @@ Partial Class Ventas
End Using End Using
If DtDetalleUsado IsNot Nothing Then If DtDetalleUsado IsNot Nothing Then
Dim SaldoMaximoUsados As Decimal = DtDetalleUsado.SUM("Total", "EsCargo = True").ToDecimal() + DtDetalleUsado.SUM("ImporteIVA", "EsCargo = True").ToDecimal() Dim SaldoMaximoUsadosFactura As Decimal = DtDetalleUsado.SUM("Total", "EsCargo = True").ToDecimal() + DtDetalleUsado.SUM("ImporteIVA", "EsCargo = True").ToDecimal()
HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString() If SaldoMaximoUtilizable < SaldoMaximoUsadosFactura Then
LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados) HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
End If LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUtilizable)
Else Else
If CargarSoloGarantias Then HdnSaldoMaximoUsados.Value = SaldoMaximoUsadosFactura.ToString()
Dim SaldoMaximo As Decimal = DtNC.SUMD("Saldo", "TipoRNC = 1 AND EsGarantia = True") LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsadosFactura)
If SaldoMaximo > 0 Then
HdnSaldoMaximoUsados.Value = SaldoMaximo.ToString()
LtlSMU.Text = SaldoMaximo.FormatoNumero(2)
Else
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
End If End If
Else Else
Dim ObjAcum As New ClsAcumuladores HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUtilizable)
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2) End If
DivSMU.Visible = True
Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
If SaldoMaximo > 0 Then
HdnSaldoMaximoUsados.Value = RowUsadosNC("ValorConImpuestos").ToString()
LtlSMU.Text = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal().FormatoNumero(2)
Else Else
HdnSaldoMaximoUsados.Value = "0" HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
LtlSMU.Text = "0" LtlSMU.Text = SaldoMaximoUtilizable.FormatoNumero(2)
End If
Else
'DivSMU.Visible = False
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
End If
ObjAcum.Dispose()
End If
End If End If
Else Else
HdnSaldoMaximoUsados.Value = "0" HdnSaldoMaximoUsados.Value = "0"
@@ -26778,9 +26925,44 @@ Partial Class Ventas
End If End If
GvDescNCCargos.DataBind() GvDescNCCargos.DataBind()
Dim SaldoMaximoUsados As Decimal = Me.TmpDT.SUM("Total", "EsCargo = True").ToDecimal() + Me.TmpDT.SUM("ImporteIVA", "EsCargo = True").ToDecimal() Dim SaldoMaximoUtilizable As Decimal = 0
HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString()
LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUsados) If CargarSoloGarantias Then
Dim SaldoMaximo As Decimal = DtNC.SUMD("Saldo", "TipoRNC = 1 AND EsGarantia = True")
If SaldoMaximo > 0 Then
SaldoMaximoUtilizable = SaldoMaximo
Else
SaldoMaximoUtilizable = 0
End If
Else
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
DivSMU.Visible = True
Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
If SaldoMaximo > 0 Then
SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
Else
SaldoMaximoUtilizable = 0
End If
Else
SaldoMaximoUtilizable = 0
End If
ObjAcum.Dispose()
End If
Dim SaldoMaximoUsadosFactura As Decimal = Me.TmpDT.SUM("Total", "EsCargo = True").ToDecimal() + Me.TmpDT.SUM("ImporteIVA", "EsCargo = True").ToDecimal()
If SaldoMaximoUtilizable < SaldoMaximoUsadosFactura Then
HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUtilizable)
Else
HdnSaldoMaximoUsados.Value = SaldoMaximoUsadosFactura.ToString()
LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUsadosFactura)
End If
Else Else
HdnSaldoMaximoUsados.Value = "0" HdnSaldoMaximoUsados.Value = "0"
LblSaldoMaximoUsados.Text = "0" LblSaldoMaximoUsados.Text = "0"
@@ -26820,6 +27002,27 @@ Partial Class Ventas
GvRemisionesNCDetalle.DataBind() GvRemisionesNCDetalle.DataBind()
'GvRemisionesNCBon.DataBind() 'GvRemisionesNCBon.DataBind()
Dim SaldoMaximoUtilizable As Decimal = 0
If CargaSoloGarantias Then
Dim SaldoMaximo As Decimal = TmpDTRNCDetalle.SUMD("Total", "TipoRNC = 1")
If SaldoMaximo > 0 Then
SaldoMaximoUtilizable = SaldoMaximo
Else
SaldoMaximoUtilizable = 0
End If
Else
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
DivSMU.Visible = True
SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
Else
'DivSMU.Visible = False
SaldoMaximoUtilizable = 0
End If
ObjAcum.Dispose()
End If
If CveVentaUsado > 0 Then If CveVentaUsado > 0 Then
DivSMU.Visible = True DivSMU.Visible = True
@@ -26833,49 +27036,26 @@ Partial Class Ventas
If DtDetalleUsado IsNot Nothing Then If DtDetalleUsado IsNot Nothing Then
Dim SaldoMaximoUsados As Decimal = DtDetalleUsado.SUM("Total", "EsCargo = True").ToDecimal() + DtDetalleUsado.SUM("ImporteIVA", "EsCargo = True").ToDecimal() Dim SaldoMaximoUsados As Decimal = DtDetalleUsado.SUM("Total", "EsCargo = True").ToDecimal() + DtDetalleUsado.SUM("ImporteIVA", "EsCargo = True").ToDecimal()
HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
If SaldoMaximoUsados > 0 Then If SaldoMaximoUtilizable < SaldoMaximoUsados Then
HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUtilizable)
Else
HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString() HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString()
LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados) LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados)
Else
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
End If End If
End If End If
Else Else
If CargaSoloGarantias Then HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
Dim SaldoMaximo As Decimal = TmpDTRNCDetalle.SUMD("Total", "TipoRNC = 1") LtlSMU.Text = SaldoMaximoUtilizable.FormatoNumero(2)
If SaldoMaximo > 0 Then
HdnSaldoMaximoUsados.Value = SaldoMaximo.ToString()
LtlSMU.Text = SaldoMaximo.FormatoNumero(2)
Else
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
End If
Else
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
DivSMU.Visible = True
HdnSaldoMaximoUsados.Value = RowUsadosNC("ValorConImpuestos").ToString()
LtlSMU.Text = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal().FormatoNumero(2)
Else
'DivSMU.Visible = False
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
End If
ObjAcum.Dispose()
End If
End If End If
UpModalRemisionesNC.Update() UpModalRemisionesNC.Update()
UpDescNC.Update() UpDescNC.Update()
End Sub End Sub
Private Sub CargaRNCDetalleDesc(Optional CargarSoloGarantias As Boolean = False) Private Sub CargaRNCDetalleDesc(Optional CargarSoloGarantias As Boolean = False)
Dim DtNC As DataTable = Nothing
Dim ObjMovtos As New ClsMovimientos() Dim ObjMovtos As New ClsMovimientos()
If ObjMovtos.GetRemisionesNCCliente(CveCliente, True, CveMoneda:=-1) Then If ObjMovtos.GetRemisionesNCCliente(CveCliente, True, CveMoneda:=-1) Then
@@ -26896,14 +27076,42 @@ Partial Class Ventas
End If End If
GvDescNCCargosDetalle.DataBind() GvDescNCCargosDetalle.DataBind()
Dim SaldoMaximoUtilizable As Decimal = 0
If CargarSoloGarantias Then
Dim SaldoMaximo As Decimal = TmpDTRNCDetalle.SUMD("Saldo", "TipoRNC = 1 AND EsGarantia = True")
If SaldoMaximo > 0 Then
SaldoMaximoUtilizable = SaldoMaximo
Else
SaldoMaximoUtilizable = 0
End If
Else
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
DivSMU.Visible = True
Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
If SaldoMaximo > 0 Then
SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
Else
SaldoMaximoUtilizable = 0
End If
Else
SaldoMaximoUtilizable = 0
End If
ObjAcum.Dispose()
End If
Dim SaldoMaximoUsados As Decimal = Me.TmpDT.SUM("Total", "EsCargo = True").ToDecimal() + Me.TmpDT.SUM("ImporteIVA", "EsCargo = True").ToDecimal() Dim SaldoMaximoUsados As Decimal = Me.TmpDT.SUM("Total", "EsCargo = True").ToDecimal() + Me.TmpDT.SUM("ImporteIVA", "EsCargo = True").ToDecimal()
If SaldoMaximoUsados > 0 Then If SaldoMaximoUtilizable < SaldoMaximoUsados Then
HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUtilizable)
Else
HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString() HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString()
LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUsados) LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUsados)
Else
HdnSaldoMaximoUsados.Value = "0"
LblSaldoMaximoUsados.Text = "0"
End If End If
UpDescNC.Update() UpDescNC.Update()
@@ -26940,6 +27148,16 @@ Partial Class Ventas
GvRemisionesNCBonDetalle.DataSource = TmpDTRNCDetalle.FiltraParametros("TipoRNC = 2") GvRemisionesNCBonDetalle.DataSource = TmpDTRNCDetalle.FiltraParametros("TipoRNC = 2")
GvRemisionesNCBonDetalle.DataBind() GvRemisionesNCBonDetalle.DataBind()
Dim SaldoMaximoUtilizable As Decimal = 0
If TmpDTRNCBonificacionesSeleccionadas IsNot Nothing Then
Dim SaldoMaximo As Decimal = TmpDTRNCBonificacionesSeleccionadas.SUMD("Saldo")
If SaldoMaximo > 0 Then
SaldoMaximoUtilizable = SaldoMaximo
Else
SaldoMaximoUtilizable = 0
End If
End If
If DdlVentaUsado.SelectedValue.ToEntero() > 0 Then If DdlVentaUsado.SelectedValue.ToEntero() > 0 Then
Dim DtDetalleFactura As DataTable = Nothing Dim DtDetalleFactura As DataTable = Nothing
Using ObjVentas As New ClsVentas Using ObjVentas As New ClsVentas
@@ -26949,21 +27167,18 @@ Partial Class Ventas
End Using End Using
Dim ImporteBon As Decimal = DtDetalleFactura.SUMD("PUBonificacion") * (1 + DtDetalleFactura.MAX("PorcentajeIVA").ToDecimal()) Dim ImporteBon As Decimal = DtDetalleFactura.SUMD("PUBonificacion") * (1 + DtDetalleFactura.MAX("PorcentajeIVA").ToDecimal())
If SaldoMaximoUtilizable < ImporteBon Then
LtlSMUBon.Text = String.Format("{0:N2}", SaldoMaximoUtilizable)
HdnSMUBon.Value = SaldoMaximoUtilizable.ToString()
Else
LtlSMUBon.Text = String.Format("{0:N2}", ImporteBon) LtlSMUBon.Text = String.Format("{0:N2}", ImporteBon)
HdnSMUBon.Value = ImporteBon.ToString() HdnSMUBon.Value = ImporteBon.ToString()
End If
DtDetalleFactura.Dispose() DtDetalleFactura.Dispose()
Else Else
If TmpDTRNCBonificacionesSeleccionadas IsNot Nothing Then HdnSMUBon.Value = SaldoMaximoUtilizable.ToString()
Dim SaldoMaximo As Decimal = TmpDTRNCBonificacionesSeleccionadas.SUMD("Saldo") LtlSMUBon.Text = SaldoMaximoUtilizable.FormatoNumero(2)
If SaldoMaximo > 0 Then
HdnSMUBon.Value = SaldoMaximo.ToString()
LtlSMUBon.Text = SaldoMaximo.FormatoNumero(2)
Else
HdnSMUBon.Value = "0"
LtlSMUBon.Text = "0"
End If
End If
End If End If
UpModalRemisionesNC.Update() UpModalRemisionesNC.Update()
@@ -27077,6 +27292,9 @@ Partial Class Ventas
'LtlSMUBon.Text = String.Format("{0:N2}", SMUBon) 'LtlSMUBon.Text = String.Format("{0:N2}", SMUBon)
'HdnSMUBon.Value = SMUBon.ToString() 'HdnSMUBon.Value = SMUBon.ToString()
Dim SaldoMaximoUtilizable As Decimal = TmpDTRNCBonificacionesSeleccionadas.SUMD("Saldo")
If DdlVentaUsado.SelectedValue.ToEntero() > 0 Then If DdlVentaUsado.SelectedValue.ToEntero() > 0 Then
Dim DtDetalleFactura As DataTable = Nothing Dim DtDetalleFactura As DataTable = Nothing
Using ObjVentas As New ClsVentas Using ObjVentas As New ClsVentas
@@ -27086,15 +27304,20 @@ Partial Class Ventas
End Using End Using
Dim ImporteBon As Decimal = DtDetalleFactura.SUMD("PUBonificacion") * (1 + DtDetalleFactura.MAX("PorcentajeIVA").ToDecimal()) Dim ImporteBon As Decimal = DtDetalleFactura.SUMD("PUBonificacion") * (1 + DtDetalleFactura.MAX("PorcentajeIVA").ToDecimal())
If SaldoMaximoUtilizable < ImporteBon Then
LtlSMUBon.Text = String.Format("{0:N2}", SaldoMaximoUtilizable)
HdnSMUBon.Value = SaldoMaximoUtilizable.ToString()
Else
LtlSMUBon.Text = String.Format("{0:N2}", ImporteBon) LtlSMUBon.Text = String.Format("{0:N2}", ImporteBon)
HdnSMUBon.Value = ImporteBon.ToString() HdnSMUBon.Value = ImporteBon.ToString()
End If
DtDetalleFactura.Dispose() DtDetalleFactura.Dispose()
Else Else
Dim SaldoMaximo As Decimal = TmpDTRNCBonificacionesSeleccionadas.SUMD("Saldo") If SaldoMaximoUtilizable > 0 Then
If SaldoMaximo > 0 Then HdnSMUBon.Value = SaldoMaximoUtilizable.ToString()
HdnSMUBon.Value = SaldoMaximo.ToString() LtlSMUBon.Text = SaldoMaximoUtilizable.FormatoNumero(2)
LtlSMUBon.Text = SaldoMaximo.FormatoNumero(2)
Else Else
HdnSMUBon.Value = "0" HdnSMUBon.Value = "0"
LtlSMUBon.Text = "0" LtlSMUBon.Text = "0"
@@ -32904,11 +33127,15 @@ Partial Class Ventas
' If ObjAC IsNot Nothing Then ObjAC.Dispose() ' If ObjAC IsNot Nothing Then ObjAC.Dispose()
'End Sub 'End Sub
Partial Class Descuentos Partial Class Descuentos
Public Consec As Integer
Public ImporteDescuento As Decimal = 0 Public ImporteDescuento As Decimal = 0
Public CvePromocionDetalle As Integer = -1 Public CvePromocionDetalle As Integer = -1
Public PU As Decimal = 0 Public PU As Decimal = 0
Public EsPUModificado As Boolean = False Public EsPUModificado As Boolean = False
Public ImporteProntoPago As Decimal = 0 Public ImporteProntoPago As Decimal = 0
Public NombrePromo As String = ""
Public CveMarca As Integer = -1
Public ObsDescuento As String = ""
End Class End Class
Protected Sub btnupEventoBitacora_Click(sender As Object, e As EventArgs) Protected Sub btnupEventoBitacora_Click(sender As Object, e As EventArgs)

View File

@@ -510,6 +510,10 @@