This commit is contained in:
Antonio Gonzalez
2020-10-07 10:32:53 -07:00
41 changed files with 8650 additions and 744 deletions

View File

@@ -363,7 +363,8 @@ Public Class CFDINominaOtrosPagos
Public Property TipoOtroPago As String
Public Property Clave As String
Public Property Concepto As String
Public Property Importe As Double
Public Property Importe As Decimal
Public Property Subsidiocausado As Decimal
End Class

View File

@@ -3475,7 +3475,7 @@ Public Class ClsBancos
#End Region
#Region "PagosCajaChica"
Public Function GetPagosCajaChica(FechaI As String, FechaF As String, CveEmpresa As Integer, CveCuenta As Integer, Optional TipoPago As Integer = -1) As Boolean
Public Function GetPagosCajaChica(FechaI As String, FechaF As String, CveEmpresa As Integer, CveCuenta As Integer, Optional TipoPago As Integer = -1, Optional CveSubProyecto As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_BancosCajaChicaPagosGet")
@@ -3485,6 +3485,7 @@ Public Class ClsBancos
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
.Add("@TipoChequeEfectivo", SqlDbType.Int).Value = TipoPago
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
End With
Try

View File

@@ -56,10 +56,8 @@ Public Class ClsProductosServicios
Public Property CveMetodoInventario As Integer
Public Property CveTipoPS As Integer
Public Property Estado2 As Integer
Public Property CveMarca As Integer
Public Property AlmacenSeccion As String
Public Property CveMarca As Integer
Public Property IEPSPorcentaje As Double
Public Property AplicaIEPS As Boolean
@@ -283,7 +281,7 @@ Public Class ClsProductosServicios
Me.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero
CveMetodoInventario = Data.Rows(0)("Inv_CveMetodoInventario").ToString.ToEntero
'VentaMinima = Data.Rows(0)("VentaMinima").ToString.ToDecimal
VentaMinima = Data.Rows(0)("VentaMinima").ToString.ToDecimal
CveMoneda = Data.Rows(0)("CveMoneda").ToString.ToEntero
RetISR = Data.Rows(0)("RetISR").ToString.ToDouble
@@ -2112,13 +2110,14 @@ Public Class ClsProductosServicios
Return Retorno
End Function
Public Function UpdateProductosServiciosSAT(CvePS As Integer, CveSATPS As Integer, CveUsuario As Integer) As Boolean
Public Function UpdateProductosServiciosSAT(CvePS As Integer, CveSATPS As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_ProductosServiciosSATUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveSATPS", SqlDbType.Int).Value = CveSATPS
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -341,7 +341,7 @@ Public Class ClsVentas
Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1, Optional CveUsoCFDI As Integer = -1, Optional OrdenCompra As String = "-1", Optional CveCuentaTerminal As Integer = -1, Optional CveTipoRelacion As Integer = -1, Optional ImpuestoLocal As Double = 0,
Optional CveTipoAmortizacionAnticipo As Integer = -1, Optional CveVentaRelacion As Integer = -1, Optional ImporteRelacion As Decimal = -1, Optional CveEmpresaCRM As Integer = -1, Optional EsInterno As Integer = -1, Optional CveAcercamientoCRM As Integer = -1,
Optional DiasCredito As Integer = 0, Optional EsDiasCreditoFijo As Boolean = False, Optional AnticipoEspecial As Boolean = False, Optional Kilometraje As Double = 0, Optional EsAmortizacion As Boolean = False, Optional CveTipoRetencion As Integer = 0,
Optional CorreoNotificacion As String = "", Optional FormaPaqueteria As Integer = 1, Optional FacturarSucursal As Boolean = False) As Boolean
Optional CorreoNotificacion As String = "", Optional FormaPaqueteria As Integer = 1, Optional FacturarSucursal As Boolean = False, Optional VentaDesglosaIEPS As Boolean = False) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_VentasAdd")
@@ -433,6 +433,7 @@ Public Class ClsVentas
.Add("@CorreoNotificacion", SqlDbType.VarChar).Value = CorreoNotificacion
.Add("@FormaPaqueteria", SqlDbType.Int).Value = FormaPaqueteria
.Add("@FacturarSucursal", SqlDbType.Bit).Value = FacturarSucursal
.Add("@VentaDesglosaIEPS", SqlDbType.Bit).Value = VentaDesglosaIEPS
.Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
End With

View File

@@ -107,7 +107,7 @@ Public Class LogicNominas
'Conexiones a la Base de Datos
Using objNomina As ClsNominas = New ClsNominas()
Using objPersonal As ClsRH = New ClsRH()
If objNomina.GetNom_Nominas(CveNomina, CvePersonal, CvePeriodo, -1, UsuarioActual.CveEmpresa) AndAlso objNomina.DtResultados.Rows.Count > 0 Then
If objNomina.GetNom_Nominas(CveNomina, -1, -1, -1, UsuarioActual.CveEmpresa) AndAlso objNomina.DtResultados.Rows.Count > 0 Then
CvePersonal = objNomina.DtResultados.Rows(0)("CvePersonal").ToString().ToEntero()
CvePeriodo = objNomina.DtResultados.Rows(0)("CvePeriodo").ToString().ToEntero()
Serie = objNomina.Serie
@@ -116,7 +116,6 @@ Public Class LogicNominas
If continuar Then GetError = "No se pudo obtener la información de la nomina" 'si continuar= true el error se origino en este nodo y se le asigno el error
continuar = False
End If
If continuar AndAlso objPersonal.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa) AndAlso objPersonal.DtResultados.Rows.Count > 0 Then
RFC = objPersonal.RFC
NombreCompleto = objPersonal.NombreCompleto
@@ -143,11 +142,11 @@ Public Class LogicNominas
If continuar Then GetError = "No se pudo obtener la información del empleado" 'si continuar= true el error se origino en este nodo y le asigno el error
continuar = False
End If
If continuar AndAlso objNomina.GetNom_NominasDetalles(CveNomina, CvePersonal, CvePeriodo, "-1") Then
If objNomina.DtResultados.Rows.Count > 0 Then
DtPercepciones = objNomina.DtResultados.FiltraParametros("Tipo = 'P' AND EsPadre = 1 ")
DtDeducciones = objNomina.DtResultados.FiltraParametros("Tipo = 'D' AND EsPadre = 1 ")
DtPercepciones = objNomina.DtResultados.FiltraParametros("Tipo = 'P' AND EsPadre = 1 AND SoloVisible =0")
DtDeducciones = objNomina.DtResultados.FiltraParametros("Tipo = 'D' AND EsPadre = 1 AND SoloVisible =0")
DtOtrosPagos = objNomina.DtResultados.FiltraParametros(" TipoConceptoSAT='O'")
TotalPercepciones = DtPercepciones.SUM("Importe").ToString().ToDecimal()
TotalDeducciones = DtDeducciones.SUM("Importe").ToString().ToDecimal()
Total = CType((Total + DtPercepciones.SUM("Importe")), Decimal)
@@ -161,7 +160,6 @@ Public Class LogicNominas
Else
continuar = False
End If
If continuar AndAlso objNomina.GetPeriodos(-1, UsuarioActual.CveEmpresa, -1, -1, CvePeriodo) AndAlso objNomina.DtResultados.Rows().Count > 0 Then
Dim DrPeriodo As DataRow = objNomina.DtResultados.Rows(0)
@@ -183,8 +181,6 @@ Public Class LogicNominas
Else
continuar = False
End If
If DiasIncapacitados > 0 Then
If objNomina.GetIncapacidades(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa) Then
If objNomina.DtResultados IsNot Nothing AndAlso objNomina.DtResultados.Rows.Count > 0 Then
@@ -222,10 +218,11 @@ Public Class LogicNominas
cfdi.Receptor.RFC = RFC
cfdi.Receptor.Nombre = NombreCompleto
Dim ObjPercepciones As New List(Of CFDINominaPercepciones)
Dim ObjDeducciones As New List(Of CFDINominaDeducciones)
Dim ObjHorasExtras As New List(Of CFDINominaHorasExtras)
Dim ObjOtrosPagos As New List(Of CFDINominaOtrosPagos)
If DtPercepciones IsNot Nothing AndAlso DtPercepciones.Rows.Count > 0 Then
Dim ObjPercepciones As New List(Of CFDINominaPercepciones)
Dim ObjHorasExtras As New List(Of CFDINominaHorasExtras)
Dim ObjOtrosPagos As New List(Of CFDINominaOtrosPagos)
For Each Row As DataRow In DtPercepciones.Rows
If Row("Importe").ToString().ToDecimal > 0 AndAlso Row("SATCveConcepto").ToString().ToEntero() <> 17 Then
If Row("CveSATConcepto").ToString() = "" Then cfdi.AddMsg(String.Format("Concepto No registrado ({0})", Row("Concepto").ToString())) : Exit For
@@ -248,11 +245,62 @@ Public Class LogicNominas
.Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), .Importe = Row("Importe").ToString().ToDecimal})
End If
Next
If ObjPercepciones IsNot Nothing AndAlso ObjPercepciones.Count > 0 Then cfdi.Nomina.Percepciones = ObjPercepciones
If ObjHorasExtras IsNot Nothing AndAlso ObjHorasExtras.Count > 0 Then cfdi.Nomina.HorasExtras = ObjHorasExtras
If ObjOtrosPagos IsNot Nothing AndAlso ObjOtrosPagos.Count > 0 Then cfdi.Nomina.OtrosPagos = ObjOtrosPagos
End If
If DtDeducciones IsNot Nothing AndAlso DtDeducciones.Rows.Count > 0 Then
For Each Row As DataRow In DtDeducciones.Rows
If Row("Importe").ToString().ToDecimal > 0 Then
If Row("CveSATConcepto").ToString() = "" Then cfdi.AddMsg(String.Format("Concepto No registrado ({0})", Row("Concepto").ToString())) : Exit For
If Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 17 Then
ObjPercepciones.Add(New CFDINominaPercepciones With {.TipoPercepcion = Row("SATCveConcepto").ToString(), .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(),
.ImporteGravado = Row("ImporteGravado").ToString().ToDecimal(), .ImporteExento = Row("ImporteExento").ToString().ToDecimal()})
Else
ObjDeducciones.Add(New CFDINominaDeducciones With {.TipoDeduccion = Row("SATCveConcepto").ToString(),
.Clave = Row("Codigo").ToString(),
.Concepto = Row("Concepto").ToString(),
.Importe = Row("Importe").ToString().ToDecimal()}
)
End If
End If
'subsidio al empleo
'If Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 17 AndAlso Row("Importe").ToString().ToDecimal > 0 Then 'Subsidio
' ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = "002", ' codigo fijo, por ser referente a subsidio al empleo
' .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), .Importe = Row("Importe").ToString().ToDecimal})
'End If
Next
End If
If DtOtrosPagos IsNot Nothing AndAlso DtOtrosPagos.Rows.Count > 0 Then
For Each Row As DataRow In DtOtrosPagos.Rows
If (Row("Importe").ToString().ToDecimal() > 0) OrElse (Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 2 AndAlso Row("Importe").ToString().ToDecimal() < 0) Then
If Row("CveSATConcepto").ToString() = "" Then cfdi.AddMsg(String.Format("Concepto No registrado ({0})", Row("Concepto").ToString())) : Exit For
ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = Row("SATCveConcepto").ToString(), .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(),
.Importe = Row("Importe").ToString().ToDecimal().Abs(), .Subsidiocausado = Row("ImporteGravado").ToString().ToDecimal().Abs()})
If Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 7 AndAlso Row("Importe").ToString().ToDecimal > 0 Then 'Subsidio
ObjDeducciones.Add(New CFDINominaDeducciones With {.TipoDeduccion = "002", ' codigo fijo
.Clave = Row("Codigo").ToString(), .Concepto = "ISR", .Importe = Row("Importe").ToString().ToDecimal})
End If
If Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 8 AndAlso Row("Importe").ToString().ToDecimal > 0 Then 'Subsidio
ObjDeducciones.Add(New CFDINominaDeducciones With {.TipoDeduccion = "071", ' codigo fijo
.Clave = Row("Codigo").ToString(), .Concepto = "(Ajuste en Subsidio para el empleo (efectivamente entregado al trabajador)", .Importe = Row("Importe").ToString().ToDecimal})
End If
End If
Next
End If
If ObjPercepciones IsNot Nothing AndAlso ObjPercepciones.Count > 0 Then cfdi.Nomina.Percepciones = ObjPercepciones
If ObjHorasExtras IsNot Nothing AndAlso ObjHorasExtras.Count > 0 Then cfdi.Nomina.HorasExtras = ObjHorasExtras
If ObjOtrosPagos IsNot Nothing AndAlso ObjOtrosPagos.Count > 0 Then cfdi.Nomina.OtrosPagos = ObjOtrosPagos
If ObjIncapacidades IsNot Nothing AndAlso ObjIncapacidades.Count > 0 Then cfdi.Nomina.Incapacidades = ObjIncapacidades
If ObjDeducciones IsNot Nothing AndAlso ObjDeducciones.Count > 0 Then cfdi.Nomina.Deducciones = ObjDeducciones
cfdi.Comprobante.Version = "3.3"
@@ -301,260 +349,4 @@ Public Class LogicNominas
End If
End Function
Private Function PreTimbrar(CveNomina As Integer, CvePersonal As Integer, CvePeriodo As Integer, UsuarioActual As Usuario) As CFDITimbre
Dim cfdi As New CFDITimbre
Dim objPersonal As New ClsRH
Dim objNomina As New ClsNominas
objPersonal.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa)
objNomina.GetNom_Nominas(CveNomina, CvePersonal, CvePeriodo, -1, UsuarioActual.CveEmpresa)
Dim DtPercepciones As Data.DataTable = Nothing
Dim DtDeducciones As Data.DataTable = Nothing
Dim DtOtrosPagos As Data.DataTable = Nothing
Dim TotalPercepciones As Decimal = 0
Dim TotalDeducciones As Decimal = 0
Dim TotalOtrosPagos As Decimal = 0
Dim Total As Decimal = 0
If objNomina.GetNom_NominasDetalles(CveNomina, CvePersonal, CvePeriodo, "-1") Then
If objNomina.DtResultados.Rows.Count > 0 Then
DtPercepciones = objNomina.DtResultados.FiltraParametros("Tipo = 'P' AND EsPadre = 1 ")
DtDeducciones = objNomina.DtResultados.FiltraParametros("Tipo = 'D' AND EsPadre = 1 ")
TotalPercepciones = DtPercepciones.SUM("Importe").ToString().ToDecimal()
TotalDeducciones = DtDeducciones.SUM("Importe").ToString().ToDecimal()
Total = CType((Total + DtPercepciones.SUM("Importe")), Decimal)
End If
End If
'nota. siempre y cuando halla concepto 19
Dim DtHorasExtras As Data.DataTable = Nothing
If objNomina.GetHorasExtras(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa) Then
DtHorasExtras = objNomina.DtResultados
End If
Dim TotalExcento As Decimal = 0
Dim TotalGravado As Decimal = 0
Dim AntiguedadSemanas As Integer = DateDiff(DateInterval.Weekday, objPersonal.FechaIngreso, Now).ToEntero()
Dim FormatoReciboCFDi As String = objPersonal.FormatoReciboCFDi
Dim FechaInicio, FechaFin, FechaPago As Date
Dim DiasPagados As Integer = 0
Dim Msg As String = String.Empty
Dim DiasIncapacitados As Integer = 0
Dim DrPeriodo As DataRow = Nothing
If objNomina.GetPeriodos(-1, UsuarioActual.CveEmpresa, -1, -1, CvePeriodo) Then
If objNomina.DtResultados.Rows().Count > 0 Then
DrPeriodo = objNomina.DtResultados.Rows(0)
End If
End If
'Dim DrPeriodo As DataRow = GlobalDTNominasPeriodos(-1, CvePeriodo, -1).FiltroPrimero("")
If DrPeriodo IsNot Nothing Then
FechaInicio = DrPeriodo("FechaInicio").ToString().ToDate
FechaFin = DrPeriodo("FechaFin").ToString().ToDate
FechaPago = DrPeriodo("FechaPago").ToString().ToDate
If objPersonal.GetAsistencias(CvePersonal, -1, -1, -1, -1, -1, FechaInicio, FechaFin, UsuarioActual.CveEmpresa) Then
Dim Asistencias As Integer = objPersonal.DtResultados.SUM("AplicaAsistencia").ToEntero()
Dim Vacaciones As Integer = objPersonal.DtResultados.SUM("AplicaVacacion").ToEntero()
DiasIncapacitados = objPersonal.DtResultados.SUM("AplicaIncapacidad").ToEntero()
DiasPagados = Asistencias - Vacaciones
If DiasPagados < 0 Then DiasPagados = 0
End If
End If
'Tipo Nomina O de Ordinaria o E de extraordinaria
'Dim FechaPago As Date = Now
Dim TotalSueldos As Decimal = 0
Dim TotalIndemnizacion As Decimal = 0
Dim TotalJubilacion As Decimal = 0
cfdi.Nomina = New CFDINomina
cfdi.Nomina.Version = "1.2"
cfdi.Nomina.TipoNomina = If(objNomina.CveTipoPeriodo = 6, "E", "O")
cfdi.Nomina.FechaPago = FechaPago
cfdi.Nomina.FechaInicio = FechaInicio.ToString()
cfdi.Nomina.FechaFin = FechaFin.ToString()
cfdi.Nomina.NumDiasPagados = DiasPagados
cfdi.Emisor.Nombre = UsuarioActual.Empresa.Empresa
cfdi.Emisor.RFC = UsuarioActual.Empresa.RFC
cfdi.Emisor.RegistroPatronal = UsuarioActual.Empresa.RegistroPatronal
cfdi.Emisor.RegimenFiscal = UsuarioActual.Empresa.CodigoRegimenFiscal
'aplica persona fisica debe de tener CURP
If cfdi.Emisor.RegimenFiscal.Contiene("605", "606", "608", "611", "612", "614", "616", "621", "622", "629", "630", "615") Then
cfdi.Emisor.CURP = UsuarioActual.Empresa.CURP
End If
cfdi.Nomina.CveNomina = CveNomina
cfdi.Receptor.UsoCFDI = "P01"
cfdi.Receptor.RFC = objPersonal.RFC
cfdi.Receptor.Nombre = objPersonal.NombreCompleto
If DtPercepciones IsNot Nothing Then
If DtPercepciones.Rows.Count > 0 Then
Dim ObjPercepciones As New List(Of CFDINominaPercepciones)
Dim ObjHorasExtras As New List(Of CFDINominaHorasExtras)
Dim ObjOtrosPagos As New List(Of CFDINominaOtrosPagos)
For Each Row As DataRow In DtPercepciones.Rows
If Row("Importe").ToString().ToDecimal > 0 AndAlso Row("SATCveConcepto").ToString().ToEntero() <> 17 Then
If Row("CveSATConcepto").ToString() = "" Then cfdi.AddMsg(String.Format("Concepto No registrado ({0})", Row("Concepto").ToString())) : Exit For
ObjPercepciones.Add(New CFDINominaPercepciones With {.TipoPercepcion = Row("SATCveConcepto").ToString(),
.Clave = Row("Codigo").ToString(),
.Concepto = Row("Concepto").ToString(),
.ImporteGravado = Row("ImporteGravado").ToString().ToDecimal,
.ImporteExento = Row("ImporteExento").ToString().ToDecimal}
)
End If
'RMF, falta poner el numero de horas pagadas
If Row("CveSATConcepto").ToString().ToEntero() = 19 Then 'cuando son horas extras
'Obtengo el desglose de horas extras
If DtHorasExtras IsNot Nothing Then
Dim dr As DataRow = DtHorasExtras.FiltroPrimero("")
If dr IsNot Nothing Then
If dr("HorasDobles").ToString().ToDouble > 0 Then ObjHorasExtras.Add(New CFDINominaHorasExtras With {.Dias = dr("DiasHorasDobles").ToString().ToEntero().ToString(), .TipoHoras = "01", .HorasExtra = dr("HorasDobles").ToString().ToEntero(), .ImportePagado = Row("Importe").ToString().ToDecimal})
If dr("HorasTriples").ToString().ToDouble > 0 Then ObjHorasExtras.Add(New CFDINominaHorasExtras With {.Dias = dr("DiasHorasTriples").ToString().ToEntero().ToString(), .TipoHoras = "02", .HorasExtra = dr("HorasTriples").ToString().ToEntero(), .ImportePagado = Row("Importe").ToString().ToDecimal})
End If
End If
End If
'subsidio al empleo
If Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 17 AndAlso Row("Importe").ToString().ToDecimal > 0 Then 'Subsidio
ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = "002", ' codigo fijo, por ser refernte a subsidio al empleo
.Clave = Row("Codigo").ToString(),
.Concepto = Row("Concepto").ToString(),
.Importe = Row("Importe").ToString().ToDecimal}
)
End If
Next
If ObjPercepciones IsNot Nothing AndAlso ObjPercepciones.Count > 0 Then cfdi.Nomina.Percepciones = ObjPercepciones
If ObjHorasExtras IsNot Nothing AndAlso ObjHorasExtras.Count > 0 Then cfdi.Nomina.HorasExtras = ObjHorasExtras
If ObjOtrosPagos IsNot Nothing AndAlso ObjOtrosPagos.Count > 0 Then cfdi.Nomina.OtrosPagos = ObjOtrosPagos
End If
End If
'cargo las incapacidades
If DiasIncapacitados > 0 Then
If objNomina.GetIncapacidades(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa) Then
If objNomina.DtResultados IsNot Nothing AndAlso objNomina.DtResultados.Rows.Count > 0 Then
Dim ObjIncapacidades As New List(Of CFDINominaIncapacidades)
For Each dr As DataRow In objNomina.DtResultados.Rows
ObjIncapacidades.Add(New CFDINominaIncapacidades With {.DiasIncapacidad = dr("Dias").ToString().ToEntero().ToString(), .TipoIncapacidad = dr("ClaveTipoIncapacidad").ToString(), .Importe = dr("Descuento").ToString().ToDecimal})
Next
If ObjIncapacidades IsNot Nothing AndAlso ObjIncapacidades.Count > 0 Then cfdi.Nomina.Incapacidades = ObjIncapacidades
End If
End If
End If
TotalExcento = 0
TotalGravado = 0
If DtDeducciones IsNot Nothing Then
If DtDeducciones.Rows.Count > 0 Then
Dim ObjDeducciones As New List(Of CFDINominaDeducciones)
For Each Row As DataRow In DtDeducciones.Rows
If Row("Importe").ToString().ToDecimal > 0 Then
If Row("CveSATConcepto").ToString() = "" Then cfdi.AddMsg(String.Format("Concepto No registrado ({0})", Row("Concepto").ToString())) : Exit For
ObjDeducciones.Add(New CFDINominaDeducciones With {.TipoDeduccion = Row("SATCveConcepto").ToString(),
.Clave = Row("Codigo").ToString(),
.Concepto = Row("Concepto").ToString(),
.Importe = Row("Importe").ToString().ToDecimal}
)
End If
Next
If ObjDeducciones IsNot Nothing AndAlso ObjDeducciones.Count > 0 Then cfdi.Nomina.Deducciones = ObjDeducciones
End If
End If
'If DtOtrosPagos IsNot Nothing Then
' If DtOtrosPagos.Rows.Count > 0 Then
' ' Total = CType((Total - DtOtrosPagos.SUM("Importe")), Decimal)
' Dim ObjOtrosPagos As New List(Of CFDINominaOtrosPagos)
' ' End If
' ' For Each Row As DataRow In DtOtrosPagos.Rows
' ' If Row("Importe").ToString().ToDecimal > 0 Then
' ' If Row("CveSATConcepto").ToString() = "" Then
' ' Msg = String.Format("Concepto No registrado ({0})", Row("Concepto").ToString())
' ' Else
' ' Msg = cfdi.ObjCompNomina12.AgregarOtroPago(Row("SATCveConcepto").ToString(), Row("Codigo").ToString(), Row("Concepto").ToString(), 0)
' ' 'Msg = CFDi.ObjCompNomina12.CargarSubsidioAlEmpleo(0)
' ' 'Msg = CFDi.ObjCompNomina12.CargarCompensacionSaldosAFavor(0, 0, 0)
' ' End If
' ' If Msg <> String.Empty Then
' ' Me.OnError("El SAT regresó el siguiente mensaje: " & Msg & ". Objeto: Otros Pagos", New Exception)
' ' Exit For
' ' End If
' ' End If
' ' Next
' If ObjOtrosPagos IsNot Nothing AndAlso ObjOtrosPagos.Count > 0 Then cfdi.Nomina.OtrosPagos = ObjOtrosPagos
' End If
'End If
cfdi.Comprobante.Version = "3.3"
cfdi.Comprobante.Serie = objNomina.Serie
cfdi.Comprobante.Folio = objNomina.Folio.ToString()
cfdi.Comprobante.Fecha = Now
cfdi.Comprobante.Subtotal = cfdi.Nomina.TotalPercepciones.ToString().ToDecimal() + cfdi.Nomina.TotalOtrosPagos.ToString().ToDecimal()
cfdi.Comprobante.Descuentos = cfdi.Nomina.TotalDeducciones.ToString().ToDecimal()
cfdi.Comprobante.Total = cfdi.Comprobante.Subtotal - cfdi.Comprobante.Descuentos 'cfdi.Nomina.TotalPercepciones + cfdi.Nomina.TotalOtrosPagos - cfdi.Nomina.TotalDeducciones
cfdi.Comprobante.MotivoDescuento = "" '"Deducciones nómina"
cfdi.Comprobante.Moneda = "MXN"
cfdi.Comprobante.TipoComprobante = "N"
cfdi.Comprobante.TipoDocto = "Egs"
cfdi.Comprobante.MetodoPago = "PUE"
cfdi.Comprobante.CondicionesdePago = "" '"CONTADO"
cfdi.Comprobante.FormadePago = "99"
cfdi.Comprobante.LugarExpedicion = UsuarioActual.Empresa.CP.ToString() ' AHORITA SOLO SE REQUIERE ESPECIFICAR EL CODIGO POSTAL
cfdi.Comprobante.NumCuentaPago = "" 'objPersonal.BancoNumCuenta
cfdi.Nomina.Receptor.CURP = objPersonal.CURP
cfdi.Nomina.Receptor.NSS = objPersonal.NumeroSS
cfdi.Nomina.Receptor.FechaInicioContrato = objPersonal.FechaInicioContrato.ToString()
cfdi.Nomina.Receptor.Antiguedad = $"P{AntiguedadSemanas}W"
cfdi.Nomina.Receptor.TipoContrato = objPersonal.CodigoTipoContrato
cfdi.Nomina.Receptor.CodigoTipoJornada = objPersonal.ClaveTipoJornada
cfdi.Nomina.Receptor.CodigoRegimenContratacion = objPersonal.CveRegimenContratacion
cfdi.Nomina.Receptor.CodigoEmpleado = objPersonal.Codigo
cfdi.Nomina.Receptor.Departamento = objPersonal.Departamento
cfdi.Nomina.Receptor.Puesto = objPersonal.Puesto
cfdi.Nomina.Receptor.CodigoRiesgoPuesto = objPersonal.CveSATRiesgoPuesto.ToString()
cfdi.Nomina.Receptor.TipoPeriodo = objPersonal.TipoPeriodoPago
cfdi.Nomina.Receptor.CodigoBanco = objPersonal.ClaveBanco
cfdi.Nomina.Receptor.NumeroCuenta = objPersonal.BancoNumCuenta
cfdi.Nomina.Receptor.SDI = objPersonal.SDI
cfdi.Nomina.Receptor.SBC = objPersonal.SDI
cfdi.Nomina.Receptor.Sindicalizado = ""
cfdi.Nomina.Receptor.CodigoEntidadFederativa = objPersonal.ClaveEstado
cfdi.Conceptos.Add(New CFDIConceptos With {.Cantidad = 1, .ClaveUnidad = "ACT", .ClaveProdServ = "84111505", .Descripcion = "Pago de nómina", .ValorUnitario = cfdi.Comprobante.Subtotal, .Importe = cfdi.Comprobante.Subtotal, .Descuento = cfdi.Nomina.TotalDeducciones.ToString().ToDecimal()})
objPersonal.Dispose()
objNomina.Dispose()
Return cfdi
End Function
End Class

View File

@@ -6094,6 +6094,8 @@ Namespace Modelos
Public Property CveTipoRetencion As Integer
Public Property VentaDesglosaIEPS As Boolean
#End Region

View File

@@ -2048,7 +2048,7 @@ Public Class Timbrado
For Each otpag As CFDINominaOtrosPagos In ObjCFDITimbre.Nomina.OtrosPagos
cfdi.Nomina12OtroPago(otpag.TipoOtroPago, otpag.Clave, otpag.Concepto, otpag.Importe)
If otpag.TipoOtroPago = "002" Then
cfdi.Nomina12SubsidioAlEmpleo(otpag.Importe)
cfdi.Nomina12SubsidioAlEmpleo(otpag.Subsidiocausado)
End If
Next
@@ -2895,10 +2895,10 @@ Public Class Timbrado
Nom.OtrosPagos(i).TipoOtroPago = otpag.TipoOtroPago
Nom.OtrosPagos(i).Clave = otpag.Clave
Nom.OtrosPagos(i).Concepto = otpag.Concepto
Nom.OtrosPagos(i).Importe = otpag.Importe.ToDecimal
Nom.OtrosPagos(i).Importe = otpag.Importe
If otpag.TipoOtroPago = "002" Then
Nom.OtrosPagos(i).SubsidioAlEmpleo = New Profact.TimbraCFDI33.Complementos.Nomina12.NominaOtroPagoSubsidioAlEmpleo()
Nom.OtrosPagos(i).SubsidioAlEmpleo.SubsidioCausado = otpag.Importe.ToDecimal
Nom.OtrosPagos(i).SubsidioAlEmpleo.SubsidioCausado = otpag.Importe
End If
i += 1
Next

View File

@@ -52,7 +52,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Case "sendMail"
context.Response.Write(sendMail(context))
Case "sendMailLPM"
context.Response.Write(sendMail(context))
context.Response.Write(sendMailLPM(context))
End Select
Catch ex As Exception

View File

@@ -23,17 +23,16 @@
<asp:UpdatePanel ID="UPPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" CssClass="btn btn-primary" />
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="portlet-body">
<div class="titlefiltros caption ">
<div class="row">
<label class="col-md-2 truncate" style="width: 110px;">Cuenta de Caja:</label>
<label class="col-md-1 truncate" style="width: 110px;">Cuenta:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlCajaChica" runat="server" AppendDataBoundItems="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
</asp:DropDownList>
@@ -43,7 +42,7 @@
<label class="col-md-1 truncate" style="width: 40px;">F.I.:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 140px !important;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="80px"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
@@ -58,7 +57,7 @@
<label class="col-md-1 truncate" style="width: 40px;">F.F.:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 140px !important;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="80px"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
@@ -76,13 +75,24 @@
<asp:ListItem Value="-1" Text="Todos"></asp:ListItem>
<asp:ListItem Value="13" Text="Efectivo"></asp:ListItem>
<asp:ListItem Value="3" Text="Cheque"></asp:ListItem>
<asp:ListItem Value="11" Text="Tarjeta de Debito"></asp:ListItem>
<asp:ListItem Value="12" Text="Tarjeta de Crédito"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
<div class="portlet-body" style="display: none">
<div class="row">
<label class="col-md-1 truncate" style="width: 100px;">SubProyecto:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlSubProyectos" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
</asp:DropDownList>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>

View File

@@ -19,6 +19,8 @@ Partial Class Bancos_DepositosCaja
If Not IsPostBack Then
FacturasCheckadas = 0
TxtFecha.Text = Now.ToShortDateString
txtFechaI.Text = Now.AddDays(-1).ToShortDateString
txtFechaF.Text = Now.ToShortDateString
CargaCuentas()
End If
End Sub
@@ -29,6 +31,10 @@ Partial Class Bancos_DepositosCaja
DdlCajaChica.DataSource = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"})
DdlCajaChica.DataBind()
DdlSubProyectos.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveEmpresa, -1, UsuarioActual.CveEmpresa)
DdlSubProyectos.DataBind()
DdlSubProyectos.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
@@ -41,7 +47,7 @@ Partial Class Bancos_DepositosCaja
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1")
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
ObjBancos.GetPagosCajaChica(FechaI, FechaF, UsuarioActual.CveEmpresa, DdlCajaChica.SelectedValue.ToEntero, DdlTipoPago.SelectedValue.ToEntero)
ObjBancos.GetPagosCajaChica(FechaI, FechaF, UsuarioActual.CveEmpresa, DdlCajaChica.SelectedValue.ToEntero, DdlTipoPago.SelectedValue.ToEntero, CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero)
GvFacturas.DataSource = ObjBancos.DtResultados
ObjBancos.Dispose()

View File

@@ -149,13 +149,7 @@
<asp:TextBox ID="TxtConceptoFluctuacion" runat="server"></asp:TextBox>
</div>
<div class="col-md-2" style="width: 80px;" runat="server" id="LiSubProyectoLbl">
<asp:Label runat="server" ID="LblSubProyecto"></asp:Label>
</div>
<div class="col-md-1 " runat="server" id="LiSubProyectoDdl">
<asp:DropDownList ID="DdlSubproyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" Style="max-width: 200px !important;">
</asp:DropDownList>
</div>
</div>
</div>
@@ -230,10 +224,25 @@
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div style="float: right; margin-right: 50px;">
<asp:Button Text="Generar Proveedores" runat="server" ID="BtnGeneraCompras" OnClick="BtnGeneraCompras_Click" Style="margin-left: 30px;" class="btn btn-primary" />
<br />
<div class="row">
<div class="col-md-6" style="text-align: left!important">
<asp:Label runat="server" ID="LblSubProyectoCompras"></asp:Label>
<asp:DropDownList ID="DdlSubProyectoCompras" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" Style="max-width: 200px !important;">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlSubProyectoCompras" runat="server" ControlToValidate="DdlSubProyectoCompras" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarCompras"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCDdlSubProyectoCompras" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlSubProyectoCompras" Width="300px" BehaviorID="_content_VCOTipoActivoFijo"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-6" style="text-align: right!important">
<asp:Button Text="Generar Proveedores" runat="server" ID="BtnGeneraCompras" OnClick="BtnGeneraCompras_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarCompras" />
</div>
</div>
<br />
<br />
<asp:GridView ID="GvCompras" Width="99%" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveCompra,CveProveedor,Fluctuacion,SerieFolio,FluctuacionTotal,PerdidaGanancia"
@@ -309,11 +318,27 @@
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div style="float: right; margin-right: 50px;">
<asp:Button Text="Generar Clientes" runat="server" ID="BtnGeneraVentas" OnClick="BtnGeneraVentas_Click" Style="margin-left: 30px;" class="btn btn-primary" />
<br />
<div class="row">
<div class="col-md-6" style="text-align: left!important">
<asp:Label runat="server" ID="LblSubProyectoVentas"></asp:Label>
<asp:DropDownList ID="DdlsubProyectoVentas" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" Style="max-width: 200px !important;">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlsubProyectoVentas" runat="server" ControlToValidate="DdlsubProyectoVentas" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarVentas"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="CEDdlsubProyectoVentas" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlsubProyectoVentas" Width="300px" BehaviorID="_content_VCOTipoActivoFijo"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-6" style="text-align: right!important">
<asp:Button Text="Generar Clientes" runat="server" ID="BtnGeneraVentas" OnClick="BtnGeneraVentas_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarVentas" />
</div>
</div>
<br />
<br />
<br />
<asp:GridView ID="GvVentas" Width="99%" runat="server" AutoGenerateColumns="False"
DataKeyNames="TipoCambio,Fluctuacion,CveVenta,SerieFolio,CveIE" EmptyDataText="No se Encontraron Cuentas Bancarias."
ToolTip="Listado de Cuentas Bancarias" CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
@@ -333,10 +358,24 @@
</ajax:TabPanel>
<ajax:TabPanel runat="server" ID="TabCuentasBancarias" HeaderText="Cuentas Bancarias">
<ContentTemplate>
<div style="float: right; margin-right: 50px;">
<asp:Button Text="Generar Bancos" runat="server" ID="BtnGeneraBancos" OnClick="BtnGeneraBancos_Click" Style="margin-left: 30px;" class="btn btn-primary" />
<br />
<div class="row">
<div class="col-md-6" style="text-align: left!important">
<asp:Label runat="server" ID="LblSubProyecto"></asp:Label>
<asp:DropDownList ID="DdlSubproyectoBancos" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" Style="max-width: 200px !important;">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlSubproyectoBancos" runat="server" ControlToValidate="DdlSubproyectoBancos" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarBancos"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCRFVDdlSubproyectoBancos" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlSubproyectoBancos" Width="300px" BehaviorID="_content_VCOTipoActivoFijo"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-6" style="text-align: right!important">
<asp:Button Text="Generar Bancos" runat="server" ID="BtnGeneraBancos" OnClick="BtnGeneraBancos_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarBancos" />
</div>
</div>
<br />
<br />
<asp:GridView ID="GvCuentas" Width="99%" runat="server" AutoGenerateColumns="False"
DataKeyNames="IdCtaAfectable,IdCtaContable,IdCtaContableComplementaria,TipoCambio,Fluctuacion,
@@ -361,11 +400,29 @@
</ajax:TabPanel>
<ajax:TabPanel runat="server" ID="TabDeudores" HeaderText="Deudores">
<ContentTemplate>
<div style="float: right; margin-right: 50px;">
<asp:Button Text="Generar Deudores" runat="server" ID="BtnGeneraDedudores" OnClick="BtnGeneraDedudores_Click" Style="margin-left: 30px;" class="btn btn-primary" />
</div>
<br />
<br />
<br />
<div class="row">
<div class="col-md-6" style="text-align: left!important">
<asp:Label runat="server" ID="LblSubProyectoDeudores"></asp:Label>
<asp:DropDownList ID="DdlSubProyectoDeudores" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" Style="max-width: 200px !important;">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlSubProyectoDeudores" runat="server" ControlToValidate="DdlSubProyectoDeudores" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarDeudores"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="CEDdlSubProyectoDeudores" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlSubProyectoDeudores" Width="300px" BehaviorID="_content_VCOTipoActivoFijo"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-6" style="text-align: right!important">
<asp:Button Text="Generar Deudores" runat="server" ID="BtnGeneraDedudores" OnClick="BtnGeneraDedudores_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarDeudores" />
</div>
</div>
<br />
<asp:GridView ID="GvDeudores" Width="99%" runat="server" AutoGenerateColumns="False"
DataKeyNames="IdCtaAfectable,TipoCambio,Fluctuacion,RazonSocial,CveIE"
EmptyDataText="No se Encontraron Cuentas Bancarias." ToolTip="Listado de Cuentas Bancarias"
@@ -383,13 +440,26 @@
<asp:Label ID="LblTotalDeudores" runat="server" Text=""></asp:Label>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel runat="server" ID="TabAcreedores" HeaderText="Compras Acreedores">
<ContentTemplate>
<div style="float: right; margin-right: 50px;">
<asp:Button Text="Generar Acreedores" runat="server" ID="BtnGeneraAcreedores" OnClick="BtnGeneraAcreedores_Click" Style="margin-left: 30px;" class="btn btn-primary" />
</div>
<br />
<br />
<br />
<div class="row">
<div class="col-md-6" style="text-align: left!important">
<asp:Label runat="server" ID="LblSubProyectoAcreedores"></asp:Label>
<asp:DropDownList ID="DdlSubProyectoAcreedores" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" Style="max-width: 200px !important;">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlSubProyectoAcreedores" runat="server" ControlToValidate="DdlSubProyectoAcreedores" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarAcreedores"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="CEDdlSubProyectoAcreedores" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlSubProyectoAcreedores" Width="300px" BehaviorID="_content_VCOTipoActivoFijo"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-6" style="text-align: right!important">
<asp:Button Text="Generar Acreedores" runat="server" ID="BtnGeneraAcreedores" OnClick="BtnGeneraAcreedores_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarAcreedores" />
</div>
</div>
<br />
<asp:GridView ID="GvAcreedores" Width="99%" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveCompra,CveProveedor,Fluctuacion,SerieFolio"
EmptyDataText="No se Encontraron compras pendientes de pagar." ToolTip="Listado de Compras"
@@ -408,11 +478,30 @@
</ajax:TabPanel>
<ajax:TabPanel runat="server" ID="TabFilial" HeaderText="Filial">
<ContentTemplate>
<br />
<div class="row">
<div class="col-md-6" style="text-align: left!important">
<asp:Label runat="server" ID="LblSubProyectoFiliales"></asp:Label>
<asp:DropDownList ID="DdlSubProyectoFiliales" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" Style="max-width: 200px !important;">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlSubProyectoFiliales" runat="server" ControlToValidate="DdlSubProyectoFiliales" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarFiliales"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="CEDdlSubProyectoFiliales" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlSubProyectoFiliales" Width="300px" BehaviorID="_content_VCOTipoActivoFijo"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-6" style="text-align: right!important">
<asp:Button Text="Generar Filiales" runat="server" ID="BtnGeneraFiliales" OnClick="BtnGeneraFiliales_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarFiliales" />
</div>
</div>
<br />
<div style="float: right; margin-right: 50px;">
<asp:Button Text="Generar Filiales" runat="server" ID="Button1" OnClick="BtnGeneraFiliales_Click" Style="margin-left: 30px;" class="btn btn-primary" />
</div>
<br />
<br />
<asp:GridView ID="GvFiliales" Width="99%" runat="server" AutoGenerateColumns="False"
DataKeyNames="IdCtaAfectable,TipoCambio,Fluctuacion,RazonSocial,CveIE,Folio"
EmptyDataText="No se Encontraron Cuentas Bancarias." ToolTip="Listado de Cuentas Bancarias"

View File

@@ -4,8 +4,8 @@ Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Bancos_FluctuacionCambiaria
Inherits ClsPaginas
Inherits ClsPaginas
#Region "PROPIEDADES"
Private Property LblTotal() As String
Get
@@ -14,18 +14,25 @@ Partial Class Bancos_FluctuacionCambiaria
Set(value As String)
ViewState("Total") = value
End Set
End Property
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargarCentrosDeCosto(Nothing, DdlSubproyecto, Nothing, LblSubProyecto)
If Not Page.IsPostBack Then
CargarCentrosDeCosto(Nothing, DdlSubproyectoBancos, Nothing, LblSubProyecto)
CargarCentrosDeCosto(Nothing, DdlsubProyectoVentas, Nothing, LblSubProyectoVentas)
CargarCentrosDeCosto(Nothing, DdlSubProyectoCompras, Nothing, LblSubProyectoCompras)
CargarCentrosDeCosto(Nothing, DdlSubProyectoFiliales, Nothing, LblSubProyectoFiliales)
CargarCentrosDeCosto(Nothing, DdlSubProyectoAcreedores, Nothing, LblSubProyectoAcreedores)
CargarCentrosDeCosto(Nothing, DdlSubProyectoDeudores, Nothing, LblSubProyectoDeudores)
CargaUltimaFluctuacion()
End If
End Sub
End Sub
#Region "CARGAS"
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
CargaTipoCambio()
If T.ActiveTabIndex = 0 Then CargaDatosCompra()
@@ -227,15 +234,15 @@ Partial Class Bancos_FluctuacionCambiaria
Protected Sub BtnGeneraCompras_Click(sender As Object, e As EventArgs)
If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
' Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
Conta.IniciaTransacSQL()
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/Fluctua", 1, 0, 0, 1, TxtFecha.Text.ToDate, "Fluctuación", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaC", 1, 0, 0, 1, TxtFecha.Text.ToDate, "Fluctuación", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim idCta As Integer = 0
Dim CveCuenta As Integer = 0
Dim CveCuentaPerdida, CveCuentaGanancia As Integer
@@ -267,7 +274,7 @@ Partial Class Bancos_FluctuacionCambiaria
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero) Then
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Compras", CveConceptoContable, "Fluctuación Compras", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubProyectoCompras.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
@@ -301,16 +308,16 @@ Partial Class Bancos_FluctuacionCambiaria
Protected Sub BtnGeneraVentas_Click(sender As Object, e As EventArgs)
If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'If DdlsubProyectoVentas.SelectedValue.ToEntero < 0 Then
' Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
Conta.IniciaTransacSQL()
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/Fluctua", 1, 0, 0, 1, TxtFecha.Text.ToDate, "Fluctuación", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaV", 1, 0, 0, 1, TxtFecha.Text.ToDate, "Fluctuación Ventas", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim idCta As Integer = 0
Dim CveCuenta As Integer = 0
Dim CveCuentaPerdida, CveCuentaGanancia As Integer
@@ -339,11 +346,12 @@ Partial Class Bancos_FluctuacionCambiaria
idCta = idCtaPerdida
TipoMovto = False
End If
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
Dim CveConconceptoCliente As Integer = 203
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Ventas", CveConceptoContable, "Fluctuación Ventas", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlsubProyectoVentas.SelectedValue.ToEntero) Then
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Ventas", CveConceptoContable, "Fluctuación Ventas", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlsubProyectoVentas.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
Dim CveConconceptoCliente As Integer = 203
'saco las cuentas de pérdida y ganancia
For Each gvr As GridViewRow In GvVentas.Rows
@@ -379,17 +387,17 @@ Partial Class Bancos_FluctuacionCambiaria
Protected Sub BtnGeneraBancos_Click(sender As Object, e As EventArgs)
If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'If DdlSubproyectoBancos.SelectedValue.ToEntero < 0 Then
' Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
Conta.IniciaTransacSQL()
Dim ObjContPaq As New ClsContPAQi(UsuarioActual.Empresa)
ObjContPaq.IniciaTransacSQL()
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/Fluctua", 1, 0, 0, 1, TxtFecha.Text.ToDate, "Fluctuación", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaB", 1, 0, 0, 1, TxtFecha.Text.ToDate, "Fluctuación Bancaria", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim idCta As Integer = 0
Dim CveCuenta As Integer = 0
Dim CveCuentaPerdida, CveCuentaGanancia As Integer
@@ -440,7 +448,7 @@ Partial Class Bancos_FluctuacionCambiaria
Exit For
End If
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero) Then
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), ConceptoReferencia, CveConceptoContable, ConceptoReferencia, Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyectoBancos.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
End If
@@ -478,10 +486,10 @@ Partial Class Bancos_FluctuacionCambiaria
Protected Sub BtnGeneraDedudores_Click(sender As Object, e As EventArgs)
If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'If DdlSubProyectoDeoudores.SelectedValue.ToEntero < 0 Then
' Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
@@ -523,7 +531,7 @@ Partial Class Bancos_FluctuacionCambiaria
idCta = idCtaPerdida
TipoMovto = False
End If
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, ConceptoFluctuacion, Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero) Then
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), ConceptoFluctuacion, CveConceptoContable, ConceptoFluctuacion, Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubProyectoDeudores.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
@@ -557,10 +565,10 @@ Partial Class Bancos_FluctuacionCambiaria
Protected Sub BtnGeneraFiliales_Click(sender As Object, e As EventArgs)
If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
' Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
@@ -606,7 +614,7 @@ Partial Class Bancos_FluctuacionCambiaria
idCta = idCtaPerdida
TipoMovto = False
End If
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, ConceptoFluctuacion, Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero) Then
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), ConceptoFluctuacion, CveConceptoContable, ConceptoFluctuacion, Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubProyectoFiliales.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
@@ -658,15 +666,11 @@ Partial Class Bancos_FluctuacionCambiaria
Protected Sub BtnGeneraAcreedores_Click(sender As Object, e As EventArgs)
If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
Conta.IniciaTransacSQL()
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/Fluctua", 1, 0, 0, 1, TxtFecha.Text.ToDate, "Fluctuación", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaA", 1, 0, 0, 1, TxtFecha.Text.ToDate, "Fluctuación", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim idCta As Integer = 0
Dim CveCuenta As Integer = 0
Dim CveCuentaPerdida, CveCuentaGanancia As Integer
@@ -696,7 +700,7 @@ Partial Class Bancos_FluctuacionCambiaria
idCta = idCtaPerdida
TipoMovto = False
End If
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero) Then
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Acreedores", CveConceptoContable, "Fluctuación Acreedores", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubProyectoAcreedores.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
@@ -936,9 +940,9 @@ Partial Class Bancos_FluctuacionCambiaria
End If
End If
End Sub
End Sub
#End Region
End Class

View File

@@ -3626,7 +3626,7 @@ Partial Class Bancos_IE
TipoMovimiento = False
End If
If CveConceptoCompra = 10 AndAlso DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then
If CveConceptoCompra = 10 AndAlso DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsaComplementariaBancos Then
IDCtaBeneficiario = IdCtaAnticipoExtranjera
CveCuentaConta = 0
End If
@@ -3634,7 +3634,7 @@ Partial Class Bancos_IE
'MOVIMIENTOS EGRESOS
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtImporte.Text.ToDecimal, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaConta, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then
Dim IVA As Decimal = 0 ' TxtImporte.Text.ToDouble * HdnProvPorIVA.Value.ToDouble
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, TxtImporte.Text.ToDecimal - IVA - CIF, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=tImporteMonedaExtranjera, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario, CveIEDevolucion:=DdlIEAcreedor.SelectedValue.ToEntero) Then
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, TxtImporte.Text.ToDecimal - IVA - CIF, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=If(UsaComplementariaBancos, TxtImporte.Text.ToDecimal, tImporteMonedaExtranjera), ImporteME:=TxtImporte.Text.ToDecimal, CveCuenta:=CveCuentaBeneficiario, CveIEDevolucion:=DdlIEAcreedor.SelectedValue.ToEntero) Then
If IVA > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, IVA, Ref, 19, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then
MsgError = "Detalle"
End If

View File

@@ -5045,7 +5045,7 @@ Partial Class Compras_Compras
'ACTUALIZAR PRODUCTO/SERVICIO SAT
If Version = "3.3" Then
If Not ObjProductosServicios.UpdateProductosServiciosSAT(Row("CvePS").ToString().ToEntero(), Row("CveSATPS").ToString().ToEntero(), UsuarioActual.CveUsuario) Then
If Not ObjProductosServicios.UpdateProductosServiciosSAT(Row("CvePS").ToString().ToEntero(), Row("CveSATPS").ToString().ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
ErrorSATPS = True
End If
End If
@@ -15051,13 +15051,11 @@ Partial Class Compras_Compras
End If
'SI PUEDE RECIBIR POR OC Y COMPRA
If UsuarioActual.CveEmpresa.Contiene(119) Then
If UsuarioActual.Empresa.UsaInventarios And UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 And Not UsuarioActual.Empresa.Funcionalidad(153).ToEntero > 0 Then
DivOCVinculaInv.Visible = True
End If
' si usa almacen, si tiene activado que reciba por OC, y que si la compra tipo Proveedor. que lo muestre
If UsuarioActual.Empresa.UsaInventarios And UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 AndAlso CveTipoConcepto = 1 Then
DivOCVinculaInv.Visible = True
End If
'TIPO CAMBIO
If CveCompra > 0 Then
DivTipoCambioOC.Visible = False
@@ -16007,6 +16005,46 @@ Partial Class Compras_Compras
End Sub
Public Sub CargaIndirectosServicios()
If DtServicios Is Nothing Then CreaDTServicios()
DtServicios.Rows.Clear()
Dim objps As New ClsProductosServicios
Dim dr As DataRow
dvFacturas.Visible = False
GvFacturas.Visible = False
For Each DrGv As DataRow In TmpDT.Rows
If DrGv("CvePS").ToString.ToEntero > 0 Then
If objps.GetPS(DrGv("CvePS").ToString.ToEntero, -1, UsuarioActual.CveEmpresa) Then
If objps.DtResultados(0)("CveTipoPS").ToString.ToEntero = 1 Then
dr = DtServicios.NewRow()
dr("Consec") = DrGv("Consec").ToString.ToEntero
dr("Total") = DrGv("Total").ToString.ToDecimal
dr("CvePS") = DrGv("CvePS").ToString.ToEntero
dr("PS") = DrGv("PS").ToString
DtServicios.Rows.Add(dr)
End If
End If
End If
Next
objps.Dispose()
If DtServicios.Rows.Count > 0 Then
GVServicios.DataSource = DtServicios
GVServicios.DataBind()
GVServicios.Visible = True
Else
GVServicios.DataSource = Nothing
GVServicios.DataBind()
End If
UpGVServicios.Update()
UpFacturas.Update()
UPGVFacturas.Update()
End Sub
Public Sub btnAgregarFlete_Click(sender As Object, e As EventArgs) Handles BtnAgregarFlete.Click
Dim ListaConsecutivas As New List(Of String) 'Almacena los consecutivos que pertenecen al almacen
@@ -16059,7 +16097,7 @@ Partial Class Compras_Compras
''Marcamos todos los almacenes como check
'GvInv.HeaderRow.FCCheckBox("cbAll").Checked = True
'cbAll_CheckedChanged(Nothing, Nothing)
RegistraScript("$('#ModalFletesImportaciones').modal('hide');")
End Sub
Private Sub CargaGastosServicios(CvePS As Integer)
@@ -18200,7 +18238,7 @@ Partial Class Compras_Compras
CvePS = DdlPSAlias2.SelectedValue.ToEntero
tPS = DdlPSAlias2.SelectedText
If PS.AddPSAlias(System.Web.HttpUtility.HtmlDecode(TxtPSAlias.Text.Trim), CvePS) Then
If PS.AddPSAlias(System.Web.HttpUtility.HtmlDecode(TxtPSAlias.Text.Trim), CvePS, UsuarioActual.CveUsuario) Then
GlobalDTProductosServiciosAlias(-1) = PS.DtResultados
TmpDT.Rows(HdnAliasInd.Value.ToEntero)("CvePS") = CvePS
@@ -20109,6 +20147,9 @@ Partial Class Compras_Compras
DivGastosyServicios.Visible = MostrarGastosServicios
DivGastosyServiciosFooter.Visible = MostrarGastosServicios
If MostrarGastosServicios Then
CargaIndirectosServicios()
End If
DivVincularCrear.Visible = Not MostrarGastosServicios
DivVincularCrearFooter.Visible = Not MostrarGastosServicios

View File

@@ -291,7 +291,8 @@
<asp:HiddenField runat="server" ID="HdnFechasComprasVinculadas" Value="-1" ClientIDMode="Static" />
<asp:GridView ID="GvCxP" GridLines="None" CssClass="table table-hover table-advance Widthall" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Cuentas por Pagar pendientes" DataKeyNames="CveCompra,FechaCompra,Proveedor,SerieFolio,Original,SubTotal,IVA,RetIVA,RetISR,IdCtaContProveedores,IdCtaContProveedoresSIG,CvePrePoliza,IdPoliza,CveRetIVAConcepto,CveRetISRConcepto,IVAPorcentaje,IVADeducible,IVANoDeducible,CveTipoConcepto,CveSubProyecto">
<asp:GridView ID="GvCxP" GridLines="None" CssClass="table table-hover table-advance Widthall" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Cuentas por Pagar pendientes"
DataKeyNames="CveCompra,FechaCompra,Proveedor,SerieFolio,Original,SubTotal,IVA,RetIVA,RetISR,IdCtaContProveedores,IdCtaContProveedoresSIG,CvePrePoliza,IdPoliza,CveRetIVAConcepto,CveRetISRConcepto,IVAPorcentaje,IVADeducible,IVANoDeducible,CveTipoConcepto,CveSubProyecto">
<Columns>
<asp:TemplateField>
<HeaderTemplate>

View File

@@ -1036,7 +1036,7 @@ Partial Class Compras_ReembolsosComprobaciones
'Otros Ingresos
If ChkAjusteOI.Checked Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, True, gvr.FCTextBox("TxtComision").Text.ToDecimal, Referencia, 78, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaProveedor, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal), ImporteMX:=gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio, CveCuenta:=CveCuentaProveedor) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, True, gvr.FCTextBox("TxtComision").Text.ToDecimal, Referencia, 78, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaProveedor, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveSubProyecto:=gvr.DataKey("CveSubProyecto").ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal), ImporteMX:=gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio, CveCuenta:=CveCuentaProveedor) Then
MsgError = "no se pudo insertar el detalle de la poliza de otros ingresos"
End If
End If

View File

@@ -153,7 +153,7 @@ Partial Class Compras_RepComprasDetalle
DdlGrupo.SelectedValueExist(Grupo)
DdlProveedores.SelectedValue = Proveedor
If DdlProveedores.SelectedValue.ToEntero > 0 Then
DdlProveedores.SelectedText = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltraParametros($"CveProveedor = {Proveedor}").Rows(0)("RazonSocial").ToString
DdlProveedores.SelectedText = GlobalDTCompProveedores(UsuarioActual.CveEmpresa, CveProveedor:=DdlProveedores.SelectedValue.ToEntero).FiltroPrimeroValor("RazonSocial", "").ToString
Else
DdlProveedores.SelectedText = "Todos"
End If

View File

@@ -216,7 +216,7 @@
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<asp:Literal ID="LtlTotal" runat="server" Text='<%# Eval("Total", "{0:N2}") %>'></asp:Literal>
<asp:Literal ID="LtlTotal" runat="server" Text='<%# String.Format("{0} {1}", Eval("Total", "{0:N2}"), Eval("Abreviatura")) %>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>

View File

@@ -344,7 +344,7 @@ public partial class Contabilidad_ContabilizacionVentas : ClsPaginas
{
e.Row.FCHyperLink("HplC").NavigateUrl = string.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE"));
}
if (CveConcepto.Contiene(2, 4, 13, 61, 38, 39, 1, 203, 207, 251))
if (CveConcepto.Contiene(1, 2, 4, 13, 61, 38, 39, 150, 203, 207, 251))
{
e.Row.FCHyperLink("HplC").NavigateUrl = string.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DBCampo("CveVenta"));
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -535,7 +535,7 @@
</Style>
</PageHeader>
<PageFooter>
<Height>7.37187cm</Height>
<Height>7.35216cm</Height>
<PrintOnFirstPage>true</PrintOnFirstPage>
<PrintOnLastPage>true</PrintOnLastPage>
<ReportItems>
@@ -557,7 +557,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox31</rd:DefaultName>
<Top>0.07053cm</Top>
<Top>0.07054cm</Top>
<Left>0.11166cm</Left>
<Height>0.6cm</Height>
<Width>2.77516cm</Width>
@@ -588,7 +588,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox31</rd:DefaultName>
<Top>0.1058cm</Top>
<Top>0.10581cm</Top>
<Left>2.9221cm</Left>
<Height>1.2cm</Height>
<Width>13.85147cm</Width>
@@ -604,7 +604,7 @@
</Style>
</Textbox>
<Line Name="Line4">
<Top>0.10581cm</Top>
<Top>0.10582cm</Top>
<Left>0.05604cm</Left>
<Height>0cm</Height>
<Width>16.76689cm</Width>
@@ -616,7 +616,7 @@
</Style>
</Line>
<Line Name="Line3">
<Top>1.3058cm</Top>
<Top>1.30581cm</Top>
<Left>0.11166cm</Left>
<Height>0cm</Height>
<Width>16.71127cm</Width>
@@ -646,7 +646,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox21</rd:DefaultName>
<Top>1.65886cm</Top>
<Top>1.65887cm</Top>
<Left>0.55741cm</Left>
<Height>0.63528cm</Height>
<Width>7.11779cm</Width>
@@ -692,7 +692,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox21</rd:DefaultName>
<Top>2.85337cm</Top>
<Top>2.85338cm</Top>
<Left>0.55115cm</Left>
<Height>0.90367cm</Height>
<Width>7.11779cm</Width>
@@ -726,7 +726,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox22</rd:DefaultName>
<Top>1.3058cm</Top>
<Top>1.30581cm</Top>
<Left>0.56367cm</Left>
<Height>0.6cm</Height>
<Width>7.11153cm</Width>
@@ -760,7 +760,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox21</rd:DefaultName>
<Top>1.62358cm</Top>
<Top>1.62359cm</Top>
<Left>9.66204cm</Left>
<Height>0.63528cm</Height>
<Width>7.11779cm</Width>
@@ -806,7 +806,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox21</rd:DefaultName>
<Top>2.85337cm</Top>
<Top>2.85338cm</Top>
<Left>9.65578cm</Left>
<Height>0.90367cm</Height>
<Width>7.11779cm</Width>
@@ -840,7 +840,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox22</rd:DefaultName>
<Top>1.3058cm</Top>
<Top>1.30581cm</Top>
<Left>9.66204cm</Left>
<Height>0.6cm</Height>
<Width>7.11779cm</Width>
@@ -873,7 +873,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox17</rd:DefaultName>
<Top>3.82759cm</Top>
<Top>3.8276cm</Top>
<Left>0.00042cm</Left>
<Height>1.36498cm</Height>
<Width>16.77315cm</Width>
@@ -888,51 +888,6 @@
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox8">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Fecha Impresión:</Value>
<Style>
<FontSize>8pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
<TextRun>
<Value xml:space="preserve"> </Value>
<Style>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
<TextRun>
<Value>=Today</Value>
<Style>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox8</rd:DefaultName>
<Top>6.50728cm</Top>
<Left>0.11166cm</Left>
<Height>0.6cm</Height>
<Width>6.86562cm</Width>
<ZIndex>11</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems>
<Style>
<Border>

View File

@@ -916,51 +916,6 @@
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox8">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Fecha Impresión:</Value>
<Style>
<FontSize>8pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
<TextRun>
<Value xml:space="preserve"> </Value>
<Style>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
<TextRun>
<Value>=Today</Value>
<Style>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox8</rd:DefaultName>
<Top>8.22649cm</Top>
<Left>0.16462cm</Left>
<Height>0.6cm</Height>
<Width>6.86562cm</Width>
<ZIndex>11</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems>
<Style>
<Border>

View File

@@ -278,8 +278,8 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal
'LIGA SOLO EN DETALLE POR CAMPO CVECUENTA - TEMPORAL
If e.Row.DBCampo("CtaMayor").ToString = "1" Then
e.Row.FCHyperLink("HLNombre").NavigateUrl = $"/Contabilidad2/RepAnexoCatalogoMensual.aspx?C={e.Row.DBCampo("CveCuenta")}&E={DdlEjercicio.SelectedValue}&S={DdlSubProyecto.SelectedValue}&D={DdlDivisor.SelectedValue}"
If e.Row.DBCampo("CtaMayor").ToString = "1" Then
' e.Row.FCHyperLink("HLNombre").NavigateUrl = $"/Contabilidad2/RepAnexoCatalogoMensual.aspx?C={e.Row.DBCampo("CveCuenta")}&E={DdlEjercicio.SelectedValue}&S={DdlSubProyecto.SelectedValue}&D={DdlDivisor.SelectedValue}"
End If

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -907,7 +907,7 @@
<asp:GridView ID="gvCancelaPendiente" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron factura canceladas pendientes"
DataKeyNames="FolioFiscal,RFC,Total"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" Style="text-align: center;" GridLines="None" Width="99%">
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None" Width="99%">
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Folio Fiscal">
<ItemTemplate>
@@ -916,10 +916,10 @@
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Serie Folio" DataField="SerieFolio" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Proveedor" DataField="NombreProveedor" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Importe" DataField="Total" DataFormatString="{0:N2}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Serie Folio" DataField="SerieFolio" ItemStyle-Width="10%" />
<asp:BoundField HeaderText="Proveedor" DataField="NombreProveedor" ItemStyle-Width="50%" />
<asp:BoundField HeaderText="Importe" DataField="Total" DataFormatString="{0:N2}" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" />
<%--<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText=" ">
<ItemTemplate>
<asp:LinkButton runat="server" CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-plus'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea Agregar la factura?" data-btn-ok-label="si"></asp:LinkButton>

View File

@@ -36,7 +36,7 @@ Partial Class Inicio
If objventas.GetFacturasCanceladasPendientes(sb.ToString(), CveEmpresa) Then
retorno = True
End If
gvCancelaPendiente.DataSource = objventas.DtResultados
Else
If showalert Then
Alert("No se encontraron cancelaciones pendientes", ModExtensiones.TipoMensaje.MsgError)
@@ -50,6 +50,7 @@ Partial Class Inicio
retorno = False
Me.OnError("Error al obtener cancelaciones pendientes: ", ex, "")
End Try
gvCancelaPendiente.DataBind()
Return retorno
End Function

View File

@@ -80,7 +80,7 @@
<asp:TemplateField ItemStyle-Width="7%">
<ItemTemplate>
<%--<asp:Literal ID="LtlExistencia" runat="server" Text='<%# Eval("Existencia").ToString().Split("."c)(0) %>'></asp:Literal>--%>
<asp:TextBox ID="TxtCantidad" runat="server" Text='<%# Eval("Existencia").ToString().Split("."c)(0) %>' Width="100%" />
<asp:TextBox ID="TxtCantidad" runat="server" Text='<%# Eval("Existencia").ToString().Split("."c)(0) %>' Width="35px" />
<asp:RangeValidator ID="RVR" Display="Dynamic" ControlToValidate="TxtCantidad" runat="server" MinimumValue="0" Type="Double" ErrorMessage="No cumple con la cantidad especificada"></asp:RangeValidator>
</ItemTemplate>
</asp:TemplateField>

View File

@@ -65,11 +65,13 @@ Partial Class Inventarios_AjustesSeccionAlmacen
Private Sub BtnCambiarSeccion_Click(sender As Object, e As EventArgs) Handles BtnCambiarSeccion.Click
Dim ObjInventario As New ClsInventarios
Dim ObjPS As New ClsProductosServicios(ObjInventario.IniciaTransacSQL)
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL)
Dim Dtt As DataTable = Nothing
Dim CveMovimientoEntrada As Integer = 0
Dim Folio = 0
Dim ErrorMovInv As Boolean = False
Dim TextoError = ""
Dim Contador As Integer = 0
Dim CveAlmacen As Integer = DdlAlmacen.SelectedValue.ToEntero
@@ -106,12 +108,13 @@ Partial Class Inventarios_AjustesSeccionAlmacen
TextoError = "Ocurrió un error al guardar los movimientos de salida"
Exit For
End If
Contador += 1
End If
Next
If Not ErrorMovInv Then
If Not ErrorMovInv AndAlso Contador > 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
@@ -121,7 +124,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
For Each Row As DataRow In resultado.Rows
Dim CvePS = Row("CvePS").ToString().ToEntero()
Dim CantidadRow As Decimal = Row("Cantidad").ToString().ToDecimal()
Cantidad = Row("Cantidad").ToString.ToDecimal()
Dim PU As Decimal = Row("PUOriginal").ToString().ToDecimal()
Dim CveUM As Integer = Row("CveUM").ToString().ToEntero()
Dim CveSeccionAlmacen As Integer = Lista(Row("CvePS").ToString().ToEntero()) 'GvD.Rows(ind).FCDropDownList("DDlS").SelectedValue.ToEntero ' IfNull(Row("CveSeccionAlmacen"), "-1").ToString().ToEntero()
@@ -137,14 +140,29 @@ Partial Class Inventarios_AjustesSeccionAlmacen
' ErrorMovInv = True
'End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, CantidadRow, CveUM, CvePS, PU, -1, CostoIndirecto:=CostoIndirecto, CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, CveUM, CvePS, PU, -1, CostoIndirecto:=CostoIndirecto, CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorMovInv = True
Exit For
End If
ind += 1
Next
resultado.Dispose()
'inserto la prepoliza
If CveMovimientoEntrada > 0 AndAlso CveMovimientoSalida > 0 Then
Dim Concepto As String = "Ajuste Sección"
Dim IdCtaContableOrigen As Integer = 0
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/AjusteAlmacen", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim importe As Decimal = resultado.SUMD("Total").RoundSQL
Dim contabilizable As Boolean = False
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, Concepto, 68, Concepto, Fecha, IdCtaContableOrigen, -1, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=contabilizable, ImporteMX:=importe) Then
ErrorMovInv = True
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, Concepto, 68, Concepto, Fecha, IdCtaContableOrigen, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, Contabilizable:=contabilizable, ImporteMX:=importe) Then
ErrorMovInv = True
End If
End If
resultado.Dispose()
Else
TextoError = "No se pudo registrar el movimiento"
ErrorMovInv = True
@@ -155,16 +173,25 @@ Partial Class Inventarios_AjustesSeccionAlmacen
End If
If Not ErrorMovInv Then
ObjInventario.Commit()
GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, -1, -1) = Nothing
CargaDatos()
Alert("El Movimiento quede registrado correctamente", TipoMensaje.MsgInformacion)
If Contador > 0 Then
ObjInventario.Commit()
GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, -1, -1) = Nothing
CargaDatos()
Alert("El Movimiento quede registrado correctamente", TipoMensaje.MsgInformacion)
Else
ObjInventario.RollBack()
Alert("No se especificaron productos", TipoMensaje.MsgError)
End If
Else
ObjInventario.RollBack()
Alert("Ocurrio un error al registrar el movimiento", TipoMensaje.MsgError)
End If
ObjInventario.Dispose()
ObjConta.Dispose()
ObjPS.Dispose()
End Sub
Protected Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles LbDescargarExcel.Click, BtnDescargar.Click

View File

@@ -5,6 +5,7 @@ Imports System.Data
Imports Extensiones
Imports System.IO
Imports Microsoft.Reporting.WebForms
Imports DocumentFormat.OpenXml.Drawing.Diagrams
'Imports DocumentFormat.OpenXml.Wordprocessing
@@ -2033,8 +2034,8 @@ Partial Class Inventarios_EntradasSalidas
DdlConcepto.Items.Insert(0, New ListItem("Entrada Almacen ", "2"))
End If
If UsuarioActual.CveEmpresa = 72 AndAlso (UsuarioActual.CveUsuario = 2185 OrElse UsuarioActual.CveRol = 1) Then
'2185
If UsuarioActual.CveEmpresa = 72 AndAlso (UsuarioActual.CveUsuario = 1490 OrElse UsuarioActual.CveRol = 1) Then
'DdlConcepto.Items.Add(New ListItem("Seleccione", "-1"))
DdlConcepto.Items.Add(New ListItem("Entrada por Ajuste", "32"))
@@ -2043,6 +2044,24 @@ Partial Class Inventarios_EntradasSalidas
DdlConcepto.Items.Add(New ListItem("Salida por Ajuste", "34"))
End If
End If
''condicion de limpieza si es el usuario 1490, se dejan sino
If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) Then
If UsuarioActual.CveUsuario <> 1490 Then
DdlConcepto.Items.Remove(DdlConcepto.Items.FindByValue("1"))
DdlConcepto.Items.Remove(DdlConcepto.Items.FindByValue("2"))
DdlConcepto.Items.Remove(DdlConcepto.Items.FindByValue("3"))
DdlConcepto.Items.Remove(DdlConcepto.Items.FindByValue("16"))
DdlConcepto.Items.Remove(DdlConcepto.Items.FindByValue("17"))
DdlConcepto.Items.Remove(DdlConcepto.Items.FindByValue("31"))
DdlConcepto.Items.Remove(DdlConcepto.Items.FindByValue("32"))
DdlConcepto.Items.Remove(DdlConcepto.Items.FindByValue("33"))
DdlConcepto.Items.Remove(DdlConcepto.Items.FindByValue("34"))
DdlConcepto.Items.Remove(DdlConcepto.Items.FindByValue("34")) 'si esta dos veces, se tiene que ejecutar 2 veces
DdlConcepto.Items.Remove(DdlConcepto.Items.FindByValue("35"))
End If
End If

View File

@@ -732,7 +732,7 @@ Partial Class Inventarios_RecepcionAlmacen
ObjInventarios.Dispose()
DdlIndirectoFactura.DataBind()
DdlIndirectoFactura.Items.Insert(0, New ListItem("Todos", "-1"))
'DdlIndirectoFactura.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
@@ -2270,6 +2270,10 @@ Partial Class Inventarios_RecepcionAlmacen
Dim ObjContaContPAQ As ClsContPAQi = Nothing
'ENTREGA DIRECTA
Dim MovtosEntradaExA As New List(Of Integer)
Dim FoliosEntradaExA As New List(Of Integer)
Dim MovtosSalidaDirecta As New List(Of Integer)
Dim FoliosSalidaDirecta As New List(Of Integer)
@@ -2548,36 +2552,42 @@ Partial Class Inventarios_RecepcionAlmacen
Dim CveVenta As Integer = DrVenta("CveVenta").ToString().ToEntero()
CveMovtoSalidaDirecta = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 3, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1,
CveVenta, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, TipoCambio),
MovimientoFijo:=True, CveMovimientoRelacionado:=CveMovimiento, Remision:=TxtRemision.Text, CveVendedor:=CveVendedor, CveCliente:=CveCliente, Modulo:="RA/G2")
FolioSalidaDirecta = ObjInventario.Folio
Dim ObjFactura As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa)
If Not CveMovtoSalidaDirecta > 0 Then
ErrorMovInv = True
Exit For
End If
Dim DtDetalleMovimiento As DataTable = Dt.FiltraParametros($"CveVenta={ObjFactura.CveVenta}")
If Not ErrorMovInv AndAlso Dt IsNot Nothing Then
For Each Dr As DataRow In Dt.FiltraParametros($"CveVenta={CveVenta}").Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovtoSalidaDirecta, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorMovInv = True
Exit For
End If
Next
End If
If ObjFactura.TipoDocto = "Ing" Then
Dim MovSalida = GenerarMovimientoAlmacenVenta(DdlAlmacen.SelectedValue.ToEntero(), 3, ObjFactura.CveVenta, CveMovimiento, DtDetalleMovimiento, ObjInventario, ObjConta, ObjContaContPAQ, EsContabilizable, "RA/G2")
If Not ErrorMovInv Then
If Not GeneraPrePolizaSalidaEntregaDirecta(CveMovtoSalidaDirecta, ObjInventario, ObjConta, ObjContaContPAQ, EsContabilizable) Then
ErrorMovInv = True
Exit For
ErrorMovInv = MovSalida.CveMovimiento <= 0
If Not ErrorMovInv Then
MovtosSalidaDirecta.Add(MovSalida.CveMovimiento)
FoliosSalidaDirecta.Add(MovSalida.Folio)
End If
ElseIf ObjFactura.TipoDocto = "Rem" Then
Dim MovSalidaExA = GenerarMovimientoAlmacenVenta(DdlAlmacen.SelectedValue.ToEntero(), 8, ObjFactura.CveVenta, -1, DtDetalleMovimiento, ObjInventario, ObjConta, ObjContaContPAQ, False, "RA/G2R1")
ErrorMovInv = MovSalidaExA.CveMovimiento <= 0
If Not ErrorMovInv Then
MovtosSalidaDirecta.Add(MovSalidaExA.CveMovimiento)
FoliosSalidaDirecta.Add(MovSalidaExA.Folio)
Dim MovEntradaExA = GenerarMovimientoAlmacenVenta(ObjFactura.CveAlmacenTraspasoDestino, 9, ObjFactura.CveVenta, MovSalidaExA.CveMovimiento, DtDetalleMovimiento, ObjInventario, ObjConta, ObjContaContPAQ, False, "RA/G2R2")
ErrorMovInv = MovEntradaExA.CveMovimiento <= 0
If Not ErrorMovInv Then
MovtosEntradaExA.Add(MovEntradaExA.CveMovimiento)
FoliosEntradaExA.Add(MovEntradaExA.Folio)
End If
End If
End If
If Not ErrorMovInv Then
MovtosSalidaDirecta.Add(CveMovtoSalidaDirecta)
FoliosSalidaDirecta.Add(FolioSalidaDirecta)
End If
Next
If Not ErrorMovInv Then
@@ -3307,6 +3317,14 @@ Partial Class Inventarios_RecepcionAlmacen
'ENTREGA DIRECTA
If MovtosSalidaDirecta.Count > 0 Then
Msg.AppendFormat("<br/><br/> Movimientos de control:<br/>")
If MovtosEntradaExA.Count > 0 Then
For index = 0 To MovtosEntradaExA.Count - 1
link = String.Format("<a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", MovtosEntradaExA(index), FoliosEntradaExA(index))
Msg.AppendFormat("<br/>Movimiento de Entrada Folio: <b>{0}</b>", link)
Next
End If
For index = 0 To MovtosSalidaDirecta.Count - 1
link = String.Format("<a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", MovtosSalidaDirecta(index), FoliosSalidaDirecta(index))
Msg.AppendFormat("<br/>Movimiento de Salida Folio: <b>{0}</b>", link)
@@ -3355,6 +3373,45 @@ Partial Class Inventarios_RecepcionAlmacen
If ObjContaAC IsNot Nothing Then ObjContaAC.Dispose()
If ObjContaContPAQ IsNot Nothing Then ObjContaContPAQ.Dispose()
End Sub
Private Function GenerarMovimientoAlmacenVenta(CveAlmacen As Integer, CveConceptoAlmacen As Integer, CveVenta As Integer, CveMovimientoRelacionado As Integer, DtDetalle As DataTable, ObjInventario As ClsInventarios, ObjConta As ClsContabilidad, ObjContaContPAQ As ClsContPAQi, EsContabilizable As Boolean, Modulo As String) As MMovimientoAlmacen
Dim ErrorMovInv As Boolean = False
Dim Retorno As New MMovimientoAlmacen
Dim CveMovtoSalidaDirecta As Integer = -1
Dim FolioSalidaDirecta As Integer = -1
CveMovtoSalidaDirecta = ObjInventario.AddMovimiento(CveAlmacen, CveConceptoAlmacen, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1,
CveVenta, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, TipoCambio),
MovimientoFijo:=True, CveMovimientoRelacionado:=CveMovimientoRelacionado, Remision:=TxtRemision.Text, CveVendedor:=CveVendedor, CveCliente:=CveCliente, Modulo:=Modulo)
FolioSalidaDirecta = ObjInventario.Folio
If Not CveMovtoSalidaDirecta > 0 Then
ErrorMovInv = True
End If
If Not ErrorMovInv AndAlso DtDetalle IsNot Nothing Then
For Each Dr As DataRow In DtDetalle.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovtoSalidaDirecta, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorMovInv = True
Exit For
End If
Next
End If
If Not ErrorMovInv AndAlso CveConceptoAlmacen = 3 Then
If Not GeneraPrePolizaSalidaEntregaDirecta(CveMovtoSalidaDirecta, ObjInventario, ObjConta, ObjContaContPAQ, EsContabilizable) Then
ErrorMovInv = True
End If
End If
If Not ErrorMovInv Then
Retorno.CveMovimiento = CveMovtoSalidaDirecta
Retorno.Folio = FolioSalidaDirecta
End If
Return Retorno
End Function
Private Sub GuardaImportacionFlete()
Dim CveMovimiento As Integer
Dim InvFolio As String = ""
@@ -4283,3 +4340,9 @@ Partial Class Inventarios_RecepcionAlmacen
End Class
Public Class MMovimientoAlmacen
Public Property CveMovimiento As Integer
Public Property Folio As Integer
End Class

View File

@@ -146,7 +146,7 @@ Partial Class RepNotasSinAlmacen
CveClienteProveedor = DdlProveedor.SelectedValue.ToEntero
End If
If Reporte.RepNotasSinAlmacen(2, CveClienteProveedor, FechaInicial, FechaFinal, DdlTipoDocto2.SelectedValue.ToEntero, -1, UsuarioActual.Empresa.CveEmpresa) Then
If Reporte.RepNotasSinAlmacen(2, CveClienteProveedor, FechaInicial, FechaFinal, DdlTipoDocto2.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa) Then
GvCompras.DataSource = Reporte.DtResultados
DtNotasSinAlmacenCompras = Reporte.DtResultados
Else

View File

@@ -4,6 +4,7 @@
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
a.sline{white-space: nowrap ;}
td.cellFail {
color: red;
}
@@ -398,8 +399,8 @@
<ItemTemplate>
<div style="width: 70px; text-align: right;">
<asp:LinkButton runat="server" ID="LnkTimbrar" CssClass="btn btn-circle btn-sm blue mysmallbtn" Text="<i class='fa fa-bell'></i>" OnClick="LnkTimbrar_Click" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea Timbrar?" data-btn-ok-label="si" />
<asp:LinkButton runat="server" ID="ImgDelete" CssClass="btn btn-circle btn-sm red mysmallbtn" Text="<i class='icon-trash'></i>" OnClick="ImgDelete_Click" CommandArgument='<%# Eval("CveNomina") %>' Visible='<%# (Eval("CveNomina").ToString() != "" && Eval("SeTimbro").ToString() == "False"? true :false)%>' OnClientClick="javascript:return confirm('¿Está seguro que desea eliminar la nómina?');" />
<asp:LinkButton runat="server" ID="LnkCancelar" CssClass="btn btn-circle btn-sm red mysmallbtn" Text="<i class='fas fa-ban'></i>" OnClick="LnkCancelar_Click" CommandArgument='<%# Eval("CveNomina") %>' Visible='<%# (Eval("CveNomina").ToString() != "" && PermisoCancelarEmitido && Eval("SeTimbro").ToString() == "True"? true :false)%>' OnClientClick="javascript:return confirm('¿Está seguro que desea cancelar la nómina?');" />
<asp:LinkButton runat="server" ID="ImgDelete" CssClass="btn btn-circle btn-sm red mysmallbtn" Text="<i class='icon-trash'></i>" OnClick="ImgDelete_Click" CommandArgument='<%# Eval("CveNomina") %>' Visible='<%# (Eval("CveNomina").ToString() != "" && Eval("SeTimbro").ToString() == "False"? true :false)%>' data-popout="true" data-original-title="¿Está seguro que desea eliminar la nómina?" data-btn-ok-label="si" />
<asp:LinkButton runat="server" ID="LnkCancelar" CssClass="btn btn-circle btn-sm red mysmallbtn" Text="<i class='fas fa-ban'></i>" OnClick="LnkCancelar_Click" CommandArgument='<%# Eval("CveNomina") %>' Visible='<%# (Eval("CveNomina").ToString() != "" && PermisoCancelarEmitido && Eval("SeTimbro").ToString() == "True"? true :false)%>' data-popout="true" data-original-title="¿Está seguro que desea cancelar la nómina?" data-btn-ok-label="si" />
</div>
</ItemTemplate>
</asp:TemplateField>
@@ -1626,7 +1627,6 @@
<%= String.Format("$('#{0}').click();", btnasis.ClientID) %>
}
function ADSBegin() {
debugger;
if ($('.GvConceptos .thTituloConcepto').length == 0) {
$('.GvConceptos').prepend("<tr class=\"thTituloConcepto\"> <th scope=\"col\" colspan=\"3\">Percepciones</th><th scope=\"col\" colspan=\"3\">Deducciones</th> </tr>");
}

View File

@@ -7,6 +7,8 @@ using System.Web.UI.WebControls;
using Extensiones;
using System.Data;
using System.Text;
using static Extensiones.ModExtensiones;
using System.Drawing;
public partial class Nomina_Nomina2 : ClsPaginas
{
@@ -114,6 +116,57 @@ public partial class Nomina_Nomina2 : ClsPaginas
set { ViewState["CcveMovtoPermanente"] = value; }
}
protected int FiltCveProyecto
{
get
{
if (ViewState["FiltCveProyecto"] == null) { return 0; }
else { return ViewState["FiltCveProyecto"].ToString().ToEntero(); }
}
set { ViewState["FiltCveProyecto"] = value; }
}
protected int FiltCveSubProyecto
{
get
{
if (ViewState["FiltCveSubProyecto"] == null) { return 0; }
else { return ViewState["FiltCveSubProyecto"].ToString().ToEntero(); }
}
set { ViewState["FiltCveSubProyecto"] = value; }
}
protected int FiltCveTurno
{
get
{
if (ViewState["FiltCveTurno"] == null) { return 0; }
else { return ViewState["FiltCveTurno"].ToString().ToEntero(); }
}
set { ViewState["FiltCveTurno"] = value; }
}
protected int FiltCvePeriodo
{
get
{
if (ViewState["FiltCvePeriodo"] == null) { return 0; }
else { return ViewState["FiltCvePeriodo"].ToString().ToEntero(); }
}
set { ViewState["FiltCvePeriodo"] = value; }
}
protected int FiltAgrupador
{
get
{
if (ViewState["FiltAgrupador"] == null) { return 0; }
else { return ViewState["FiltAgrupador"].ToString().ToEntero(); }
}
set { ViewState["FiltAgrupador"] = value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
@@ -256,30 +309,40 @@ public partial class Nomina_Nomina2 : ClsPaginas
protected void LnkConsultar_Click(object sender, EventArgs e)
{
bool continuar = false;
int CveProyecto = DdlProyecto.SelectedValue.ToEntero();
int CveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero();
int CveTurno = DdlTurno.SelectedValue.ToEntero();
int CvePeriodo = DdlPeriodo.SelectedValue.ToEntero();
int CveEmpresa = UsuarioActual.CveEmpresa;
int Agrupador = DdlAgrupador.SelectedValue.ToEntero();
FiltCveProyecto = DdlProyecto.SelectedValue.ToEntero();
FiltCveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero();
FiltCveTurno = DdlTurno.SelectedValue.ToEntero();
FiltCvePeriodo = DdlPeriodo.SelectedValue.ToEntero();
FiltAgrupador = DdlAgrupador.SelectedValue.ToEntero();
cargaDatos();
}
public void cargaDatos()
{
int CveEmpresa = UsuarioActual.CveEmpresa;
bool continuar = false;
CvePeriodoSeleccionado = 0;
dtempleados = null;
dtConceptos = null;
DataTable dtPeriodo = new DataTable();
DataTable dtasistencia = new DataTable();
using (ClsNominas objnom = new ClsNominas())
if (FiltCvePeriodo > 0)
{
if (objnom.GetNominaEmpleado(CveProyecto, CveSubProyecto, CveTurno, CvePeriodo, CveEmpresa, Agrupador) && objnom.DTSetResultados.Tables.Count > 1)
using (ClsNominas objnom = new ClsNominas())
{
dtempleados = objnom.DTSetResultados.Tables[3];
dtempleadosConceptos = objnom.DTSetResultados.Tables[4];
dtConceptos = objnom.DTSetResultados.Tables[0];
dtPeriodo = objnom.DTSetResultados.Tables[1];
dtasistencia = objnom.DTSetResultados.Tables[2];
CvePeriodoSeleccionado = CvePeriodo;
continuar = true;
if (objnom.GetNominaEmpleado(FiltCveProyecto, FiltCveSubProyecto, FiltCveTurno, FiltCvePeriodo, CveEmpresa, FiltAgrupador) && objnom.DTSetResultados.Tables.Count > 1)
{
dtempleados = objnom.DTSetResultados.Tables[3];
dtempleadosConceptos = objnom.DTSetResultados.Tables[4];
dtConceptos = objnom.DTSetResultados.Tables[0];
dtPeriodo = objnom.DTSetResultados.Tables[1];
dtasistencia = objnom.DTSetResultados.Tables[2];
CvePeriodoSeleccionado = FiltCvePeriodo;
continuar = true;
}
}
}
@@ -688,7 +751,6 @@ public partial class Nomina_Nomina2 : ClsPaginas
UpDatos.Update();
}
protected void GvNominas_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
@@ -707,7 +769,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
LnkTimbrar.Visible = false;
if (cvePersonal > 0)
{
LtlNombre.Text = String.Format("<a class=\"Texto\" href=\"/RH/Personal.aspx?CvePersonal={0}\">{2}<br/>{1}</a>", cvePersonal, Nombre, Codigo);
LtlNombre.Text = String.Format("<a class=\"Texto sline\" href=\"/RH/Personal.aspx?CvePersonal={0}\">{2}<br/>{1}</a>", cvePersonal, Nombre, Codigo);
if (CveNomina > 0)
{
if (NomAutorizado == "False")
@@ -761,17 +823,76 @@ public partial class Nomina_Nomina2 : ClsPaginas
protected void LnkTimbrar_Click(object sender, EventArgs e)
{
LinkButton lnk = (LinkButton)sender;
GridViewRow gvRow = (GridViewRow)lnk.NamingContainer;
int CvePeriodo = gvRow.DataKey("CvePeriodo").ToEntero();
int CvePersonal = gvRow.DataKey("CvePersonal").ToEntero();
int CveNomina = gvRow.DataKey("CveNomina").ToEntero();
LogicNominas lognom = new LogicNominas();
string Msg = lognom.TimbrarNomina(CveNomina, CvePersonal, CvePeriodo, UsuarioActual);
if (Msg != null && Msg.Length > 0)
{ Alert(Msg, TipoMensaje.MsgAdvertencia); }
else
{
ClsNominas ObjPeriodo = new ClsNominas();
ObjPeriodo.CambiaEstatusPeriodo(CvePeriodo, (int)enumNominasEstatus.Timbrada, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
ObjPeriodo.Dispose();
Alert("Se ha timbrado correctamente");
gvRow.FindControl("ImgDelete").Visible = false;
gvRow.FindControl("LnkCancelar").Visible = false;
//gvRow.FCImage("ImgBandera").ImageUrl = "/Imagenes/flag_green.png";
gvRow.ForeColor = Color.Green;
lnk.Visible = false; UpDatos.Update();
}
}
protected void ImgDelete_Click(object sender, EventArgs e)
{
int Cve = ((LinkButton)sender).CommandArgument.ToEntero();
ClsNominas Nom = new ClsNominas();
if (Nom.RemoveNom_Nominas(Cve))
{
Alert("Los movimientos de la nómina fueron eliminados", TipoMensaje.MsgInformacion); cargaDatos();
}
Nom.Dispose();
}
protected void LnkCancelar_Click(object sender, EventArgs e)
{
int CveNomina = ((LinkButton)sender).CommandArgument.ToEntero();
if (CveNomina > 0)
{
ClsNominas Nom = new ClsNominas();
if (Nom.GetNom_Nominas(CveNomina, -1, -1, -1, UsuarioActual.CveEmpresa))
{
Timbrado ObjTimbrado = new Timbrado();
string FolioFiscal = Nom.FolioFiscal;
decimal Total = Nom.Total.ToString().ToDecimal();
string RFCReceptor = Nom.RFC;
string RFCEmisor = UsuarioActual.Empresa.RFC;
if (ObjTimbrado.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, RFCEmisor))
{
Nom.UpdateEstatusNomNominas(2, UsuarioActual.Empresa.CvePAC, "", "", ("01/01/2000").ToDate(), CveNomina, 0, 0, 0, 0, 0);
Alert("La nómina con folio fiscal fue cancelada ante el SAT", TipoMensaje.MsgInformacion);
}
}
Nom.Dispose();
cargaDatos();
}
}
protected void LnkCargarNomina_Click(object sender, EventArgs e)
@@ -1094,7 +1215,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
int BorradoLogico = 0;
int CveConcepto = row["CveConcepto"].ToString().ToEntero();
if (!(dtempleados.SUM(string.Format("[V_{0}]", CveConcepto)) > 0))
if (!(dtempleados.SUM(string.Format("[V_{0}]", CveConcepto)) != 0))
{
BorradoLogico = 1;
}
@@ -1105,7 +1226,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
int BorradoLogico = 0;
int CveConcepto = row["CveConcepto"].ToString().ToEntero();
if (!(dtempleados.SUM(string.Format("[V_{0}]", CveConcepto)) > 0))
if (!(dtempleados.SUM(string.Format("[V_{0}]", CveConcepto)) != 0))
{
BorradoLogico = 1;
}
@@ -1246,7 +1367,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
int BorradoLogico = 0;
int CveConcepto = row["CveConcepto"].ToString().ToEntero();
if (!(dtempleados.SUM(string.Format("[V_{0}]", CveConcepto)) > 0))
if (!(dtempleados.SUM(string.Format("[V_{0}]", CveConcepto)) != 0))
{
BorradoLogico = 1;
}
@@ -1257,7 +1378,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
int BorradoLogico = 0;
int CveConcepto = row["CveConcepto"].ToString().ToEntero();
if (!(dtempleados.SUM(string.Format("[V_{0}]", CveConcepto)) > 0))
if (!(dtempleados.SUM(string.Format("[V_{0}]", CveConcepto)) != 0))
{
BorradoLogico = 1;
}
@@ -1856,12 +1977,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
paragraphh.ParagraphFormat.Style = styilo;
paragraphh = new GemBox.Document.Paragraph(document, string.Format("Días pagados:{0}, Retardos: {1}, Ausencias:{2} ", drow2["DiasPago"], drow2["DiasRetardos"], drow2["DiasFaltados"])); cell.Blocks.Add(paragraphh);
paragraphh.ParagraphFormat.Style = styilo;
/*
Gonzalez Gaitan Jorge
DIRECTOR OPERATIVO RFC: GOGJ-720331-TZ3 Afiliación IMSS: 11-96-72-1082-1
Fecha Ingr: 01/03/2019 Sal. diario: 3849.84 S.D.I: 4023.87 S.B.C: 2112.25 Cotiza Fijo
Días pagados: 15.00 Tot Hrs trab: 120.00 Hrs día: 8.00 Hrs extras: 0.00 CURP: GOGJ-720331-HMCNTR09
*/
row = new GemBox.Document.Tables.TableRow(document);
sobrereciboTable.Rows.Add(row);
@@ -3374,7 +3490,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
bool continuar = true;
DataTable dtr = dtempleados.FiltraParametros(string.Format("CvePersonal={0} OR {0}=-1", FiltroCvePersonal));
DataTable dtr = dtempleados.FiltraParametros(string.Format("(CvePersonal={0} OR {0}=-1) AND CvePersonal > 0 AND NomAutorizado =0", FiltroCvePersonal), "", new string[] { "CvePersonal", "CveMetodoPago" });
DataTable dtconp = null;
int CvePeriodoSeleccionado = DdlPeriodo.SelectedValue.ToEntero();//cambiar reparar
#region PropNomina
@@ -3433,7 +3549,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
if (continuar)
{
dtconp = dtempleadosConceptos.FiltraParametros(string.Format("CvePersonal={0}", CvePersonal));
dtconp = dtempleadosConceptos.FiltraParametros(string.Format("CvePersonal={0} AND Importe<>0", CvePersonal));
foreach (DataRow rcon in dtconp.Rows)
{
@@ -3467,6 +3583,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
objNomina.Commit();
Alert("La nomina se autorizó correctamente.");
cargaDatos();
}
else
{
@@ -3474,15 +3591,16 @@ public partial class Nomina_Nomina2 : ClsPaginas
}
}
if(dtr != null){
dtr.Dispose();
if (dtr != null)
{
dtr.Dispose();
}
if (dtconp != null)
{
dtconp.Dispose();
}
}
}
protected void LnkCargaAsistenciaMasiva_Click(object sender, EventArgs e)
@@ -3544,11 +3662,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
cargaPeriodosCM();
}
protected void DdlTipoPeriodoCM_SelectedIndexChanged1(object sender, EventArgs e)
{
}
protected void LnkGuardarASistencia_Click(object sender, EventArgs e)
@@ -3878,7 +3992,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
if (ObjPersonal.DTSetResultados.Tables.Count > 4)
{
DateTime dateperiodo;
DateTime.TryParseExact( string.Format ("{0}01",ObjPersonal.DTSetResultados.Tables[1].Rows[0]["Periodo"]), "yyyyMMdd", new System.Globalization.CultureInfo("es-MX"), System.Globalization.DateTimeStyles.None,out dateperiodo);
DateTime.TryParseExact(string.Format("{0}01", ObjPersonal.DTSetResultados.Tables[1].Rows[0]["Periodo"]), "yyyyMMdd", new System.Globalization.CultureInfo("es-MX"), System.Globalization.DateTimeStyles.None, out dateperiodo);
LtlPeriodo.Text = dateperiodo.Date.ToString("MMMM yyyy", new System.Globalization.CultureInfo("es-MX"));
DtSuaProcesado = ObjPersonal.DTSetResultados.Tables[3];
GVProcesarSUA.DataSource = ObjPersonal.DTSetResultados.Tables[3];
@@ -3980,31 +4094,31 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
ClosedXML.Excel.XLWorkbook wb = new ClosedXML.Excel.XLWorkbook();
var libro = wb.AddWorksheet("SUA");
var libro = wb.AddWorksheet("SUA");
int Fila = 1;
libro.Column(1).Width = 50;
libro.Column(1).Width = 50;
ClosedXML.Excel.IXLRange range = libro.Range(Fila, 2, Fila, 3);
range.Merge();
range.Value = "Salario";
range = libro.Range(Fila,4, Fila, 5);
range = libro.Range(Fila, 4, Fila, 5);
range.Merge();
range.Value = "Cuota Fija";
range = libro.Range(Fila, 6, Fila,7 );
range = libro.Range(Fila, 6, Fila, 7);
range.Merge();
range.Value = "Cuota Excedente";
range = libro.Range(Fila,8, Fila, 9);
range = libro.Range(Fila, 8, Fila, 9);
range.Merge();
range.Value = "Prestaciones en Dinero";
range = libro.Range(Fila, 10, Fila,11 );
range = libro.Range(Fila, 10, Fila, 11);
range.Merge();
range.Value = "Gastos Medicos";
range = libro.Range(Fila, 12, Fila, 13);
range.Merge();
range.Value = "Riesgos de Trabajo";
range = libro.Range(Fila, 14, Fila,15 );
range = libro.Range(Fila, 14, Fila, 15);
range.Merge();
range.Value = "Invalidez y Vida";
range = libro.Range(Fila,16 , Fila, 17);
range = libro.Range(Fila, 16, Fila, 17);
range.Merge();
range.Value = "Guarderia";
range = libro.Range(Fila, 18, Fila, 19);
@@ -4012,24 +4126,24 @@ public partial class Nomina_Nomina2 : ClsPaginas
range.Value = "Retiro";
Fila = Fila + 1;
libro.Cell(Fila, 1).Value = "Empleado";
libro.Cell(Fila, 2).Value = "SUA"; //SalarioSUA
libro.Cell(Fila, 3).Value = "SIG";//SalarioSIG
libro.Cell(Fila, 4).Value = "SUA";//CuotaFijaSUA
libro.Cell(Fila, 5).Value = "SIG";//CuotaFijaSIG
libro.Cell(Fila, 6).Value = "SUA";//CuotaExcedenteSUA
libro.Cell(Fila, 7).Value = "SIG";//CuotaExcedenteSIG
libro.Cell(Fila, 8).Value = "SUA";//PrestacionesDineroSUA
libro.Cell(Fila, 9).Value = "SIG";//PrestacionesSIG
libro.Cell(Fila, 10 ).Value = "SUA";//GastosMedPenSUA
libro.Cell(Fila, 11 ).Value = "SIG";//GastosMedicosSIG
libro.Cell(Fila, 12 ).Value = "SUA";//RiesgosdeTrabajoSUA
libro.Cell(Fila, 13 ).Value = "SIG";//RiesgoTrabajoSIG
libro.Cell(Fila, 14 ).Value = "SUA";//InvalidezyVidaSUA
libro.Cell(Fila, 15 ).Value = "SIG";//InvalidezyVidaSIG
libro.Cell(Fila, 16 ).Value = "SUA";//GuarderiaSUA
libro.Cell(Fila, 17 ).Value = "SIG";//GuarderiaSIG
libro.Cell(Fila, 18 ).Value = "SUA";//RetiroSUA
libro.Cell(Fila, 19 ).Value = "SIG";//RetiroSIG
libro.Cell(Fila, 2).Value = "SUA"; //SalarioSUA
libro.Cell(Fila, 3).Value = "SIG";//SalarioSIG
libro.Cell(Fila, 4).Value = "SUA";//CuotaFijaSUA
libro.Cell(Fila, 5).Value = "SIG";//CuotaFijaSIG
libro.Cell(Fila, 6).Value = "SUA";//CuotaExcedenteSUA
libro.Cell(Fila, 7).Value = "SIG";//CuotaExcedenteSIG
libro.Cell(Fila, 8).Value = "SUA";//PrestacionesDineroSUA
libro.Cell(Fila, 9).Value = "SIG";//PrestacionesSIG
libro.Cell(Fila, 10).Value = "SUA";//GastosMedPenSUA
libro.Cell(Fila, 11).Value = "SIG";//GastosMedicosSIG
libro.Cell(Fila, 12).Value = "SUA";//RiesgosdeTrabajoSUA
libro.Cell(Fila, 13).Value = "SIG";//RiesgoTrabajoSIG
libro.Cell(Fila, 14).Value = "SUA";//InvalidezyVidaSUA
libro.Cell(Fila, 15).Value = "SIG";//InvalidezyVidaSIG
libro.Cell(Fila, 16).Value = "SUA";//GuarderiaSUA
libro.Cell(Fila, 17).Value = "SIG";//GuarderiaSIG
libro.Cell(Fila, 18).Value = "SUA";//RetiroSUA
libro.Cell(Fila, 19).Value = "SIG";//RetiroSIG
libro.Cell(1, 1).Style.Font.FontColor = ClosedXML.Excel.XLColor.White;
@@ -4041,30 +4155,30 @@ public partial class Nomina_Nomina2 : ClsPaginas
foreach (DataRow erow in DtSuaProcesado.Rows)
{
Fila++;
Fila++;
libro.Cell(Fila, 1).Value = erow["CodigoNombreCompleto"];
libro.Cell(Fila, 2).Value = string.Format("{0:N2}",erow["SalarioSUA"]);
libro.Cell(Fila, 3).Value = string.Format("{0:N2}",erow["SalarioSIG"]);
libro.Cell(Fila, 4).Value = string.Format("{0:N2}",erow["CuotaFijaSUA"]);
libro.Cell(Fila, 2).Value = string.Format("{0:N2}", erow["SalarioSUA"]);
libro.Cell(Fila, 3).Value = string.Format("{0:N2}", erow["SalarioSIG"]);
libro.Cell(Fila, 4).Value = string.Format("{0:N2}", erow["CuotaFijaSUA"]);
libro.Cell(Fila, 5).Value = string.Format("{0:N2}", erow["CuotaFijaSIG"]);
libro.Cell(Fila, 6).Value = string.Format("{0:N2}",erow["CuotaExcedenteSUA"]);
libro.Cell(Fila, 7).Value = string.Format("{0:N2}",erow["CuotaExcedenteSIG"]);
libro.Cell(Fila, 8).Value = string.Format("{0:N2}",erow["PrestacionesDineroSUA"]);
libro.Cell(Fila, 9).Value = string.Format("{0:N2}",erow["PrestacionesSIG"]);
libro.Cell(Fila, 10).Value = string.Format("{0:N2}",erow["GastosMedPenSUA"]);
libro.Cell(Fila, 11).Value = string.Format("{0:N2}",erow["GastosMedicosSIG"]);
libro.Cell(Fila, 12).Value = string.Format("{0:N2}",erow["RiesgosdeTrabajoSUA"]);
libro.Cell(Fila, 13).Value = string.Format("{0:N2}",erow["RiesgoTrabajoSIG"]);
libro.Cell(Fila, 14).Value = string.Format("{0:N2}",erow["InvalidezyVidaSUA"]);
libro.Cell(Fila, 15).Value = string.Format("{0:N2}",erow["InvalidezyVidaSIG"]);
libro.Cell(Fila, 16).Value = string.Format("{0:N2}",erow["GuarderiaSUA"]);
libro.Cell(Fila, 17).Value = string.Format("{0:N2}",erow["GuarderiaSIG"]);
libro.Cell(Fila, 18).Value = string.Format("{0:N2}",erow["RetiroSUA"]);
libro.Cell(Fila, 19).Value = string.Format("{0:N2}",erow["RetiroSIG"]);
libro.Cell(Fila, 6).Value = string.Format("{0:N2}", erow["CuotaExcedenteSUA"]);
libro.Cell(Fila, 7).Value = string.Format("{0:N2}", erow["CuotaExcedenteSIG"]);
libro.Cell(Fila, 8).Value = string.Format("{0:N2}", erow["PrestacionesDineroSUA"]);
libro.Cell(Fila, 9).Value = string.Format("{0:N2}", erow["PrestacionesSIG"]);
libro.Cell(Fila, 10).Value = string.Format("{0:N2}", erow["GastosMedPenSUA"]);
libro.Cell(Fila, 11).Value = string.Format("{0:N2}", erow["GastosMedicosSIG"]);
libro.Cell(Fila, 12).Value = string.Format("{0:N2}", erow["RiesgosdeTrabajoSUA"]);
libro.Cell(Fila, 13).Value = string.Format("{0:N2}", erow["RiesgoTrabajoSIG"]);
libro.Cell(Fila, 14).Value = string.Format("{0:N2}", erow["InvalidezyVidaSUA"]);
libro.Cell(Fila, 15).Value = string.Format("{0:N2}", erow["InvalidezyVidaSIG"]);
libro.Cell(Fila, 16).Value = string.Format("{0:N2}", erow["GuarderiaSUA"]);
libro.Cell(Fila, 17).Value = string.Format("{0:N2}", erow["GuarderiaSIG"]);
libro.Cell(Fila, 18).Value = string.Format("{0:N2}", erow["RetiroSUA"]);
libro.Cell(Fila, 19).Value = string.Format("{0:N2}", erow["RetiroSIG"]);
}
//libro.Row(2).SetAutoFilter();
System.IO.Stream fs = new System.IO.MemoryStream();

View File

@@ -778,7 +778,7 @@ Partial Class RH_Personal
Public ReadOnly Property showsalarios As Boolean
Get
Return Not UsuarioActual.Empresa.Funcionalidad(701) = "1"
Return UsuarioActual.Empresa.Funcionalidad(701) = "1"
End Get
End Property
'Configuración

View File

@@ -1,6 +1,7 @@
var IHAVEALLTHEPOWER = false;
var objscollapse = null;
var objsexpand = null;
var adscrollerposition =[];
conf = {
error: console.error,
info: console.info,
@@ -503,10 +504,10 @@ function ADScroller2() {
divbodyScroll.css('width', (widthGral - anchoc1));
divbodyScroll.css('height', (heightGral - altoc1 + 20));
};
$(window).resize(function () {
setTimeout(resizefncscroller, 50);
setTimeout(sizeoftablefunc, 150);
});
//$(window).resize(function () {
// setTimeout(resizefncscroller, 50);
// setTimeout(sizeoftablefunc, 150);
//});
$('table#ADCol' + Tid + ' tr').hover(
function () { $('table#' + Tid + ' tr:nth-child(' + ($(this).index() + 1) + ')').addClass('hover');},
@@ -516,6 +517,16 @@ function ADScroller2() {
function () { $('table#ADCol' + Tid + ' tr:nth-child(' + ($(this).index() + 1) + ')').removeClass('hover'); });
setTimeout(sizeoftablefunc, 100);
let found = adscrollerposition.find(element => element.id = 'C_Tab_TabNominas_GvNominas');
if (found != null) {
divheaderScroll.scrollLeft(found.scrollLeft);
divbodyScroll.scrollLeft(found.scrollLeft);
divcolsScroll.scrollTop(found.scrollTop);
divbodyScroll.scrollTop(found.scrollTop);
}
}
catch (err) {
console.log("ADSCROLLER2 Error:" + err.message);
@@ -1975,7 +1986,12 @@ jQuery(document).ready(function () {
// let id = $(this).attr('id');
// $(this).val(CKEDITOR.instances[id].getData());
//});
adscrollerposition = [];
$('.ADSContainer .AdsBody .ADSCroll table').each(function () {
let _this = $(this);
let _thisScroll = _this.parent();
adscrollerposition.push({ id: _this.attr('id'), scrollLeft: _thisScroll.scrollLeft(), scrollTop: _thisScroll.scrollTop() });
});
saveposicionADScroller();
loaderinit();
});

View File

@@ -1,5 +1,6 @@

Option Explicit On
Option Strict On
Imports Extensiones
Imports System.Data
@@ -293,7 +294,7 @@ Partial Class Ventas_ActualizarPrecios
#Region "C A R G A R E X C E L "
Private Sub BtnDescargarFormato_Click(sender As Object, e As EventArgs) Handles BtnDescargarFormato.Click
Dim DtExcel As DataTable = (From row As GridViewRow In GVPrecios.Rows
Dim DtExcel As DataTable = (From row As GridViewRow In GVPrecios.Rows.Cast(Of GridViewRow)
Where row.RowType = DataControlRowType.DataRow
Select New With
{
@@ -408,7 +409,7 @@ Partial Class Ventas_ActualizarPrecios
Dim DtPS As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
For Each row As DataRow In dt.Rows
Dim Correcto As Boolean = False
Dim CvePS As Integer = DtPS.FiltroPrimeroValor("CvePS", String.Format("Codigo='{0}' AND CveEmpresa={1}", row(0).ToString(), UsuarioActual.CveEmpresa))
Dim CvePS As Integer = DtPS.FiltroPrimeroValor("CvePS", String.Format("Codigo='{0}' AND CveEmpresa={1}", row(0).ToString(), UsuarioActual.CveEmpresa)).ToEntero
Dim CvePrecioLista As Integer = DdlPrecioListaCarga.SelectedValue.ToEntero()
Dim PrecioNuevo As Decimal = row("Precio").ToString().ToDecimal()
Dim Porcentaje As Decimal = -1

View File

@@ -821,7 +821,6 @@ Partial Class ProductosyServicios
lbTitulo.Text = $"{lbTitulo.Text}{ObjProductosServicios.PS}"
LtProductoUnificar.Text = ObjProductosServicios.PS
ddlMetodos.SelectedValue = ObjProductosServicios.CveMetodoInventario.ToString
TxtAlmacenSeccion.Text = ObjProductosServicios.AlmacenSeccion.ToString
DdlConceptoRelacionado.SelectedValueExist(ObjProductosServicios.CveConceptoContable.ToString)
DdlProveedor.SelectedValue = ObjProductosServicios.CveProveedorCompra.ToString

View File

@@ -1782,6 +1782,15 @@ Partial Class Ventas
End Set
End Property
Private Property VentaDesglosaIEPS As Boolean
Get
Return CBool(IfNull(ViewState("VentaDesglosaIEPS"), "False", ViewState("VentaDesglosaIEPS")))
End Get
Set(value As Boolean)
ViewState("VentaDesglosaIEPS") = value
End Set
End Property
#End Region
'#Region "AuxiliarConta"
@@ -2660,6 +2669,12 @@ Partial Class Ventas
End If
'rmf.2020.09.30, codigo de prueba
If UsuarioActual.CveEmpresa = 1 Then
DivMesesSinIntereses.Visible = True
DivDdlCuentaTarjetaCredito.Attributes.Add("class", "col-md-4")
DivContadoOtros.Visible = True
End If
If UsuarioActual.Empresa.Funcionalidad(558).ToEntero() = 1 Then
@@ -5319,8 +5334,7 @@ Partial Class Ventas
CargarAlmacenes()
If UsuarioActual.Empresa.FacturaProduccion Then
End If
CargaDocumentacionCliente()
If UsuarioActual.CveEmpresa.Contiene(72, 80, 1, 119) Then
@@ -8477,7 +8491,7 @@ Partial Class Ventas
ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {DdlMoneda.SelectedValue}")
ObjFactura.TipoDocto = If(IfNull(ViewState("CveRemision"), 0).ToString().ToEntero() > 0, "Ing", DdlTipoComprobante.SelectedValue)
ObjFactura.FacturarSucursal = (Me.FacturarSucursal AndAlso DdlSucursalCliente.SelectedValue.ToEntero() > 0 AndAlso (Me.ClienteSucursal IsNot Nothing AndAlso Not String.IsNullOrEmpty(Me.ClienteSucursal.RFC)))
ObjFactura.VentaDesglosaIEPS = Me.VentaDesglosaIEPS
'ObjFactura.RefDocto = TxtDocto.Text.Trim
'si es cancelacion, debe de conservar el folio actual
If Not EsCancelacion Then ObjFactura.Folio = If(EstablecioFolio Or VistaPrevia Or (CveVenta > 0 And (NuevaFactura.Contiene(0, 2))), TxtFolio.Text.Trim.ToEntero(), -1)
@@ -9862,16 +9876,23 @@ Partial Class Ventas
ObjClientes.Dispose()
BtnEmitirImprimir.Text = "Facturar"
'REGISTRAR UNA ENTREGA DIRECTA
If TmpDT.COUNT("EntregaDirecta", "EntregaDirecta = 1") > 0 Then
trPaqueteriaOpciones.Visible = False
trPaqueteriOpcionesLabel.Visible = False
trPaqueteriaDirectaLabel.Visible = True
End If
BtnEmitirImprimir.Text = "Facturar"
DdlTipoComprobante.SelectedValue = "Ing"
DdlTipoComprobante.Enabled = False
DdlTipoComprobante.Items.Clear()
DdlTipoComprobante.Items.Insert(0, New ListItem("Ingresos", "Ing"))
DdlTipoComprobante.Items.Insert(1, New ListItem("Remisión", "Rem"))
DdlTipoComprobante.Enabled = True
Else
DdlTipoComprobante.SelectedValue = "Ing"
DdlTipoComprobante.Enabled = False
End If
Tab.ActiveTab = TabGenerales
TabGenerales.Enabled = True
@@ -10042,7 +10063,8 @@ Partial Class Ventas
CveVentaRelacion:=(If(factura.CveVentaRelacion.ToEntero() > 0, factura.CveVentaRelacion, -1)), ImporteRelacion:=(If(factura.ImporteRelacion <> Nothing, factura.ImporteRelacion, -1)),
CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, CveAcercamientoCRM:=CveAcercamientoCRM,
DiasCredito:=factura.DiasCredito, EsDiasCreditoFijo:=factura.EsDiasCreditoFijo, AnticipoEspecial:=If(TrAntEspecial.Visible, ChkAntEspecial.Checked, False),
Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=factura.CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text, FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero, FacturarSucursal:=factura.FacturarSucursal) Then
Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=factura.CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text,
FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero, FacturarSucursal:=factura.FacturarSucursal, VentaDesglosaIEPS:=factura.VentaDesglosaIEPS) Then
ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Else
If factura.TipoDocto.Contiene("Dev", "Egs") Or DtVentasNC IsNot Nothing Or CveEstatusRefacturacion = 1 Then
@@ -14528,119 +14550,121 @@ Partial Class Ventas
TxtPrecio.Enabled = True
End If
If UsuarioActual.TienePermisoProceso(68) Then TxtPrecio.Enabled = False
Dim PSCodigoSAT As String = drPS("SATClavePS").ToString
If UsuarioActual.TienePermisoProceso(68) AndAlso Not PSCodigoSAT.Contiene("84111506", "80141610") Then TxtPrecio.Enabled = False
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count = 0 Then
DdlMoneda.SelectedValueExist(drPS("CveMoneda").ToString())
CambiaMoneda()
End If
'SUGIERE PRECIO
Dim PrecioSugerido = 0.0
PrecioSugerido = drPS("Precio").ToString().ToDouble
If UsuarioActual.CveEmpresa.Contiene(1) Then
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPorcentajeProductos(CveCliente) Then
Dim PrecioAplicado = ObjPS.DtResultados.FiltraParametros($"CvePS = {CvePSParametro}").FiltroPrimeroValor("PrecioA").ToDouble
If PrecioAplicado > 0 Then
PrecioSugerido = PrecioAplicado
End If
End If
ObjPS.Dispose()
End If
If UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'cuando el valor es 10.- secuencia Cliente/Sucursal, 20 - sucursal/cliente
Dim TipoPrecioLista As Integer = UsuarioActual.Empresa.Funcionalidad(404).ToEntero
' si es 10. primero el cliente
Dim CvePrecioListaPS As Integer
Dim PorcentajePrecio As Double = 0
If TipoPrecioLista = 10 Then
CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("CvePrecioLista").ToEntero()
If CvePrecioListaPS <= 0 Then
CvePrecioListaPS = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "").ToEntero()
End If
Else
CvePrecioListaPS = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "").ToEntero()
If CvePrecioListaPS <= 0 Then
CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("CvePrecioLista").ToEntero()
End If
DdlMoneda.SelectedValueExist(drPS("CveMoneda").ToString())
CambiaMoneda()
End If
If CvePrecioListaPS > 0 Then
'SUGIERE PRECIO
Dim PrecioSugerido = 0.0
PrecioSugerido = drPS("Precio").ToString().ToDouble
If UsuarioActual.CveEmpresa.Contiene(1) Then
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSParametro) Then
PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDouble
PorcentajePrecio = ObjPS.DtResultados.FiltroPrimeroValor("Porcentaje").ToDouble
If ObjPS.GetPorcentajeProductos(CveCliente) Then
Dim PrecioAplicado = ObjPS.DtResultados.FiltraParametros($"CvePS = {CvePSParametro}").FiltroPrimeroValor("PrecioA").ToDouble
If PrecioAplicado > 0 Then
PrecioSugerido = PrecioAplicado
End If
End If
ObjPS.Dispose()
End If
If PrecioSugerido = 0 Then
Dim ObjInventarios As New ClsInventarios
Dim CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1)
'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal
If CostoPS = 0 Then CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1)
ObjInventarios.Dispose()
If CostoPS > 0 And PorcentajePrecio > 0 Then
PrecioSugerido = ((PorcentajePrecio / 100) + 1) * CostoPS
If UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'cuando el valor es 10.- secuencia Cliente/Sucursal, 20 - sucursal/cliente
Dim TipoPrecioLista As Integer = UsuarioActual.Empresa.Funcionalidad(404).ToEntero
' si es 10. primero el cliente
Dim CvePrecioListaPS As Integer
Dim PorcentajePrecio As Double = 0
If TipoPrecioLista = 10 Then
CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("CvePrecioLista").ToEntero()
If CvePrecioListaPS <= 0 Then
CvePrecioListaPS = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "").ToEntero()
End If
Else
CvePrecioListaPS = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "").ToEntero()
If CvePrecioListaPS <= 0 Then
CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("CvePrecioLista").ToEntero()
End If
End If
If CvePrecioListaPS > 0 Then
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSParametro) Then
PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDouble
PorcentajePrecio = ObjPS.DtResultados.FiltroPrimeroValor("Porcentaje").ToDouble
End If
ObjPS.Dispose()
End If
If PrecioSugerido = 0 Then
Dim ObjInventarios As New ClsInventarios
Dim CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1)
'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal
If CostoPS = 0 Then CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1)
ObjInventarios.Dispose()
If CostoPS > 0 And PorcentajePrecio > 0 Then
PrecioSugerido = ((PorcentajePrecio / 100) + 1) * CostoPS
End If
End If
CvePrecioLista = CvePrecioListaPS
End If
CvePrecioLista = CvePrecioListaPS
End If
'Dim ObjClasificaciones As New ClsClasificaciones
'If ObjClasificaciones.GetClasificaciones() Then
' PrecioBaseCosto = ObjClasificaciones.DtResultados.FiltroPrimeroValor("PrecioBaseCosto", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveClasificacion = {drPS("CveClasificacion")}").ToDecimal
'End If
'Dim ObjClasificaciones As New ClsClasificaciones
'If ObjClasificaciones.GetClasificaciones() Then
' PrecioBaseCosto = ObjClasificaciones.DtResultados.FiltroPrimeroValor("PrecioBaseCosto", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveClasificacion = {drPS("CveClasificacion")}").ToDecimal
'End If
If PrecioSugerido > 0 Then
Dim PrecioBaseCosto As Decimal = 0
PrecioBaseCosto = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=drPS("CveClasificacion").ToString().ToEntero()).FiltroPrimeroValor("PrecioBaseCosto", "").ToDecimal
If PrecioSugerido > 0 Then
Dim PrecioBaseCosto As Decimal = 0
PrecioBaseCosto = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=drPS("CveClasificacion").ToString().ToEntero()).FiltroPrimeroValor("PrecioBaseCosto", "").ToDecimal
If PrecioBaseCosto > 0 Then
PrecioSugerido = PrecioSugerido * ((PrecioBaseCosto / 100) + 1)
If PrecioBaseCosto > 0 Then
PrecioSugerido = PrecioSugerido * ((PrecioBaseCosto / 100) + 1)
End If
TxtPrecio.Text = PrecioSugerido.ToString("#,###.####") ' que muestre hasta los 4 digitos si lo requiere
End If
TxtPrecio.Text = PrecioSugerido.ToString("#,###.####") ' que muestre hasta los 4 digitos si lo requiere
End If
If IsNumeric(TxtCantidad.Text.Trim) Then
LblTotalPS.Text = (TxtCantidad.Text.Trim.ToDouble * TxtPrecio.Text.ToDouble).ToString().FormatoNumero(2)
Else
LblTotalPS.Text = "0.00"
End If
LblPrecio1.Text = TxtPrecio.Text
UPPDescuento.Update()
HdnIVAPS.Value = If(drPS("IVA").ToString() = "-1", ViewState("IVA"), drPS("IVA").ToString()).ToString()
HdnIVARetAPS.Value = drPS("RetIVA").ToString()
HdnAsientoContable.Value = drPS("AsientoContableVentas").ToString()
HdnCtaContable.Value = drPS("IdCtaContVentas").ToString()
HdnAplicaParaConcepto.Value = drPS("AplicaParaConcepto").ToString()
HdnCodigo.Value = drPS("Codigo").ToString()
If DdlClasificacion.SelectedIndex = 0 Then
If drPS("CveClasificacion").ToString() IsNot Nothing Then
DdlClasificacion.SelectedValueExist(drPS("CveClasificacion").ToString())
If IsNumeric(TxtCantidad.Text.Trim) Then
LblTotalPS.Text = (TxtCantidad.Text.Trim.ToDouble * TxtPrecio.Text.ToDouble).ToString().FormatoNumero(2)
Else
Alert("El Productos/Servicio no tiene asignada una Clasificación.", TipoMensaje.MsgInformacion)
LblTotalPS.Text = "0.00"
End If
LblPrecio1.Text = TxtPrecio.Text
UPPDescuento.Update()
HdnIVAPS.Value = If(drPS("IVA").ToString() = "-1", ViewState("IVA"), drPS("IVA").ToString()).ToString()
HdnIVARetAPS.Value = drPS("RetIVA").ToString()
HdnAsientoContable.Value = drPS("AsientoContableVentas").ToString()
HdnCtaContable.Value = drPS("IdCtaContVentas").ToString()
HdnAplicaParaConcepto.Value = drPS("AplicaParaConcepto").ToString()
HdnCodigo.Value = drPS("Codigo").ToString()
If DdlClasificacion.SelectedIndex = 0 Then
If drPS("CveClasificacion").ToString() IsNot Nothing Then
DdlClasificacion.SelectedValueExist(drPS("CveClasificacion").ToString())
Else
Alert("El Productos/Servicio no tiene asignada una Clasificación.", TipoMensaje.MsgInformacion)
End If
End If
End If
End If
ElseIf CvePSParametro = -2 Then
ElseIf CvePSParametro = -2 Then
CargaPS(DdlClasificacion.SelectedValue.ToEntero(), Ddl)
End If
@@ -15247,7 +15271,7 @@ Partial Class Ventas
If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False Then
'VALIDA EXISTENCIA
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119}) Then
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119, 153}) Then
If Existencia - TmpDT.SUM("Cantidad", $"CvePS = {CvePS} AND (EntregaDirecta IS NULL OR EntregaDirecta < 1)") < TxtCantidad.Text.ToDouble Then
Alert("No cuenta con la cantidad suficiente en inventario. Cuenta con " + Existencia.FormatoNumero(2) + ".", TipoMensaje.MsgAdvertencia)
Return False
@@ -15662,13 +15686,10 @@ Partial Class Ventas
ObjPS.Dispose()
End Sub
Private Function AgregarProductoServicio(Cantidad As Decimal, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String, CvePS As Integer, PS As String, Obs As String,
PU As Decimal, Descuento As Decimal,
CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String,
Optional Serie As String = "", Optional TiempoEntrega As String = "", 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 RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0,
Optional SeActualiza As Boolean = False, Optional CvePromocionDetalle As Integer = -1, Optional EsCargo As Boolean = False) As Boolean
PU As Decimal, Descuento As Decimal, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String, Optional Serie As String = "", Optional TiempoEntrega As String = "",
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 RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional SeActualiza As Boolean = False, Optional CvePromocionDetalle As Integer = -1, Optional EsCargo As Boolean = False) As Boolean
Dim Retorno As Boolean = False
If Not CvePS > 0 Then
@@ -15752,12 +15773,21 @@ Partial Class Ventas
End If
End If
'VERIFICA SI EN LA FACTURA PADRE SE DESGLOSO EL IEPS
Dim FacturaDesglosoIEPS As Boolean = ((CveDevolucion > 0 AndAlso NuevaFactura = 1) AndAlso (Me.ObjFacturaNC IsNot Nothing AndAlso Me.ObjFacturaNC.VentaDesglosaIEPS))
If Not ClienteDesglosaIEPS Then
If Not RegeneraIEPS Then
If Not RegeneraIEPS AndAlso Not FacturaDesglosoIEPS Then
PU = PU * (1 + DrPS("IEPSPorcentaje").ToString().ToDecimal)
VentaDesglosaIEPS = True
End If
DrPS("IEPSPorcentaje") = 0
End If
'SI YA SE DESGLOSO EL IEPS SE GUARDA LA BANDERA EN ESTA FACTURA
If FacturaDesglosoIEPS Then
VentaDesglosaIEPS = True
End If
TotalCalculableImpuestos = (Cantidad * (PU)) - Descuento
TotalCalculableImpuestosIVA = TotalCalculableImpuestos * (1 + DrPS("IEPSPorcentaje").ToString().ToDecimal)
@@ -18710,8 +18740,8 @@ Partial Class Ventas
Dim DtCC As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa)
DdlCuentaEfectivo.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero())))
DdlCuentaTarjetaCredito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero())))
DdlCuentaTarjetaDebito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero())))
DdlCuentaTarjetaCredito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND (CveTipoCuenta <> 1 OR TieneTerminal = 1)", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero())))
DdlCuentaTarjetaDebito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND (CveTipoCuenta <> 1 OR TieneTerminal = 1)", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero())))
DdlCuentaCheque.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero())))
DdlCuentaTransferencia.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero())))

View File

@@ -108,6 +108,10 @@