Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -1294,7 +1294,8 @@ Public Class ClsPaginas
|
||||
ObjPS.Dispose()
|
||||
End Get
|
||||
End Property
|
||||
Public Property GlobalDTPSSimplificado(CveEmpresa As Integer, Optional CveClasificacion As Integer = -1, Optional PSCodigo As String = "-1", Optional Estatus As Integer = 1, Optional AplicaParaVenta As Integer = -1, Optional CvePS As Integer = -1) As DataTable
|
||||
Public Property GlobalDTPSSimplificado(CveEmpresa As Integer, Optional CveClasificacion As Integer = -1, Optional PSCodigo As String = "-1", Optional Estatus As Integer = 1,
|
||||
Optional AplicaParaVenta As Integer = -1, Optional CvePS As Integer = -1, Optional Codigo As String = "-1") As DataTable
|
||||
Get
|
||||
Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)
|
||||
If CveEmpresa <> -1 Then
|
||||
@@ -1312,6 +1313,8 @@ Public Class ClsPaginas
|
||||
Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEmpresa) = CveEmpresa))
|
||||
If CveClasificacion >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveClasificacion) = CveClasificacion))
|
||||
If PSCodigo <> "-1" Then Cons = Cons.Where((Function(a) Convert.ToString(a!PSCodigo) = PSCodigo))
|
||||
Codigo = Codigo.ToUpper().Trim()
|
||||
If Codigo <> "-1" Then Cons = Cons.Where((Function(a) Convert.ToString(a!Codigo).ToUpper().Trim() = Codigo))
|
||||
If Estatus >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEstado) = Estatus))
|
||||
If AplicaParaVenta >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!AplicaParaVenta) = AplicaParaVenta))
|
||||
If CvePS >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CvePS) = CvePS))
|
||||
@@ -4619,6 +4622,7 @@ Public Class ClsPaginas
|
||||
PaginaDict.Add("/GPS/RepGastos.aspx".ToUpper(), 685)
|
||||
PaginaDict.Add("/GPS/RecursoConfiableTracking.aspx".ToUpper(), 692)
|
||||
PaginaDict.Add("/GPS/KimberlyClarkTracking.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/GPS/RepUnidades.aspx".ToUpper(), 780)
|
||||
#End Region
|
||||
'INVENTARIOS
|
||||
#Region "Inventarios"
|
||||
@@ -4692,6 +4696,7 @@ Public Class ClsPaginas
|
||||
PaginaDict.Add("/Inventarios/EntregasPorRealizar.aspx".ToUpper(), 728)
|
||||
PaginaDict.Add("/Inventarios/CatAlmacenClasificacionSecciones.aspx".ToUpper(), 764)
|
||||
PaginaDict.Add("/Inventarios/ReconstruirCostos.aspx".ToUpper(), 764)
|
||||
PaginaDict.Add("/Inventarios/RecepcionDevolucion.aspx".ToUpper(), 696)
|
||||
|
||||
|
||||
#End Region
|
||||
@@ -5078,6 +5083,7 @@ Public Class ClsPaginas
|
||||
PaginaDict.Add("/Ventas/MetasVendedores.aspx".ToUpper(), 722)
|
||||
PaginaDict.Add("/Ventas/CatMetasVendedores.aspx".ToUpper(), 723)
|
||||
PaginaDict.Add("/Ventas/RepAuxiliarFacturas.aspx".ToUpper(), 567)
|
||||
PaginaDict.Add("/Ventas/CatAutorizacionLimites.aspx".ToUpper(), 781)
|
||||
#End Region
|
||||
|
||||
|
||||
@@ -5952,6 +5958,19 @@ Public Class ClsPaginas
|
||||
Dim TipoDocumentoRef As String = ""
|
||||
Dim AplicaPagare As String = "1"
|
||||
|
||||
Dim RFCReceptor As String = ""
|
||||
|
||||
If String.IsNullOrEmpty(Vta.RFCReceptor) Then
|
||||
RFCReceptor = Vta.Cliente.RFC
|
||||
If Vta.FacturarSucursal Then
|
||||
If Vta.ClienteSucursal IsNot Nothing Then
|
||||
RFCReceptor = Vta.ClienteSucursal.RFC
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
RFCReceptor = Vta.RFCReceptor
|
||||
End If
|
||||
|
||||
Dim RutaCBB As String = String.Format("{0}CBB\{1}.jpg", Ruta, Vta.SerieFolio)
|
||||
Dim ImagenCBB As New System.IO.FileInfo(RutaCBB)
|
||||
Dim ImgCBB As String '= String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/{4}.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, Vta.SerieFolio)
|
||||
@@ -6081,7 +6100,7 @@ Public Class ClsPaginas
|
||||
'Si no tiene CBB, SE GENERA
|
||||
If Not ImagenCBB.Exists Then
|
||||
Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar()
|
||||
CBB.GenerarCBB(UsuarioActual.Empresa.RFC, Vta.Cliente.RFC, Vta.Total.ToString.ToDecimal, Vta.FolioFiscal, RutaCBB)
|
||||
CBB.GenerarCBB(UsuarioActual.Empresa.RFC, RFCReceptor, Vta.Total.ToString.ToDecimal, Vta.FolioFiscal, RutaCBB)
|
||||
End If
|
||||
ImgCBB = String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/{4}.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, Vta.SerieFolio)
|
||||
|
||||
@@ -6096,7 +6115,7 @@ Public Class ClsPaginas
|
||||
|
||||
'CLIENTE
|
||||
params.Add(New CrystalParametro("ClienteCodigo", Vta.Cliente.Codigo))
|
||||
params.Add(New CrystalParametro("ClienteNombre", If(Vta.ClienteSucursal.ImprimeNombreSucursal = "True", If(Vta.CveClienteSucursal > 0, Vta.ClienteSucursal.Sucursal, Vta.Cliente.Nombre), If(Vta.AtencionA <> "" AndAlso Vta.TipoDocto.Contiene("Ing", "Rem") AndAlso Vta.Cliente.RFC = "XAXX010101000", $"{Vta.Cliente.Nombre}({Vta.AtencionA})", Vta.Cliente.Nombre))))
|
||||
params.Add(New CrystalParametro("ClienteNombre", If(Vta.ClienteSucursal.ImprimeNombreSucursal = "True", If(Vta.CveClienteSucursal > 0, Vta.ClienteSucursal.Sucursal, Vta.Cliente.Nombre), If(Vta.AtencionA <> "" AndAlso Vta.TipoDocto.Contiene("Ing", "Rem") AndAlso RFCReceptor = "XAXX010101000", $"{Vta.Cliente.Nombre}({Vta.AtencionA})", Vta.Cliente.Nombre))))
|
||||
params.Add(New CrystalParametro("ClienteDireccion", ClienteDireccion))
|
||||
params.Add(New CrystalParametro("ClienteLugar", ClienteLugar))
|
||||
|
||||
@@ -6128,7 +6147,7 @@ Public Class ClsPaginas
|
||||
params.Add(New CrystalParametro("SelloSAT", Vta.SelloSAT))
|
||||
|
||||
params.Add(New CrystalParametro("QR", ImgCBB))
|
||||
params.Add(New CrystalParametro("ClienteRFC", Vta.Cliente.RFC))
|
||||
params.Add(New CrystalParametro("ClienteRFC", RFCReceptor))
|
||||
params.Add(New CrystalParametro("FormaPago", Vta.FormaPagoText))
|
||||
params.Add(New CrystalParametro("Moneda", Vta.Moneda))
|
||||
params.Add(New CrystalParametro("TipoCambio", Vta.TipoCambio.ToString))
|
||||
@@ -6161,7 +6180,7 @@ Public Class ClsPaginas
|
||||
params.Add(New CrystalParametro("ClienteTelefono", Vta.ClienteSucursal.TelefonoSucursal))
|
||||
Else
|
||||
params.Add(New CrystalParametro("ClienteContactoMail", Vta.Cliente.MailCotizacion))
|
||||
params.Add(New CrystalParametro("ClienteTelefono", If(Vta.TipoDocto.Contiene("Ing", "Rem") AndAlso Vta.Cliente.RFC = "XAXX010101000", Vta.TelefonoGenerico, Vta.Cliente.Telefono)))
|
||||
params.Add(New CrystalParametro("ClienteTelefono", If(Vta.TipoDocto.Contiene("Ing", "Rem") AndAlso Vta.Cliente.Telefono.Length > 6, Vta.Cliente.Telefono, Vta.TelefonoGenerico)))
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveEmpresa.Contiene(17) Then
|
||||
@@ -6463,7 +6482,18 @@ Public Class ClsPaginas
|
||||
Dim NombreArchivoDescarga As String = ""
|
||||
Dim TipoDocumento As String = ""
|
||||
Dim TipoDocumentoRef As String = ""
|
||||
Dim RFCReceptor As String = ""
|
||||
|
||||
If String.IsNullOrEmpty(Vta.RFCReceptor) Then
|
||||
RFCReceptor = Vta.Cliente.RFC
|
||||
If Vta.FacturarSucursal Then
|
||||
If Vta.ClienteSucursal IsNot Nothing Then
|
||||
RFCReceptor = Vta.ClienteSucursal.RFC
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
RFCReceptor = Vta.RFCReceptor
|
||||
End If
|
||||
|
||||
Dim RutaCBB As String = String.Format("{0}CBB\{1}.jpg", Ruta, Vta.SerieFolio)
|
||||
Dim ImagenCBB As New System.IO.FileInfo(RutaCBB)
|
||||
@@ -6618,7 +6648,7 @@ Public Class ClsPaginas
|
||||
'Si no tiene CBB, SE GENERA
|
||||
If Not ImagenCBB.Exists AndAlso Vta.CveCliente.ToEntero > 0 Then
|
||||
Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar()
|
||||
CBB.GenerarCBB(UsuarioActual.Empresa.RFC, Vta.Cliente.RFC, Vta.Total.ToString.ToDecimal, Vta.FolioFiscal, RutaCBB)
|
||||
CBB.GenerarCBB(UsuarioActual.Empresa.RFC, RFCReceptor, Vta.Total.ToString.ToDecimal, Vta.FolioFiscal, RutaCBB)
|
||||
End If
|
||||
ImgCBB = String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/{4}.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, Vta.SerieFolio)
|
||||
|
||||
@@ -6636,17 +6666,17 @@ Public Class ClsPaginas
|
||||
'CLIENTE
|
||||
If Vta.CveCliente.ToEntero > 0 Or Vta.CveEmpresaCRM.ToEntero > 0 Then
|
||||
params.Add(New ReportParameter("ClienteCodigo", Vta.Cliente.Codigo))
|
||||
params.Add(New ReportParameter("ClienteNombre", If(Vta.ClienteSucursal.ImprimeNombreSucursal = "True", If(Vta.CveClienteSucursal > 0, Vta.ClienteSucursal.Sucursal, Vta.Cliente.Nombre), If(Vta.AtencionA <> "" AndAlso Vta.TipoDocto.Contiene("Ing", "Rem") AndAlso Vta.Cliente.RFC = "XAXX010101000", $"{Vta.Cliente.Nombre}({Vta.AtencionA})", Vta.Cliente.Nombre))))
|
||||
params.Add(New ReportParameter("ClienteNombre", If(Vta.ClienteSucursal.ImprimeNombreSucursal = "True", If(Vta.CveClienteSucursal > 0, Vta.ClienteSucursal.Sucursal, Vta.Cliente.Nombre), If(Vta.AtencionA <> "" AndAlso Vta.TipoDocto.Contiene("Ing", "Rem") AndAlso RFCReceptor = "XAXX010101000", $"{Vta.Cliente.Nombre}({Vta.AtencionA})", Vta.Cliente.Nombre))))
|
||||
params.Add(New ReportParameter("ClienteDireccion", ClienteDireccion))
|
||||
params.Add(New ReportParameter("ClienteLugar", ClienteLugar))
|
||||
params.Add(New ReportParameter("ClienteRFC", Vta.Cliente.RFC))
|
||||
params.Add(New ReportParameter("ClienteRFC", RFCReceptor))
|
||||
End If
|
||||
If Vta.CveEmpresaCRM.ToEntero > 0 Then
|
||||
params.Add(New ReportParameter("ClienteCodigo", Vta.Cliente.Codigo))
|
||||
params.Add(New ReportParameter("ClienteNombre", Vta.Cliente.Nombre))
|
||||
params.Add(New ReportParameter("ClienteDireccion", ClienteDireccion))
|
||||
params.Add(New ReportParameter("ClienteLugar", ClienteLugar))
|
||||
params.Add(New ReportParameter("ClienteRFC", Vta.Cliente.RFC))
|
||||
params.Add(New ReportParameter("ClienteRFC", RFCReceptor))
|
||||
End If
|
||||
|
||||
'TOTALES
|
||||
@@ -6729,7 +6759,7 @@ Public Class ClsPaginas
|
||||
params.Add(New ReportParameter("ClienteTelefono", Vta.ClienteSucursal.TelefonoSucursal))
|
||||
ElseIf Vta.CveCliente.ToEntero > 0 Then
|
||||
params.Add(New ReportParameter("ClienteContactoMail", Vta.Cliente.MailCotizacion))
|
||||
params.Add(New ReportParameter("ClienteTelefono", If(Vta.TipoDocto.Contiene("Ing", "Rem") AndAlso Vta.Cliente.Telefono.Length > 6, Vta.TelefonoGenerico, Vta.Cliente.Telefono)))
|
||||
params.Add(New ReportParameter("ClienteTelefono", If(Vta.TipoDocto.Contiene("Ing", "Rem") AndAlso Vta.Cliente.Telefono.Length > 6, Vta.Cliente.Telefono, Vta.TelefonoGenerico)))
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveEmpresa.Contiene(17) Then
|
||||
|
||||
@@ -420,20 +420,6 @@ Public Class ClsSisEmpresas
|
||||
_Empresa.IdCuentaIEPSTrasladado = Data.Rows(0)("IdCuentaIEPSTrasladado").ToString.ToEntero
|
||||
_Empresa.IdCuentaOtrosIngresos = Data.Rows(0)("Conta_IdCuentaOtrosIngresos").ToString.ToEntero
|
||||
|
||||
'Contabilidad SIG
|
||||
_Empresa.CveCuentaIVAxAcreditar = Data.Rows(0)("IdCuentaIVAxAcreditarSIG").ToString.ToEntero
|
||||
_Empresa.CveCuentaIVAAcreditable = Data.Rows(0)("IdCuentaIVAAcreditableSIG").ToString.ToEntero
|
||||
_Empresa.CveCuentaIVAxTrasladar = Data.Rows(0)("IdCuentaIVAxTrasladarSIG").ToString.ToEntero
|
||||
_Empresa.CveCuentaIVATrasladado = Data.Rows(0)("IdCuentaIVATrasladadoSIG").ToString.ToEntero
|
||||
_Empresa.CveCuentaRetIVACirculacion = Data.Rows(0)("IdCuentaRetIVACirculacionSIG").ToString.ToEntero
|
||||
_Empresa.CveCuentaRetISRCirculacion = Data.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero
|
||||
_Empresa.CveCuentaDSV = Data.Rows(0)("IdCuentaDescuentoVentaSIG").ToString.ToEntero
|
||||
_Empresa.CveCuentaImpuestosLocales = Data.Rows(0)("IdCuentaImpuestosLocalesSIG").ToString.ToEntero
|
||||
_Empresa.CveCuentaIEPSxAcreditar = Data.Rows(0)("IdCuentaIEPSxAcreditarSIG").ToString.ToEntero
|
||||
_Empresa.CveCuentaIEPSAcreditable = Data.Rows(0)("IdCuentaIEPSAcreditableSIG").ToString.ToEntero
|
||||
_Empresa.CveCuentaIEPSxTrasladar = Data.Rows(0)("IdCuentaIEPSxTrasladarSIG").ToString.ToEntero
|
||||
_Empresa.CveCuentaIEPSTrasladado = Data.Rows(0)("IdCuentaIEPSTrasladadoSIG").ToString.ToEntero
|
||||
|
||||
'_Empresa.IdCtaProveedor = Data.Rows(0)("IdCtaProveedor").ToString.ToEntero
|
||||
'_Empresa.IdCtaCliente = Data.Rows(0)("IdCtaCliente").ToString.ToEntero
|
||||
'_Empresa.IdCtaDeudores = Data.Rows(0)("IdCtaDeudores").ToString.ToEntero
|
||||
|
||||
@@ -821,7 +821,7 @@ Public Class ClsSisUsuarios
|
||||
Public Function AddUsuario(Usuario As String, Contraseña As String, Nombre As String, CveRol As Integer, Correo As String,
|
||||
CvePersonal As Integer, CveVendedor As Integer, CambiarContraseña As Boolean,
|
||||
CveUsuarioIng As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, Optional Rol As String = "-1", Optional CveAlmacenAsignado As Integer = -1, Optional AsignarSubProyecto As Boolean = False, Optional AsignarOC As Boolean = False,
|
||||
Optional CvePlataforma As Integer = -1, Optional CveClientePlataforma As Integer = -1, Optional CveProveedorPlataforma As Integer = -1, Optional DescuentoAutorizado As Double = 0, Optional CodigoAcceso As String = "-1") As Integer
|
||||
Optional CvePlataforma As Integer = -1, Optional CveClientePlataforma As Integer = -1, Optional CveProveedorPlataforma As Integer = -1, Optional DescuentoAutorizado As Double = 0, Optional CodigoAcceso As String = "-1", Optional LimiteCreditoAutorizado As Decimal = 0) As Integer
|
||||
Dim Retorno = -1
|
||||
DataAdapter("PA_Sis_UsuarioAdd")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
@@ -842,6 +842,7 @@ Public Class ClsSisUsuarios
|
||||
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedorPlataforma
|
||||
.Add("@DescuentoAutorizado", SqlDbType.Float).Value = DescuentoAutorizado
|
||||
.Add("@CodigoAcceso", SqlDbType.VarChar).Value = CodigoAcceso
|
||||
.Add("@LimiteCreditoAutorizado", SqlDbType.Money).Value = LimiteCreditoAutorizado
|
||||
|
||||
.Add("@CveUsuario", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
End With
|
||||
@@ -940,7 +941,7 @@ Public Class ClsSisUsuarios
|
||||
End Function
|
||||
Public Function UpdateUsuario(Usuario As String, Nombre As String, CveRol As Integer, Correo As String, CvePersonal As Integer,
|
||||
CveVendedor As Integer, CambiarContraseña As Boolean, Activo As Boolean, CveEmpresa As Integer, CveUsuario As Integer, CveAlmacenAsignado As Integer, CveSubProyecto As Integer, Optional CveUsuarioModifico As Integer = -1, Optional AsignarSubProyecto As Boolean = False, Optional AsignarOC As Boolean = False,
|
||||
Optional DescuentoAutorizado As Double = 0, Optional CodigoAcceso As String = "-1") As Boolean
|
||||
Optional DescuentoAutorizado As Double = 0, Optional CodigoAcceso As String = "-1", Optional LimiteCreditoAutorizado As Decimal = 0) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Sis_UsuarioUpdate")
|
||||
@@ -962,6 +963,7 @@ Public Class ClsSisUsuarios
|
||||
.Add("@AsignarOC", SqlDbType.Bit).Value = AsignarOC
|
||||
.Add("@DescuentoAutorizado", SqlDbType.Float).Value = DescuentoAutorizado
|
||||
.Add("@CodigoAcceso", SqlDbType.VarChar).Value = CodigoAcceso
|
||||
.Add("@LimiteCreditoAutorizado", SqlDbType.Money).Value = LimiteCreditoAutorizado
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -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, Optional VentaDesglosaIEPS As Boolean = False, Optional ServicioDomicilio As Boolean = False, Optional RFCReceptor As String = "", Optional Adjunto As String = "-1") As Boolean
|
||||
Optional CorreoNotificacion As String = "", Optional FormaPaqueteria As Integer = 1, Optional FacturarSucursal As Boolean = False, Optional VentaDesglosaIEPS As Boolean = False, Optional ServicioDomicilio As Boolean = False, Optional RFCReceptor As String = "", Optional Adjunto As String = "-1", Optional DevolucionImportePagado As Decimal = 0) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_VentasAdd")
|
||||
@@ -438,6 +438,8 @@ Public Class ClsVentas
|
||||
.Add("@RFCReceptor", SqlDbType.VarChar).Value = RFCReceptor
|
||||
.Add("@Adjunto", SqlDbType.VarChar).Value = Adjunto
|
||||
|
||||
.Add("@DevolucionImportePagado", SqlDbType.Money).Value = DevolucionImportePagado
|
||||
|
||||
.Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
|
||||
End With
|
||||
'SqlTypes.SqlDateTime.Null
|
||||
@@ -4387,8 +4389,6 @@ Public Class ClsVentas
|
||||
Return Retorno
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " AUTORIZACION LIMITES "
|
||||
|
||||
Public Function AutorizacionLimitesGet(CveCliente As Integer, CveCveVendedor As Integer, CveEstatus As Integer) As Boolean
|
||||
@@ -5091,6 +5091,81 @@ Public Class ClsVentas
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
|
||||
Public Function AddAutorizacionLimite(CveEmpresa As Integer, CveCliente As Integer, CveVendedor As Integer, Importe As Decimal, CveEstatus As Integer, CveUsuario As Integer, TipoAutorizacion As Integer, TipoDocumento As String) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_AutorizacionLimitesAdd")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||
.Add("@Importe", SqlDbType.Money).Value = Importe
|
||||
.Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@TipoAutorizacion", SqlDbType.Int).Value = TipoAutorizacion
|
||||
.Add("@TipoDocumento", SqlDbType.VarChar).Value = TipoDocumento
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener los limites.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetAutorizacionLimite(CveEmpresa As Integer, CveCliente As Integer, CveVendedor As Integer, Optional CveEstatus As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_AutorizacionLimitesGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||
.Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener los limites.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
Public Function UpdateAutorizacionLimite(CveAutorizacion As Integer, CveCliente As Integer, CveVenta As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_AutorizacionlimitesEstatusUpdate")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveAutorizacion", SqlDbType.Int).Value = CveAutorizacion
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al actualizar los limites.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function RemoveAutorizacionLimite(CveAutorizacion As Integer, CveCliente As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_AutorizacionLimitesRemove")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveAutorizacion", SqlDbType.Int).Value = CveAutorizacion
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al eliminar los limites.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
#Region "IDisposable Support"
|
||||
|
||||
|
||||
|
||||
@@ -108,12 +108,7 @@ Public Class Empresa
|
||||
Public Property IdCuentaIVAxTrasladar As Integer
|
||||
Public Property IdCuentaIVATrasladado As Integer
|
||||
Public Property IdCuentaPerdidaCambiaria As Integer
|
||||
Public Property IdCuentaGananciaCambiaria As Integer
|
||||
Public Property CveCuentaIVAxTrasladar As Integer
|
||||
Public Property CveCuentaIVATrasladado As Integer
|
||||
Public Property CveCuentaPerdidaCambiaria As Integer
|
||||
Public Property CveCuentaGananciaCambiaria As Integer
|
||||
|
||||
Public Property IdCuentaGananciaCambiaria As Integer
|
||||
Public Property ContaContabilizacionNC As Integer
|
||||
Public Property PV_TerminalTipo As Integer
|
||||
Public Property PlantillaMailVenta As String
|
||||
@@ -132,20 +127,9 @@ Public Class Empresa
|
||||
Public Property IdCtaAcreedores As Integer
|
||||
Public Property IdCtaDocXPagar As Integer
|
||||
Public Property IdCtaAnticipoCliente As Integer
|
||||
Public Property IdCtaAnticipoProveedores As Integer
|
||||
|
||||
Public Property CveCuentaIVAxAcreditar As Integer
|
||||
Public Property CveCuentaIVAAcreditable As Integer
|
||||
Public Property CveCuentaRetIVACirculacion As Integer
|
||||
Public Property CveCuentaRetISRCirculacion As Integer
|
||||
Public Property CveCuentaDSV As Integer
|
||||
Public Property CveCuentaImpuestosLocales As Integer
|
||||
Public Property CveCuentaIEPSxAcreditar As Integer
|
||||
Public Property CveCuentaIEPSAcreditable As Integer
|
||||
Public Property CveCuentaIEPSxTrasladar As Integer
|
||||
Public Property CveCuentaIEPSTrasladado As Integer
|
||||
|
||||
'Nuevos Datos
|
||||
Public Property IdCtaAnticipoProveedores As Integer
|
||||
|
||||
'Nuevos Datos
|
||||
Public Property IdCuentaIEPSxAcreditar As Integer
|
||||
Public Property IdCuentaIEPSAcreditable As Integer
|
||||
Public Property IdCuentaIEPSxTrasladar As Integer
|
||||
|
||||
@@ -2268,7 +2268,6 @@ Namespace Modelos
|
||||
Dim FechaMovimiento As Date = ObjFactura.Fecha
|
||||
Dim IdCtaContable As Integer
|
||||
Dim IdCtaContableCliente As Integer
|
||||
Dim CveCuentaCliente As Integer
|
||||
Dim Concepto As String = ObjFactura.SerieFolio
|
||||
Dim Referencia As String = ObjFactura.SerieFolio
|
||||
Dim Fecha = ObjFactura.Fecha
|
||||
@@ -2282,8 +2281,6 @@ Namespace Modelos
|
||||
Dim CveSubProyectoContabilizar As Integer
|
||||
Dim IdCtaIVAXTrasladar As Integer = 0
|
||||
Dim IdCtaIVATrasladado As Integer = 0
|
||||
Dim CveCuentaIVAxTrasladar As Integer = 0
|
||||
Dim CveCuentaIVATrasladado As Integer = 0
|
||||
Dim SeContabiliza As Boolean = True
|
||||
|
||||
If (UsuarioActual.Empresa.Funcionalidad(343) = "1" AndAlso ObjFactura.TipoDocto = "Ant") Then
|
||||
@@ -2471,7 +2468,6 @@ Namespace Modelos
|
||||
End If
|
||||
|
||||
IdCtaContable = ObjFactura.Cliente.IdCtaContMonedaExtranjera
|
||||
'CveCuenta = ObjFactura.Cliente.CveCuentaMonedaExtranjera
|
||||
End If
|
||||
CveSubProyectoContabilizar = CveSubProyectoVenta
|
||||
ImporteConcepto12 = importeMX.RoundSQL
|
||||
@@ -2847,7 +2843,6 @@ Namespace Modelos
|
||||
|
||||
'CTACONTABLE
|
||||
'IdCtaContable = IdCtaContAnticipos
|
||||
'CveCuenta = CveCuentaAnticipos
|
||||
|
||||
If tipoCambio = 1 Then
|
||||
IdCtaContable = ObjFactura.Cliente.IdCtaContClientes
|
||||
@@ -2996,7 +2991,7 @@ Namespace Modelos
|
||||
End If
|
||||
If sumaAmorticaciones <> 0 Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, sumaAmorticaciones, Referencia, 251, Concepto, FechaMovimiento,
|
||||
ObjFactura.Cliente.IdCtaContClientes, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=sumaAmorticaciones * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuentaCliente, CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then
|
||||
ObjFactura.Cliente.IdCtaContClientes, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=sumaAmorticaciones * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then
|
||||
ErrorPrepoliza = True
|
||||
Else
|
||||
ObjFactura.SeGuardoPrePoliza = True
|
||||
@@ -3052,9 +3047,6 @@ Namespace Modelos
|
||||
IdCtaContable = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaIngresos", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero
|
||||
End If
|
||||
|
||||
|
||||
'CveCuenta = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaIngresosSIG", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero
|
||||
|
||||
If importeMovimiento <> 0 Then
|
||||
|
||||
If IdCtaContable <= 0 Then
|
||||
@@ -3135,8 +3127,6 @@ Namespace Modelos
|
||||
If Row2("CveClasificacion").ToString = "19929" Then IdCtaContable = 1142
|
||||
End If
|
||||
|
||||
'CveCuenta = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaIngresosSIG", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero
|
||||
|
||||
If importeMovimiento <> 0 Then
|
||||
|
||||
If IdCtaContable <= 0 Then
|
||||
@@ -3144,10 +3134,6 @@ Namespace Modelos
|
||||
idCuentaContabilizacion = 0
|
||||
End If
|
||||
|
||||
'If CveCuenta <= 0 Then
|
||||
' CuentasContablesInvalidasSIG.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString + GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}"))
|
||||
' CveCuentaContabilizacion = 0
|
||||
'End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContableAplicar, Concepto, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVentaAplicar, CveVentaAmortizacion:=CveVentaAmortizacionAplicar, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, CveClasificacion:=Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), TipoCambio:=tipoCambio, PorcentajeImpuesto:=Row2("PorcentajeIVA").ToString().ToDecimal) Then
|
||||
ErrorPrepoliza = True
|
||||
@@ -3171,7 +3157,6 @@ Namespace Modelos
|
||||
If importeMovimiento <> 0 AndAlso ObjConta.GetRetCuenta(ConceptoContable, ObjFactura.CveEmpresa) Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.Rows(0)("Conta_IdCuentaDescuentoVenta").ToString().ToEntero()
|
||||
'CveCuenta = ObjConta.DtResultados.Rows(0)("Conta_IdCuentaDescuentoVenta").ToString().ToEntero()
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -3334,20 +3319,18 @@ Namespace Modelos
|
||||
' If importeMovimiento <> 0 Then
|
||||
' 'IVA X TRASLADAR
|
||||
' IdCtaIVAXTrasladar = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar)
|
||||
' CveCuentaIVAxTrasladar = If(CveCuentaIVAxTrasladar > 0, CveCuentaIVAxTrasladar, UsuarioActual.Empresa.CveCuentaIVAxTrasladar)
|
||||
' Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 13, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
|
||||
|
||||
' If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 13, Concepto, Fecha, IdCtaIVAXTrasladar, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=-1, ImporteMX:=importeMX * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuentaIVAxTrasladar, CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuesto) Then
|
||||
' If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 13, Concepto, Fecha, IdCtaIVAXTrasladar, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=-1, ImporteMX:=importeMX * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuesto) Then
|
||||
' ErrorPrepoliza = True
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
' 'IVA PAGADO
|
||||
' IdCtaIVATrasladado = If(IdCtaIVATrasladado > 0, IdCtaIVATrasladado, UsuarioActual.Empresa.IdCuentaIVATrasladado)
|
||||
' CveCuentaIVATrasladado = If(CveCuentaIVATrasladado > 0, CveCuentaIVATrasladado, UsuarioActual.Empresa.CveCuentaIVATrasladado)
|
||||
' Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 61, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
|
||||
|
||||
' If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 61, Concepto, Fecha, IdCtaIVATrasladado, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=-1, ImporteMX:=importeMX * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuentaIVATrasladado, CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuesto) Then
|
||||
' If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 61, Concepto, Fecha, IdCtaIVATrasladado, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=-1, ImporteMX:=importeMX * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuesto) Then
|
||||
' ErrorPrepoliza = True
|
||||
' Exit For
|
||||
' End If
|
||||
@@ -3437,7 +3420,6 @@ Namespace Modelos
|
||||
|
||||
If GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).Rows.Count = 1 Then
|
||||
IdCtaContable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("IdCtaContable").ToString.ToEntero
|
||||
' CveCuenta = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero).Rows(0)("IdCtaContableSIG").ToString.ToEntero
|
||||
End If
|
||||
|
||||
If IdCtaContable <= 0 Then
|
||||
@@ -3445,11 +3427,6 @@ Namespace Modelos
|
||||
idCuentaContabilizacion = 0
|
||||
End If
|
||||
|
||||
'If CveCuenta <= 0 Then
|
||||
' CuentasContablesInvalidasSIG.AppendFormat("<br> {0}", GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero).Rows(0)("NumCuentaMoneda").ToString.ToEntero)
|
||||
' CveCuentaContabilizacion = 0
|
||||
'End If
|
||||
|
||||
'BANCOS
|
||||
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 30, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString)
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, Fecha, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento)) Then
|
||||
@@ -3459,39 +3436,37 @@ Namespace Modelos
|
||||
|
||||
'CLIENTES
|
||||
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 2, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString)
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 2, Concepto, Fecha, IdCtaContableCliente, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuentaCliente, CveSubProyecto:=CveSubProyectoContabilizar) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 2, Concepto, Fecha, IdCtaContableCliente, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar) Then
|
||||
ErrorPrepoliza = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
'IVA X TRASLADAR
|
||||
IdCtaIVAXTrasladar = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar)
|
||||
CveCuentaIVAxTrasladar = If(CveCuentaIVAxTrasladar > 0, CveCuentaIVAxTrasladar, UsuarioActual.Empresa.CveCuentaIVAxTrasladar)
|
||||
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 13, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString)
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, (importeMovimiento * ObjFactura.IVA) / ObjFactura.Total, Referencia, 13, Concepto, Fecha, IdCtaIVAXTrasladar, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IVA) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuentaIVAxTrasladar, CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, (importeMovimiento * ObjFactura.IVA) / ObjFactura.Total, Referencia, 13, Concepto, Fecha, IdCtaIVAXTrasladar, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IVA) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then
|
||||
ErrorPrepoliza = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
'IVA PAGADO
|
||||
IdCtaIVATrasladado = If(IdCtaIVATrasladado > 0, IdCtaIVATrasladado, UsuarioActual.Empresa.IdCuentaIVATrasladado)
|
||||
CveCuentaIVATrasladado = If(CveCuentaIVATrasladado > 0, CveCuentaIVATrasladado, UsuarioActual.Empresa.CveCuentaIVATrasladado)
|
||||
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 61, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString)
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, (importeMovimiento * ObjFactura.IVA) / ObjFactura.Total, Referencia, 61, Concepto, Fecha, IdCtaIVATrasladado, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IVA) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuentaIVATrasladado, CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, (importeMovimiento * ObjFactura.IVA) / ObjFactura.Total, Referencia, 61, Concepto, Fecha, IdCtaIVATrasladado, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IVA) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then
|
||||
ErrorPrepoliza = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
'IEPS X TRASLADAR
|
||||
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 38, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString)
|
||||
If ObjFactura.IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, (importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total, Referencia, 38, Concepto, Fecha, UsuarioActual.Empresa.IdCuentaIEPSxTrasladar, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=UsuarioActual.Empresa.CveCuentaIEPSxTrasladar, CveSubProyecto:=CveSubProyectoContabilizar) Then
|
||||
If ObjFactura.IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, (importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total, Referencia, 38, Concepto, Fecha, UsuarioActual.Empresa.IdCuentaIEPSxTrasladar, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar) Then
|
||||
ErrorPrepoliza = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
'IEPS PAGADO
|
||||
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 39, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString)
|
||||
If ObjFactura.IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, (importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total, Referencia, 39, Concepto, Fecha, UsuarioActual.Empresa.IdCuentaIEPSTrasladado, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=UsuarioActual.Empresa.CveCuentaIEPSTrasladado, CveSubProyecto:=CveSubProyectoContabilizar) Then
|
||||
If ObjFactura.IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, (importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total, Referencia, 39, Concepto, Fecha, UsuarioActual.Empresa.IdCuentaIEPSTrasladado, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar) Then
|
||||
ErrorPrepoliza = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -3515,11 +3490,6 @@ Namespace Modelos
|
||||
idCuentaContabilizacion = 0
|
||||
End If
|
||||
|
||||
'If CveCuenta <= 0 Then
|
||||
' CuentasContablesInvalidasSIG.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
|
||||
' CveCuentaContabilizacion = 0
|
||||
'End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=tipoCambio, Contabilizable:=SeContabiliza) Then
|
||||
ErrorPrepoliza = True
|
||||
Else
|
||||
@@ -3966,13 +3936,11 @@ Namespace Modelos
|
||||
Dim DtCostos = ObjInventario.DtResultados.Copy
|
||||
Dim DtCostosDistinct As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"})
|
||||
Dim IdCtaContable As Integer = 0
|
||||
Dim CveCuenta As Integer = 0
|
||||
Dim ValorInventario As Decimal
|
||||
|
||||
For Each RowInv As DataRow In DtCostosDistinct.Rows
|
||||
ValorInventario = DtCostos.SUM("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).ToString.ToDecimal
|
||||
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
|
||||
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
|
||||
Try
|
||||
If ValorInventario <> 0 Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(Me.CvePrePoliza, False, ValorInventario, Me.SerieFolio, 69, Me.SerieFolio, Me.Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=Me.CveCliente, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveSubProyecto:=Me.CveSubProyecto) Then
|
||||
@@ -3998,7 +3966,6 @@ Namespace Modelos
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
'VALIDA QUE SE HALLAN AGREGADO DETALLES AL MOVIMIENTO
|
||||
If ContadorMovtosDetalles = 0 Then
|
||||
OcurrioError = True
|
||||
@@ -4008,8 +3975,6 @@ Namespace Modelos
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If OcurrioError Then
|
||||
Return -1
|
||||
Else
|
||||
@@ -4121,7 +4086,6 @@ Namespace Modelos
|
||||
TotalCosto = DtCostos.SUMD("Total").RoundSQL
|
||||
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
|
||||
Dim IdCtaContable As Integer = 0
|
||||
Dim CveCuenta As Integer = 0
|
||||
If tmpCostos.Rows.Count > 0 Then
|
||||
Dim TotalCostoAcumulado As Decimal = 0
|
||||
Dim cont As Integer = 1
|
||||
@@ -4137,10 +4101,9 @@ Namespace Modelos
|
||||
|
||||
'Concepto = String.Format("{0} - {1}", Row2("Clasificacion").ToString(), Row2("SubProyecto").ToString())
|
||||
IdCtaContable = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
||||
'CveCuenta = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
||||
'If ValorInventario <> 0 Then
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto69, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto69, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
'End If
|
||||
@@ -4262,7 +4225,6 @@ Namespace Modelos
|
||||
TotalCosto = DtCostos.SUMD("Total").RoundSQL
|
||||
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
|
||||
Dim IdCtaContable As Integer = 0
|
||||
Dim CveCuenta As Integer = 0
|
||||
If tmpCostos.Rows.Count > 0 Then
|
||||
Dim TotalCostoAcumulado As Decimal = 0
|
||||
Dim cont As Integer = 1
|
||||
@@ -4278,10 +4240,9 @@ Namespace Modelos
|
||||
|
||||
'Concepto = String.Format("{0} - {1}", Row2("Clasificacion").ToString(), Row2("SubProyecto").ToString())
|
||||
IdCtaContable = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
||||
'CveCuenta = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
||||
'If ValorInventario <> 0 Then
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto69, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto69, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
'End If
|
||||
@@ -4347,7 +4308,7 @@ Namespace Modelos
|
||||
If factura.DtImpuestosLocales IsNot Nothing AndAlso factura.CvePrePoliza > 0 AndAlso Not factura.TipoDocto.Contiene("Cot", "Rem") Then
|
||||
|
||||
Dim Importe As Decimal
|
||||
Dim IdCtaContable, CveCuenta As Integer
|
||||
Dim IdCtaContable As Integer
|
||||
Dim Concepto As String
|
||||
Dim tipoCambio As Decimal
|
||||
Dim CveSubProyectoContabilizar As Integer = factura.CveSubProyecto
|
||||
@@ -4357,7 +4318,6 @@ Namespace Modelos
|
||||
|
||||
Importe = RowIL("Importe").ToString.ToDecimal * ValorMultiplicador
|
||||
IdCtaContable = RowIL("IdCtaContable").ToString.ToEntero
|
||||
CveCuenta = RowIL("IdCtaContable").ToString.ToEntero
|
||||
Concepto = factura.SerieFolio
|
||||
|
||||
If factura.CveMoneda = 2 AndAlso factura.TipoCambio > 0 Then
|
||||
@@ -5107,9 +5067,7 @@ Namespace Modelos
|
||||
|
||||
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
|
||||
Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {CveAlmacenMovimiento}").ToEntero
|
||||
'Dim CveCuentaAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {CveAlmacenDevolucion}").ToEntero
|
||||
Dim IdCtaContable As Integer = 0
|
||||
Dim CveCuenta As Integer = 0
|
||||
If tmpCostos.Rows.Count > 0 Then
|
||||
|
||||
Dim Multiplicador As Decimal = -1D
|
||||
@@ -6133,6 +6091,8 @@ Namespace Modelos
|
||||
Public Property CveDireccionEnvio As Integer
|
||||
Public Property RefacturacionGeneroNC As Boolean = False
|
||||
Public Property Pagado As Decimal
|
||||
Public Property PagadoBancos As Decimal
|
||||
Public Property PagadoCveIE As Integer
|
||||
Public Property DescuentoProntoPago As Decimal
|
||||
Public Property CveVentaRNCCargo As Integer
|
||||
Public Property FacturarSucursal As Boolean = False
|
||||
@@ -6503,6 +6463,7 @@ Namespace Modelos
|
||||
Public Property FordGSDB As String = ""
|
||||
Public Property FordASN As String = ""
|
||||
Public Property FemsaFactura As Modelos.FemsaFactura
|
||||
Public Property DevolucionImportePagado As Decimal = 0
|
||||
|
||||
Public Sub SetSubProyecto()
|
||||
If CveSubProyecto > 0 AndAlso UsuarioActual IsNot Nothing Then
|
||||
@@ -7735,24 +7696,6 @@ Namespace Modelos
|
||||
End Property
|
||||
|
||||
|
||||
'Property GlobalDTBancosCuentas(CveUsuario As Integer, Optional CveCuenta As Integer = -1, Optional Estatus As Integer = 1) As DataTable
|
||||
' Get
|
||||
|
||||
' Dim Str As String = String.Format("CveEmpresa = {0} ", UsuarioActual.CveEmpresa)
|
||||
' If CveUsuario > -1 Then Str = String.Format("{0} AND CveUsuario = {1}", Str, CveUsuario)
|
||||
' If CveCuenta > -1 Then Str = String.Format("{0} AND CveCuenta = {1}", Str, CveCuenta)
|
||||
' If Estatus > -1 Then Str = String.Format("{0} AND Estatus = '{1}'", Str, If(Estatus = 1, "Activo", "Inactivo"))
|
||||
|
||||
' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTBancosCuentas"), DataTable), Str, "", DataViewRowState.CurrentRows)
|
||||
' GlobalDTBancosCuentas = Dv.ToTable
|
||||
' Dv.Dispose()
|
||||
' 'GlobalDTBancosCuentas = DirectCast(HttpContext.Current.Application("GlobalDTBancosCuentas"), DataTable)
|
||||
' End Get
|
||||
' Set(value As DataTable)
|
||||
' HttpContext.Current.Application("GlobalDTBancosCuentas") = value
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
Property GlobalDTBancosCuentas(CveUsuario As Integer, Optional CveCuenta As Integer = -1, Optional Estatus As Integer = 1, Optional CveEmpresa As Integer = -1) As DataTable
|
||||
Get
|
||||
Dim AppNombre As String = String.Format("GlobalDTBancosCuentas-{0}", CveEmpresa)
|
||||
@@ -9846,12 +9789,6 @@ Namespace Modelos
|
||||
Public Property IdCtaContAnticipos As Integer
|
||||
Public Property IdCtaContRetIVA As Integer
|
||||
Public Property IdCtaContRetISR As Integer
|
||||
Public Property CveCuentaClientes As Integer
|
||||
Public Property CveCuentaMonedaExtranjera As Integer
|
||||
Public Property CveCuentaComplementaria As Integer
|
||||
Public Property CveCuentaAnticipos As Integer
|
||||
Public Property CveCuentaRetIVA As Integer
|
||||
Public Property CveCuentaRetISR As Integer
|
||||
Public Property ConvenioCIE As String
|
||||
Public Property FormaFacturacion As String
|
||||
Public Property LimiteCredito As Decimal
|
||||
|
||||
@@ -810,6 +810,18 @@ Public Class Timbrado
|
||||
Dim tCvePAC As Integer = UsuarioActual.Empresa.CvePAC
|
||||
If CvePACEspecial <> -1 Then tCvePAC = CvePACEspecial
|
||||
|
||||
'validación especial.
|
||||
If Ventas.TipoDocto.Contiene("Ing", "Dev") Then
|
||||
|
||||
Dim CodigoIncorrecto As Integer = (From c In Ventas.Timbre.Conceptos Where (c.ClaveProdServ = "84111506" Or c.ClaveProdServ = "01010101")
|
||||
Select c.ClaveProdServ).Count()
|
||||
If CodigoIncorrecto > 0 Then
|
||||
MensajeErrorCFDI = "SAT - Hay un concepto con Codigo no permitido."
|
||||
Return False
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Select Case tCvePAC
|
||||
Case 1
|
||||
' Retorno = TimbrarFacturaBIInform33(UsuarioActual, Ventas, FM, TmpDTConceptos, TmpDTImpuestos, TmpDT7Eleven, TmpDTComplementos, Ruta, LstFordASN, FordGSDBM, ObjV)
|
||||
|
||||
@@ -49,21 +49,13 @@ Public Class E141 : Implements IHttpHandler
|
||||
End Property
|
||||
Public ReadOnly Property TokenAutorizacion As String
|
||||
Get
|
||||
If EsProduccion Then
|
||||
Return "$2y$10$EZlXnFrhUc4aRVwjy5/v0.3JPdFNjyeANDc64YXJ5eHD8pMsv93Q."
|
||||
Else
|
||||
Return "$2y$10$8Mk3YeIkJESilIwD.U5dG.SsA4JloycJKbaGls8TNEw/AKBE1qane"
|
||||
End If
|
||||
Return "$2y$10$LGqtRWUloKQmAt.jcUldc.PmS5LJ6l.WU2w1G4PBOTLMVKZRNQFPS"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property URLBase As String
|
||||
Get
|
||||
If EsProduccion Then
|
||||
Return "https://services.fidelityapps.mx/"
|
||||
Else
|
||||
Return "https://econollantas-pruebas.fidelityapps.mx/"
|
||||
End If
|
||||
Return "https://services.fidelityapps.mx/"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -1852,6 +1844,7 @@ Public Class E141 : Implements IHttpHandler
|
||||
httpClient.Timeout = New TimeSpan(0, 5, 0)
|
||||
Using request = New HttpRequestMessage(HttpMethod.Post, New Uri(url))
|
||||
request.Headers.Add("X-PUBLIC-AUTH", TokenAutorizacion)
|
||||
request.Headers.Add("X-Authentication", TokenAutorizacion)
|
||||
|
||||
Using content = New StringContent(payload, Encoding.UTF8, "application/json")
|
||||
request.Content = content
|
||||
|
||||
@@ -308,7 +308,6 @@ Partial Class Bancos_DepositoTerminal
|
||||
Dim importeMX As Decimal
|
||||
Dim FechaMovimiento As Date = TxtFecha.Text.ToDate
|
||||
Dim IdCtaContable As Integer = 0
|
||||
Dim CveCuenta As Integer = 0
|
||||
Dim ConceptoMovimiento As String = ObjContabilidad.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, NombreComercial, gvr.DataKey("SerieFolio").ToString, TxtFolio.ToString)
|
||||
Dim Referencia As String = gvr.DataKey("SerieFolio").ToString
|
||||
Dim CveSubProyecto As Integer = gvr.DataKey("CveSubProyecto").ToEntero
|
||||
@@ -320,20 +319,17 @@ Partial Class Bancos_DepositoTerminal
|
||||
|
||||
If tipoCambioVenta = 1 Then
|
||||
IdCtaContable = IdCuentaCliente
|
||||
CveCuenta = CveCuentaCliente
|
||||
Else
|
||||
ConceptoMovimiento += $" TC:{tipoCambioVenta} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
IdCtaContable = IdCtaContComplementaria
|
||||
CveCuenta = CveCuentaComplementaria
|
||||
If ImporteMovimiento <> 0 AndAlso IdCtaContable > 0 Then
|
||||
importeMX = ImporteMovimiento
|
||||
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, TipoMovimiento, 0, Referencia, ConceptoContable, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyecto, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteMovimiento * tipoCambioVenta - ImporteMovimiento, CveCuenta:=CveCuenta) Then
|
||||
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, TipoMovimiento, 0, Referencia, ConceptoContable, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyecto, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteMovimiento * tipoCambioVenta - ImporteMovimiento) Then
|
||||
MsgError = "No se pudo insertar la póliza"
|
||||
End If
|
||||
End If
|
||||
|
||||
IdCtaContable = IdCtaContMonedaExtranjera
|
||||
CveCuenta = CveCuentaMonedaExtranjera
|
||||
End If
|
||||
|
||||
Case 8 'Ret IVA x Trasladar
|
||||
@@ -351,19 +347,9 @@ Partial Class Bancos_DepositoTerminal
|
||||
IdCtaContable = ObjContabilidad.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'Conta SIG
|
||||
If CveCuentaRetIVA <> 0 Then
|
||||
CveCuenta = CveCuentaRetIVA
|
||||
Else
|
||||
If ObjContabilidad.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
|
||||
If ObjContabilidad.DtResultados.Rows.Count > 0 Then
|
||||
CveCuenta = ObjContabilidad.DtResultados.Rows(0)("IdCuentaRetIVACirculacionSIG").ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Case 9 'Ret ISR x Trasladar
|
||||
|
||||
ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago
|
||||
@@ -379,25 +365,13 @@ Partial Class Bancos_DepositoTerminal
|
||||
IdCtaContable = ObjContabilidad.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'Conta SIG
|
||||
If CveCuentaRetISR <> 0 Then
|
||||
CveCuenta = CveCuentaRetISR
|
||||
Else
|
||||
If ObjContabilidad.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
|
||||
If ObjContabilidad.DtResultados.Rows.Count > 0 Then
|
||||
CveCuenta = ObjContabilidad.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Case 13 'Iva por Trasladar
|
||||
|
||||
ImporteMovimiento = gvr.DataKey("IVA").ToDecimal * PorcentajePago
|
||||
importeMX = Math.Round(ImporteMovimiento * tipoCambioVenta, 2)
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaIVAxTrasladar
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaIVAxTrasladar
|
||||
If tipoCambioVenta > 1 Then ConceptoMovimiento += $" TC:{tipoCambioVenta} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
|
||||
Case 62 'Ret IVA Trasladado
|
||||
@@ -415,19 +389,9 @@ Partial Class Bancos_DepositoTerminal
|
||||
IdCtaContable = ObjContabilidad.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'Conta SIG
|
||||
If CveCuentaRetIVA <> 0 Then
|
||||
CveCuenta = CveCuentaRetIVA
|
||||
Else
|
||||
If ObjContabilidad.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
|
||||
If ObjContabilidad.DtResultados.Rows.Count > 0 Then
|
||||
CveCuenta = ObjContabilidad.DtResultados.Rows(0)("IdCuentaRetIVACirculacionSIG").ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Case 63 'Ret ISR Trasladado
|
||||
|
||||
ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago
|
||||
@@ -443,25 +407,13 @@ Partial Class Bancos_DepositoTerminal
|
||||
IdCtaContable = ObjContabilidad.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'Conta SIG
|
||||
If CveCuentaRetISR <> 0 Then
|
||||
CveCuenta = CveCuentaRetISR
|
||||
Else
|
||||
If ObjContabilidad.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
|
||||
If ObjContabilidad.DtResultados.Rows.Count > 0 Then
|
||||
CveCuenta = ObjContabilidad.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Case 61 'Iva Trasladado
|
||||
|
||||
ImporteMovimiento = gvr.DataKey("IVA").ToDecimal * PorcentajePago
|
||||
importeMX = Math.Round(ImporteMovimiento * tipoCambioManual, 2)
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaIVATrasladado
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaIVATrasladado
|
||||
If tipoCambioManual > 1 Then ConceptoMovimiento += $" TC:{tipoCambioManual} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
|
||||
Case 38 'IEPS por trasladar
|
||||
@@ -470,14 +422,12 @@ Partial Class Bancos_DepositoTerminal
|
||||
importeMX = Math.Round(ImporteMovimiento * tipoCambioVenta, 2)
|
||||
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSxTrasladar
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaIEPSxTrasladar
|
||||
|
||||
Case 39 'IEPS Trasladado
|
||||
ImporteMovimiento = gvr.DataKey("IEPS").ToDecimal * PorcentajePago
|
||||
importeMX = Math.Round(ImporteMovimiento * tipoCambioManual, 2)
|
||||
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSTrasladado
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaIEPSTrasladado
|
||||
|
||||
Case 78 'Otros Ingresos
|
||||
If ChkAjusteOI.Checked Then
|
||||
@@ -500,15 +450,9 @@ Partial Class Bancos_DepositoTerminal
|
||||
If (IdCtaContable < 1 Or IdCuentaBancaria < 1) Then
|
||||
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
|
||||
idCuentaContabilizacion = 0
|
||||
End If
|
||||
|
||||
'Conta SIG
|
||||
If (CveCuenta < 1 Or CveCuentaBancaria < 1) Then
|
||||
CuentasContablesInvalidasSIG.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
|
||||
CveCuentaContabilizacion = 0
|
||||
End If
|
||||
|
||||
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, TipoMovimiento, ImporteMovimiento, Referencia, ConceptoContable, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyecto, gvr.DataKey("CveCliente").ToEntero, ImporteMX:=importeMX, CveCuenta:=CveCuenta) Then
|
||||
End If
|
||||
|
||||
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, TipoMovimiento, ImporteMovimiento, Referencia, ConceptoContable, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyecto, gvr.DataKey("CveCliente").ToEntero, ImporteMX:=importeMX) Then
|
||||
MsgError = "No se pudo insertar la póliza"
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -360,8 +360,8 @@
|
||||
<asp:GridView ID="GvExcesos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Eventos" GridLines="none" ToolTip="Listado de Eventos" CssClass="table table-striped table-hover Widthall">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="VelocidadMaxima" ItemStyle-Width="25%" HeaderText="Velocidad Máxima" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="TiempoDetenido" ItemStyle-Width="25%" HeaderText="Tiempo Detenido" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="FechaTrama" ItemStyle-Width="25%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Direccion" ItemStyle-Width="60%" HeaderText="Dirección" ItemStyle-HorizontalAlign="Left" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
|
||||
@@ -186,7 +186,17 @@ Partial Class GPS_TrayectoDetalle
|
||||
GvIgnicion.DataSource = DsDatos.Tables(1)
|
||||
GvIgnicion.DataBind()
|
||||
|
||||
GvExcesos.DataSource = DsDatos.Tables(2)
|
||||
Dim DtExcesos As DataTable = DsDatos.Tables(2)
|
||||
|
||||
Dim Direcciones = ConsultarDirecciones(DtExcesos)
|
||||
|
||||
If Direcciones IsNot Nothing Then
|
||||
For Each Dir As JObject In Direcciones
|
||||
DtExcesos.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString()
|
||||
Next
|
||||
End If
|
||||
|
||||
GvExcesos.DataSource = DtExcesos
|
||||
GvExcesos.DataBind()
|
||||
|
||||
GvRalenti.DataSource = DsDatos.Tables(3)
|
||||
|
||||
@@ -135,6 +135,8 @@
|
||||
<asp:BoundField DataField="PendientePorSurtir" ItemStyle-HorizontalAlign="Right" HeaderText="Pendiente Por Surtir" DataFormatString="{0:#,###.######}" />
|
||||
<asp:BoundField DataField="ExistenciaFinal" ItemStyle-HorizontalAlign="Right" HeaderText="Existencia Real" DataFormatString="{0:#,###.######}" />
|
||||
<asp:BoundField DataField="CantidadDisponibleInv" ItemStyle-HorizontalAlign="Right" HeaderText="Pendiente Por Recibir" DataFormatString="{0:#,###.######}" Visible="false"/>
|
||||
<%-- <asp:BoundField DataField="Importe" ItemStyle-HorizontalAlign="Right" HeaderText="Precio Neto" DataFormatString="{0:N2}"/>
|
||||
<asp:BoundField DataField="ImportePromocion" ItemStyle-HorizontalAlign="Right" HeaderText="Precio Promoción" DataFormatString="{0:N2}"/>--%>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
@@ -147,6 +149,7 @@
|
||||
<asp:BoundField DataField="PendientePorSurtir" ItemStyle-HorizontalAlign="Right" HeaderText="Pendiente Por Surtir" DataFormatString="{0:#,###.######}" />
|
||||
<asp:BoundField DataField="ExistenciaFinal" ItemStyle-HorizontalAlign="Right" HeaderText="Existencia Real" DataFormatString="{0:#,###.######}" />
|
||||
<asp:BoundField DataField="Importe" ItemStyle-HorizontalAlign="Right" HeaderText="Precio Neto" DataFormatString="{0:N2}"/>
|
||||
<asp:BoundField DataField="ImportePromocion" ItemStyle-HorizontalAlign="Right" HeaderText="Precio Promoción" DataFormatString="{0:N2}"/>
|
||||
<asp:BoundField DataField="CantidadDisponibleInv" ItemStyle-HorizontalAlign="Right" HeaderText="Pendiente Por Recibir" DataFormatString="{0:#,###.######}" Visible="false"/>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
@@ -2560,11 +2560,12 @@ Partial Class Inventarios_RecepcionUsados
|
||||
Case "0" ' USADOS
|
||||
CvePS = Row.DataKey("CvePS").ToEntero()
|
||||
Case "1" ' AJUSTE/GARANTIA
|
||||
Dim drDatos As DataRow = GlobalDTAcumTamaños().FiltroPrimero(String.Format("CveTamaño = {0} AND CveEmpresa = {1}", CveTamaño, UsuarioActual.CveEmpresa))
|
||||
CvePS = Row.DataKey("CvePS").ToEntero()
|
||||
'Dim drDatos As DataRow = GlobalDTAcumTamaños().FiltroPrimero(String.Format("CveTamaño = {0} AND CveEmpresa = {1}", CveTamaño, UsuarioActual.CveEmpresa))
|
||||
|
||||
If drDatos IsNot Nothing Then
|
||||
CvePS = drDatos.Item("CvePSCargo").ToString.ToEntero
|
||||
End If
|
||||
'If drDatos IsNot Nothing Then
|
||||
' CvePS = drDatos.Item("CvePSCargo").ToString.ToEntero
|
||||
'End If
|
||||
End Select
|
||||
|
||||
If CvePS > 0 Then
|
||||
@@ -3104,28 +3105,37 @@ Partial Class Inventarios_RecepcionUsados
|
||||
End If
|
||||
Dim drDatos As DataRow = GlobalDTAcumTamaños().FiltroPrimero(String.Format("CveTamaño = {0} AND CveEmpresa = {1}", CveTamaño, UsuarioActual.CveEmpresa))
|
||||
|
||||
Dim Importe As Decimal = 0
|
||||
Dim drTamañoPS As DataRow = Nothing
|
||||
|
||||
DtMovimientos.Rows.Clear()
|
||||
|
||||
' USADOS
|
||||
If drDatos IsNot Nothing Then
|
||||
Dim Importe As Decimal = drDatos("Cargo").ToString.ToDecimal
|
||||
Dim drTamañoPS As DataRow = Nothing
|
||||
If RblUsadosAjuste.SelectedValue = "0" Then
|
||||
CvePS = drDatos.Item("CvePSCargo").ToString.ToEntero
|
||||
End If
|
||||
Importe = drDatos("Cargo").ToString.ToDecimal
|
||||
Else
|
||||
Importe = TxtImporteAjuste.Text.ToDecimal
|
||||
End If
|
||||
|
||||
DtMovimientos.Rows.Clear()
|
||||
|
||||
Select Case RblUsadosAjuste.SelectedValue
|
||||
Case "0" ' USADOS
|
||||
CvePS = drDatos.Item("CvePSCargo").ToString.ToEntero
|
||||
Case "1" ' AJUSTE/GARANTIA
|
||||
CvePS = DdlPSAjuste.SelectedValue.ToEntero
|
||||
End Select
|
||||
'AJUSTE/GARANTIA
|
||||
If RblUsadosAjuste.SelectedValue = "1" Then
|
||||
CvePS = DdlPSAjuste.SelectedValue.ToEntero
|
||||
End If
|
||||
|
||||
If CvePS > 0 Then
|
||||
If ObjPS.GetPS(CvePS, -1, UsuarioActual.CveEmpresa) Then
|
||||
drTamañoPS = ObjPS.DtResultados.FiltroPrimero("")
|
||||
'CveTamaño = -1 'limpio esta variable para que no se registre dos veces en la clase Modelos
|
||||
AddNew(drTamañoPS.Item("CvePS").ToString.ToEntero, drTamañoPS.Item("PSCodigo").ToString, drTamañoPS.Item("CveUM").ToString.ToEntero, drTamañoPS.Item("UnidadMedida").ToString, 1.0, Importe,
|
||||
"", "-1", "-1", "-1", "", "", -1, "", "", CveTamaño)
|
||||
"", "-1", "-1", "-1", "", "", -1, "", "", CveTamaño)
|
||||
End If
|
||||
Else
|
||||
Alert("No se pudo cargar el producto", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al agregar el producto", ex)
|
||||
End Try
|
||||
|
||||
@@ -803,14 +803,13 @@ Partial Class Inventarios_Remanufactura
|
||||
FechaMovimiento = ObjFactura.FechaPago
|
||||
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
|
||||
IdCtaContable = ObjFactura.Cliente.IdCtaContClientes
|
||||
CveCuenta = ObjFactura.Cliente.CveCuentaClientes
|
||||
|
||||
If importeMovimiento <> 0 Then
|
||||
If IdCtaContable <= 0 Then
|
||||
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
|
||||
idCuentaContabilizacion = 0
|
||||
End If
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then
|
||||
ErrorPrepoliza = True
|
||||
Else
|
||||
ViewState("SeGuardoPrePoliza") = True
|
||||
|
||||
@@ -463,12 +463,12 @@ Partial Class OC
|
||||
ViewState("CveConfianzaProveedor") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveProveedorOrignal As Integer
|
||||
Private Property CveProveedorOriginal As Integer
|
||||
Get
|
||||
Return IfNull(ViewState("CveProveedorOrignal"), -1).ToString().ToEntero()
|
||||
Return IfNull(ViewState("CveProveedorOriginal"), -1).ToString().ToEntero()
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveProveedorOrignal") = value
|
||||
ViewState("CveProveedorOriginal") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveEstatusSupervisada As Integer
|
||||
@@ -580,6 +580,7 @@ Partial Class OC
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
CargaDatosAgregarPS()
|
||||
CveProveedorOriginal = -1
|
||||
'MODALIDAD MULTIEMPRESA
|
||||
CveEmpresaActual = UsuarioActual.CveEmpresa
|
||||
CargaEstatusUsuariosClasificaciones()
|
||||
@@ -1439,7 +1440,7 @@ Partial Class OC
|
||||
|
||||
DdlProveedores.SelectedValue = objOC.CveProveedor.ToString
|
||||
If DdlProveedores.SelectedValue.ToEntero > 0 Then
|
||||
CveProveedorOrignal = DdlProveedores.SelectedValue.ToEntero
|
||||
CveProveedorOriginal = objOC.CveProveedor
|
||||
DdlProveedores.SelectedText = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltraParametros($"CveProveedor = {objOC.CveProveedor}").Rows(0)("RazonSocial").ToString
|
||||
Else
|
||||
DdlProveedores.SelectedText = "-"
|
||||
@@ -2727,7 +2728,7 @@ Partial Class OC
|
||||
DdlVendedor.SelectedValue.ToEntero, txtobsprioridad.Text, IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1),
|
||||
Guia:=TxtGuia.Text.Trim, IEPS:=TxtIEPS.Text.ToDecimal, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, pCveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, CveProveedorContacto:=CveProveedorContacto,
|
||||
PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2)) Then
|
||||
If CveProveedorOrignal <> CveProveedor Then
|
||||
If CveProveedorOriginal <> CveProveedor Then
|
||||
If Not ObjConta.UpdateProveedorPoliza(CveOrdenCompra, CveProveedor, Proveedor) Then
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
@@ -766,8 +766,7 @@ Partial Class Ventas_PortalCliente
|
||||
Dim TipoMovimiento = False
|
||||
Dim ImporteMovimiento = 0.0D
|
||||
Dim importeMX = 0.0D
|
||||
Dim IdCtaContable = 0
|
||||
Dim CveCuenta = 0
|
||||
Dim IdCtaContable = 0
|
||||
Dim ConceptoMovimiento = ""
|
||||
Dim Referencia = ""
|
||||
Dim CveSubProyecto = -1
|
||||
@@ -810,7 +809,6 @@ Partial Class Ventas_PortalCliente
|
||||
ImporteMovimiento = 0
|
||||
importeMX = 0
|
||||
IdCtaContable = 0
|
||||
CveCuenta = 0
|
||||
PorcentajeImpuesto = 0
|
||||
ConceptoMovimiento = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, LtlCliente.Text, DrPago("Factura").ToString, DrPago("Factura").ToString)
|
||||
'VALORES DE LA VENTA
|
||||
@@ -843,14 +841,12 @@ Partial Class Ventas_PortalCliente
|
||||
|
||||
If CveMonedaVenta = 1 Then
|
||||
IdCtaContable = IdCuentaCliente
|
||||
CveCuenta = CveCuentacliente
|
||||
Else
|
||||
IdCtaContable = IdCtaContMonedaExtranjera
|
||||
CveCuenta = CveCuentaComplementaria
|
||||
ConceptoMovimiento += $" TC:{TCPago} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
|
||||
If ImporteMovimiento <> 0 AndAlso IdCtaContable > 0 Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Referencia, 207, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, -1, CveVenta, -1, CveSubProyecto, CveCliente, ImporteMX:=(importeMX - ImporteMovimiento).RoundSQL(), ImporteME:=ImporteMovimiento, CveCuenta:=CveCuenta, TipoCambio:=TCVenta) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Referencia, 207, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, -1, CveVenta, -1, CveSubProyecto, CveCliente, ImporteMX:=(importeMX - ImporteMovimiento).RoundSQL(), ImporteME:=ImporteMovimiento, TipoCambio:=TCVenta) Then
|
||||
TieneError = True
|
||||
MensajeError.Append("No se pudo insertar el detalle de pago de la póliza<br>")
|
||||
Exit For
|
||||
@@ -858,7 +854,6 @@ Partial Class Ventas_PortalCliente
|
||||
End If
|
||||
|
||||
IdCtaContable = IdCtaContMonedaExtranjera
|
||||
CveCuenta = CveCuentaMonedaExtranjera
|
||||
End If
|
||||
|
||||
Case 134 'PAGO INTERMEDIARIO
|
||||
@@ -882,7 +877,6 @@ Partial Class Ventas_PortalCliente
|
||||
TCGeneral = TCVenta
|
||||
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaIVAxTrasladar
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaIVAxTrasladar
|
||||
If TCVenta > 1 Then ConceptoMovimiento += $" TC:{TCVenta} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
|
||||
Case 61 'IVA TRASLADADO
|
||||
@@ -900,7 +894,6 @@ Partial Class Ventas_PortalCliente
|
||||
TCGeneral = TCFluctuacion
|
||||
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaIVATrasladado
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaIVATrasladado
|
||||
If TCFluctuacion > 1 Then ConceptoMovimiento += $" TC:{TCFluctuacion} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
|
||||
Case 8 'RETIVA X TRASLADAR
|
||||
@@ -926,16 +919,8 @@ Partial Class Ventas_PortalCliente
|
||||
If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.FiltroPrimeroValor("IdCuentaRetIVACirculacion").ToEntero
|
||||
End If
|
||||
End If
|
||||
|
||||
'Conta SIG
|
||||
If CveCuentaRetIVA <> 0 Then
|
||||
CveCuenta = CveCuentaRetIVA
|
||||
Else
|
||||
If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
CveCuenta = ObjConta.DtResultados.FiltroPrimeroValor("IdCuentaRetIVACirculacionSIG").ToEntero
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Case 62 'RETIVA TRASLADADO
|
||||
If CveMonedaVenta = 1 Then
|
||||
ImporteMovimiento = RetIVAVenta * PorcentajePago
|
||||
@@ -959,17 +944,9 @@ Partial Class Ventas_PortalCliente
|
||||
If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.FiltroPrimeroValor("IdCuentaRetIVACirculacion").ToEntero
|
||||
End If
|
||||
End If
|
||||
|
||||
'Conta SIG
|
||||
If CveCuentaRetIVA <> 0 Then
|
||||
CveCuenta = CveCuentaRetIVA
|
||||
Else
|
||||
If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
CveCuenta = ObjConta.DtResultados.FiltroPrimeroValor("IdCuentaRetIVACirculacionSIG").ToEntero
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Case 9 'RETISR X TRASLADAR
|
||||
If CveMonedaVenta = 1 Then
|
||||
ImporteMovimiento = RetISRVenta * PorcentajePago
|
||||
@@ -993,17 +970,9 @@ Partial Class Ventas_PortalCliente
|
||||
If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.FiltroPrimeroValor("IdCuentaRetISRCirculacion").ToEntero
|
||||
End If
|
||||
End If
|
||||
|
||||
'Conta SIG
|
||||
If CveCuentaRetISR <> 0 Then
|
||||
CveCuenta = CveCuentaRetISR
|
||||
Else
|
||||
If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
CveCuenta = ObjConta.DtResultados.FiltroPrimeroValor("IdCuentaRetISRCirculacionSIG").ToEntero
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Case 63 'RETISR TRASLADADO
|
||||
If CveMonedaVenta = 1 Then
|
||||
ImporteMovimiento = RetIVAVenta * PorcentajePago
|
||||
@@ -1027,17 +996,8 @@ Partial Class Ventas_PortalCliente
|
||||
If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.FiltroPrimeroValor("IdCuentaRetISRCirculacion").ToEntero
|
||||
End If
|
||||
End If
|
||||
|
||||
'Conta SIG
|
||||
If CveCuentaRetISR <> 0 Then
|
||||
CveCuenta = CveCuentaRetISR
|
||||
Else
|
||||
If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
CveCuenta = ObjConta.DtResultados.FiltroPrimeroValor("IdCuentaRetISRCirculacionSIG").ToEntero
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Case 38 'IEPS X TRASLADAR
|
||||
If CveMonedaVenta = 1 Then
|
||||
ImporteMovimiento = IEPSVenta * PorcentajePago
|
||||
@@ -1053,7 +1013,6 @@ Partial Class Ventas_PortalCliente
|
||||
TCGeneral = TCVenta
|
||||
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSxTrasladar
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaIEPSxTrasladar
|
||||
If TCVenta > 1 Then ConceptoMovimiento += $" TC:{TCVenta} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
|
||||
Case 39 'IEPS TRASLADADO
|
||||
@@ -1071,14 +1030,12 @@ Partial Class Ventas_PortalCliente
|
||||
TCGeneral = TCFluctuacion
|
||||
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSTrasladado
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaIEPSTrasladado
|
||||
If TCFluctuacion > 1 Then ConceptoMovimiento += $" TC:{TCFluctuacion} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
|
||||
Case 64 'GANANCIA
|
||||
Continue For 'SKIPEA
|
||||
If CveMonedaVenta <> 1 Then
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria
|
||||
If TCPago > TCVenta AndAlso CveMonedaVenta = 2 Then
|
||||
ImporteMovimiento = (ImportePago * TCPago) - (ImportePago * TCVenta)
|
||||
ImporteMovimiento -= ((IVAVenta * PorcentajePago) * TCFluctuacion) - ((IVAVenta * PorcentajePago) * TCVenta)
|
||||
@@ -1094,7 +1051,6 @@ Partial Class Ventas_PortalCliente
|
||||
Continue For 'SKIPEA
|
||||
If CveMonedaVenta <> 1 Then
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
|
||||
If TCPago < TCVenta AndAlso CveMonedaVenta = 2 Then
|
||||
ImporteMovimiento = (ImportePago * TCPago) - (ImportePago * TCVenta)
|
||||
ImporteMovimiento -= ((IVAVenta * PorcentajePago) * TCFluctuacion) - ((IVAVenta * PorcentajePago) * TCVenta)
|
||||
@@ -1110,7 +1066,7 @@ Partial Class Ventas_PortalCliente
|
||||
|
||||
'AGREGA PREPOLIZA DETALLE
|
||||
If ImporteMovimiento <> 0 Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, Referencia, ConceptoContable, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, -1, CveVenta, -1, CveSubProyecto, CveCliente, CveProveedorContabilizar, ImporteMX:=importeMX, CveCuenta:=CveCuenta, TipoCambio:=TCGeneral, PorcentajeImpuesto:=PorcentajeImpuesto) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, Referencia, ConceptoContable, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, -1, CveVenta, -1, CveSubProyecto, CveCliente, CveProveedorContabilizar, ImporteMX:=importeMX, TipoCambio:=TCGeneral, PorcentajeImpuesto:=PorcentajeImpuesto) Then
|
||||
TieneError = True
|
||||
MensajeError.Append("No se pudo insertar el detalle de la póliza<br>")
|
||||
Exit For
|
||||
@@ -1954,7 +1910,7 @@ Partial Class Ventas_PortalCliente
|
||||
End Select
|
||||
|
||||
If importeMovimiento <> 0 Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, If(ConceptoContable = 30, ObjFactura.Cliente.IdCtaContClientes, ObjFactura.Cliente.IdCtaContAnticipos), -1, CveIE:=CveIE, CveCompra:=-1, CveProveedor:=-1, CvePersonal:=-1, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=importeMovimiento, ImporteME:=tImporteMonedaExtranjera, TipoCambio:=TxtTipoCambio.Text.ToDecimal, CveCuenta:=If(ConceptoContable = 30, ObjFactura.Cliente.CveCuentaClientes, ObjFactura.Cliente.CveCuentaAnticipos)) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, If(ConceptoContable = 30, ObjFactura.Cliente.IdCtaContClientes, ObjFactura.Cliente.IdCtaContAnticipos), -1, CveIE:=CveIE, CveCompra:=-1, CveProveedor:=-1, CvePersonal:=-1, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=importeMovimiento, ImporteME:=tImporteMonedaExtranjera, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then
|
||||
MsgError = "Ocurrió un error al registrar el asiento del ingreso."
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -307,6 +307,13 @@
|
||||
<ajax:FilteredTextBoxExtender ID="FTBEDescuentoAutorizado" TargetControlID="TxtDescuentoAutorizado" FilterType="Numbers,Custom" ValidChars="." runat="server" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="TrLimiteAutorizacion" runat="server" visible="false">
|
||||
<td>Límite Cédito Autorizado:</td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtLimiteAutorizado" MaxLength="20" CssClass="form-control" runat="server"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FTELimiteAutorizado" TargetControlID="TxtLimiteAutorizado" FilterType="Numbers,Custom" ValidChars="." runat="server" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
@@ -447,6 +447,7 @@ Partial Class Sistemas_UsuarioDetalle
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531).ToString = "1" Then
|
||||
TrDescuentoAutorizado.Visible = True
|
||||
TrLimiteAutorizacion.Visible = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(599) = "1" Then
|
||||
@@ -586,8 +587,8 @@ Partial Class Sistemas_UsuarioDetalle
|
||||
LblFechaCaptura.Text = ObjUsuario.Fecha.ToShortDateString
|
||||
LblUsuarioCapturo.Text = ObjUsuario.UsuarioCreo
|
||||
|
||||
TxtDescuentoAutorizado.Text = ObjUsuario.DescuentoAutorizado.FormatoNumero
|
||||
|
||||
TxtDescuentoAutorizado.Text = ObjUsuario.DescuentoAutorizado.FormatoNumero
|
||||
TxtLimiteAutorizado.Text = ObjUsuario.DtResultados.Rows(0)("LimiteCreditoAutorizado").ToString()
|
||||
Else
|
||||
Alert("El Usuario Solicitado no existe, Revise su búsqueda.", TipoMensaje.MsgAdvertencia)
|
||||
BtnGuardar.Enabled = False
|
||||
@@ -831,7 +832,7 @@ Partial Class Sistemas_UsuarioDetalle
|
||||
|
||||
'REGISTRA O ACTUALIZA LOS DATOS GENERALES DEL USUARIO
|
||||
If CveUsuario = -1 Then
|
||||
CveUsuario = ObjUsuarios.AddUsuario(TxtUsuario.Text.Trim, Encripta(ContraseñaPredeterminada), TxtNombre.Text.Trim, DdlRol.SelectedValue.ToEntero, TxtCorreo.Text.Trim, DdlPersonal.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, ChkCambiarContraseña.Checked, UsuarioActual.CveUsuario, DdlEmpresa.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, CveAlmacenAsignado:=DdlAlmacenGeneral.SelectedValue.ToEntero, AsignarSubProyecto:=ChkAsignarSubProyecto.Checked, AsignarOC:=ChkAsignarOC.Checked, DescuentoAutorizado:=TxtDescuentoAutorizado.Text.ToDouble, CodigoAcceso:=CodigoAcceso)
|
||||
CveUsuario = ObjUsuarios.AddUsuario(TxtUsuario.Text.Trim, Encripta(ContraseñaPredeterminada), TxtNombre.Text.Trim, DdlRol.SelectedValue.ToEntero, TxtCorreo.Text.Trim, DdlPersonal.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, ChkCambiarContraseña.Checked, UsuarioActual.CveUsuario, DdlEmpresa.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, CveAlmacenAsignado:=DdlAlmacenGeneral.SelectedValue.ToEntero, AsignarSubProyecto:=ChkAsignarSubProyecto.Checked, AsignarOC:=ChkAsignarOC.Checked, DescuentoAutorizado:=TxtDescuentoAutorizado.Text.ToDouble, CodigoAcceso:=CodigoAcceso, LimiteCreditoAutorizado:=TxtLimiteAutorizado.Text.ToDecimal())
|
||||
EsNuevoUsuario = True
|
||||
If CveUsuario = -1 Then
|
||||
TieneError = True
|
||||
@@ -843,7 +844,7 @@ Partial Class Sistemas_UsuarioDetalle
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
If Not ObjUsuarios.UpdateUsuario(TxtUsuario.Text.Trim, TxtNombre.Text.Trim, DdlRol.SelectedValue.ToEntero, TxtCorreo.Text.Trim, DdlPersonal.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, ChkCambiarContraseña.Checked, ChkEstatus.Checked, DdlEmpresa.SelectedValue.ToEntero, CveUsuario, DdlAlmacenGeneral.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, AsignarSubProyecto:=ChkAsignarSubProyecto.Checked, AsignarOC:=ChkAsignarOC.Checked, DescuentoAutorizado:=TxtDescuentoAutorizado.Text.ToDouble, CodigoAcceso:=CodigoAcceso) Then
|
||||
If Not ObjUsuarios.UpdateUsuario(TxtUsuario.Text.Trim, TxtNombre.Text.Trim, DdlRol.SelectedValue.ToEntero, TxtCorreo.Text.Trim, DdlPersonal.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, ChkCambiarContraseña.Checked, ChkEstatus.Checked, DdlEmpresa.SelectedValue.ToEntero, CveUsuario, DdlAlmacenGeneral.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, AsignarSubProyecto:=ChkAsignarSubProyecto.Checked, AsignarOC:=ChkAsignarOC.Checked, DescuentoAutorizado:=TxtDescuentoAutorizado.Text.ToDouble, CodigoAcceso:=CodigoAcceso, LimiteCreditoAutorizado:=TxtLimiteAutorizado.Text.ToDecimal()) Then
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
|
||||
@@ -559,7 +559,7 @@ Partial Class Ventas_ActualizarPrecios
|
||||
|
||||
For Each Franquicia In Franquicias
|
||||
Dim CveFranquicia As Integer = Franquicia.ToEntero
|
||||
Dim CvePS As Integer = GlobalDTPS(CveFranquicia, Codigo:=Codigo.ToUpper).FiltroPrimeroValor("CvePS", "").ToEntero
|
||||
Dim CvePS As Integer = GlobalDTPSSimplificado(CveFranquicia, Codigo:=Codigo).FiltroPrimeroValor("CvePS", "").ToEntero
|
||||
Dim CvePrecioLisa As Integer = GlobalDTPrecioListas(CveFranquicia).FiltroPrimeroValor("CvePrecioLista", String.Format("PrecioLista = '{0}'", PrecioLista)).ToEntero
|
||||
|
||||
If CvePS <= 0 Then
|
||||
|
||||
156
Ventas/CatAutorizacionLimites.aspx
Normal file
156
Ventas/CatAutorizacionLimites.aspx
Normal file
@@ -0,0 +1,156 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatAutorizacionLimites.aspx.vb" Inherits="Ventas_CatAutorizacionLimites" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.labelddl {
|
||||
top: 0;
|
||||
margin-bottom: 0;
|
||||
font-size: 13px;
|
||||
color: #888888;
|
||||
opacity: 1;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de autorizaciones de límite de crédito
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkAgregar" OnClick="LnkAgregar_Click" runat="server"><i class="fa fa-plus"></i>Agregar autorización</asp:LinkButton></li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT smalltitle " style="">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" />
|
||||
</div>
|
||||
<div class="titlefiltros caption" style="margin-top: -8px;">
|
||||
<ul class="list-inline" style="font-size: 12px;">
|
||||
<li>Estatus:
|
||||
|
||||
<asp:DropDownList AppendDataBoundItems="true" ID="DdlEstatus" runat="server" Width="200px" DataTextField="Nombre" DataValueField="CveDispositivosGrupos" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Value="-1" Text="Todos"></asp:ListItem>
|
||||
<asp:ListItem Value="0" Text="Solicitada"></asp:ListItem>
|
||||
<asp:ListItem Value="1" Text="Autorizada"></asp:ListItem>
|
||||
<asp:ListItem Value="2" Text="Aplicada"></asp:ListItem>
|
||||
<asp:ListItem Value="3" Text="Rechazada"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAutorizacion,CveCliente,CveVendedor,Importe"
|
||||
EmptyDataText="No se encontraron autorizaciones" ToolTip="Listado de autorizaciones"
|
||||
CssClass="table table-striped table-advance table-hover ScrollAD mysmallbtn" data-sort="true" Width="100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:HyperLinkField DataTextField="NombreComercial" Target="_blank" HeaderText="Cliente" DataNavigateUrlFields="CveCliente" DataNavigateUrlFormatString="/Ventas/Clientes.aspx?CveCliente={0}" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="20%" />
|
||||
<asp:BoundField DataField="Vendedor" HeaderText="Vendedor" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="15%" />
|
||||
<asp:BoundField DataField="Importe" ItemStyle-Width="15%" HeaderText="Importe" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField DataField="LimiteCredito" ItemStyle-Width="15%" HeaderText="Limite Credito" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField DataField="Saldo" ItemStyle-Width="15%" HeaderText="Saldo" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField DataField="FechaIng" ItemStyle-Width="10%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
|
||||
<asp:BoundField DataField="TipoAutorizacionTexto" HeaderText="Tipo" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
|
||||
<asp:BoundField DataField="TipoDocumento" HeaderText="Tipo Documento" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
|
||||
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" Text='<%# Eval("Estatus") %>' runat="server"></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" HeaderText="Autorizar/Rechazar">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea autorizar el limite?" data-btn-ok-label="si" ID="LnkAutorizar" OnClick="LnkAutorizar_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-check'></i>"></asp:LinkButton>
|
||||
<asp:LinkButton data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea rechazar el limite?" data-btn-ok-label="si" ID="LnkRechazar" OnClick="LnkRechazar_Click" CssClass="btn btn-circle btn-sm red" runat="server" Text="<i class='fa fa-times'></i>"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" HeaderText="Eliminar">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkEliminar" OnClick="LnkEliminar_Click" runat="server" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el limite?" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="DModal" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModal" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="ltlMotititulo" Text="Medida" runat="server"> </asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<label class="labelddl">Cliente:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlCliente" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"></ADS:Dropdownlost>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlVendedor" CssClass="form-control marginFixRow select2me" runat="server" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" Width="100%">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVVendedor" runat="server" ControlToValidate="DdlVendedor" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Vendedor''</b> es necesario, por favor seleccione uno." ValidationGroup="VgmGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEClasificacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVVendedor" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<label for="<%= DdlVendedor.ClientID.ToString()%>">Vendedor:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlTipoDocto" runat="server" Width="100%" CssClass="form-control marginFixRow select2me" AutoPostBack="true" OnSelectedIndexChanged="DdlTipoDocto_SelectedIndexChanged">
|
||||
<asp:ListItem Value="Ing" Selected="True" Text="Factura de Ingreso"></asp:ListItem>
|
||||
<asp:ListItem Value="Egs" Text="Nota de crédito"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlTipoDocto.ClientID.ToString()%>">Tipo Documento:</label>
|
||||
</div>
|
||||
<div id="DivAutorizacion" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlTipoAutorizacion" runat="server" Width="100%" CssClass="form-control marginFixRow select2me" AutoPostBack="true" OnSelectedIndexChanged="DdlTipoAutorizacion_SelectedIndexChanged">
|
||||
<asp:ListItem Selected="True" Value="-1" Text="Seleccione"></asp:ListItem>
|
||||
<asp:ListItem Value="1" Text="Importe"></asp:ListItem>
|
||||
<asp:ListItem Value="2" Text="Vencimiento"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlTipoAutorizacion.ClientID.ToString()%>">Tipo Autorización:</label>
|
||||
</div>
|
||||
<div id="DivImporte" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtPrecio" inputmode="numeric" runat="server" onkeyup="Recalcula();" CausesValidation="true" lang="nb" ClientIDMode="Static" Text="0.00" MaxLength="12" ValidationGroup="GrpAddVenta" Width="200px" CssClass="form-control "></asp:TextBox>
|
||||
<%--<ajax:MaskedEditExtender ID="MEEPrecio" runat="server" TargetControlID="TxtPrecio" ClearMaskOnLostFocus="false" MaskType="Number" Mask="9,999.99" InputDirection="RightToLeft" DisplayMoney="Left"></ajax:MaskedEditExtender>--%>
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender4" runat="server" TargetControlID="TxtPrecio" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<asp:RequiredFieldValidator ID="RFVPrecio" runat="server" ControlToValidate="TxtPrecio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Precio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCPrecio" runat="server" HighlightCssClass="vco" TargetControlID="RFVPrecio" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<asp:CustomValidator ID="CVPrecio" runat="server" ClientValidationFunction="ValidaDecimal6digits" ControlToValidate="TxtPrecio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Precio''</b> no tiene el formato correcto. Por favor rectifique y vuelva a intentar." ValidateEmptyText="True" ValidationGroup="GrpAddVenta"></asp:CustomValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEPrecio" runat="server" HighlightCssClass="vco" TargetControlID="CVPrecio" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<label for="<%= TxtPrecio.ClientID.ToString()%>">Importe:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnGuardar" OnClick="BtnGuardar_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VgmGuardar" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
215
Ventas/CatAutorizacionLimites.aspx.vb
Normal file
215
Ventas/CatAutorizacionLimites.aspx.vb
Normal file
@@ -0,0 +1,215 @@
|
||||
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Ventas_CatAutorizacionLimites
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "PROPIEDADES"
|
||||
Private Property CveAutorizacion() As Integer
|
||||
Get
|
||||
Return If(IsNothing(ViewState("CveAutorizacion")), -1, CInt(ViewState("CveAutorizacion")))
|
||||
End Get
|
||||
Set
|
||||
ViewState("CveAutorizacion") = Value
|
||||
End Set
|
||||
End Property
|
||||
Private Property Modalidad() As String
|
||||
Get
|
||||
Return If(IsNothing(ViewState("Modalidad")), "", (ViewState("Modalidad").ToString))
|
||||
End Get
|
||||
Set
|
||||
ViewState("Modalidad") = Value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
CargaCombos()
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "CARGAS"
|
||||
Private Sub CargaCombos()
|
||||
Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
|
||||
If EsWS Then
|
||||
DdlCliente.setEsWebService(True)
|
||||
Else
|
||||
DdlCliente.setEsWebService(False)
|
||||
DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
|
||||
DdlCliente.DataBind()
|
||||
DdlCliente.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End If
|
||||
|
||||
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
|
||||
DdlVendedor.DataBind()
|
||||
|
||||
UpModal.Update()
|
||||
End Sub
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjGral As New ClsVentas
|
||||
If ObjGral.GetAutorizacionLimite(UsuarioActual.CveEmpresa, -1, -1, CveEstatus:=DdlEstatus.SelectedValue.ToEntero()) Then
|
||||
GvDatos.DataSource = ObjGral.DtResultados
|
||||
End If
|
||||
ObjGral.Dispose()
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "BOTONES"
|
||||
Protected Sub LnkEliminar_Click(sender As Object, e As EventArgs)
|
||||
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
|
||||
Dim CveAutorizacion = gvRow.DataKey("CveAutorizacion").ToEntero()
|
||||
Dim CveCliente = gvRow.DataKey("CveCliente").ToEntero()
|
||||
|
||||
Dim ObjGral As New ClsVentas
|
||||
If ObjGral.RemoveAutorizacionLimite(CveAutorizacion, CveCliente) Then
|
||||
Alert("La autorización se elimino correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
ObjGral.Dispose()
|
||||
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkAgregar_Click(sender As Object, e As EventArgs)
|
||||
LimpiaModal()
|
||||
Modalidad = "A"
|
||||
BtnGuardar.Text = "Agregar"
|
||||
ltlMotititulo.Text = "Agregar autorización"
|
||||
UpModal.Update()
|
||||
RegistraScript("$('#DModal').modal()")
|
||||
End Sub
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
|
||||
If DdlTipoDocto.SelectedValue = "Ing" AndAlso DdlTipoAutorizacion.SelectedValue.ToEntero() <= 0 Then
|
||||
Alert("Debe seleccionar un tipo de autorización", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim CveEstatus As Integer = 1
|
||||
Dim TipoDocto As String = DdlTipoDocto.SelectedValue
|
||||
Dim CveTipoAutorizacion As Integer = -1
|
||||
|
||||
Select Case TipoDocto
|
||||
Case "Ing"
|
||||
CveTipoAutorizacion = DdlTipoAutorizacion.SelectedValue.ToEntero()
|
||||
Case "Egs"
|
||||
CveTipoAutorizacion = -1
|
||||
End Select
|
||||
|
||||
Dim ObjPS As New ClsVentas
|
||||
If ObjPS.AddAutorizacionLimite(UsuarioActual.CveEmpresa, DdlCliente.SelectedValue.ToEntero(), DdlVendedor.SelectedValue.ToEntero(), TxtPrecio.Text.ToDecimal(), CveEstatus, UsuarioActual.CveUsuario, CveAutorizacion, TipoDocto) Then
|
||||
RegistraScript("$('#DModal').modal('hide')")
|
||||
Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
ObjPS.Dispose()
|
||||
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "LIMPIAR"
|
||||
Protected Sub LimpiaModal()
|
||||
Me.CveAutorizacion = -1
|
||||
TxtPrecio.Text = ""
|
||||
|
||||
DdlCliente.SelectedValue = "-1"
|
||||
DdlVendedor.SelectedValueExist("-1")
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "GRIDVIEW"
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("CveEstatus") = "0" Then
|
||||
e.Row.FCLabel("LblEstatus").CssClass = "badge badge-secondary"
|
||||
e.Row.FCLinkButton("LnkAutorizar").Visible = True
|
||||
e.Row.FCLinkButton("LnkRechazar").Visible = True
|
||||
ElseIf e.Row.DBCampo("CveEstatus") = "1" Then
|
||||
e.Row.FCLabel("LblEstatus").CssClass = "badge badge-success"
|
||||
e.Row.FCLinkButton("LnkAutorizar").Visible = False
|
||||
e.Row.FCLinkButton("LnkRechazar").Visible = True
|
||||
ElseIf e.Row.DBCampo("CveEstatus") = "2" Then
|
||||
e.Row.FCLabel("LblEstatus").CssClass = "badge badge-primary"
|
||||
e.Row.FCLinkButton("LnkAutorizar").Visible = False
|
||||
e.Row.FCLinkButton("LnkRechazar").Visible = False
|
||||
ElseIf e.Row.DBCampo("CveEstatus") = "3" Then
|
||||
e.Row.FCLabel("LblEstatus").CssClass = "badge badge-danger"
|
||||
e.Row.FCLinkButton("LnkAutorizar").Visible = False
|
||||
e.Row.FCLinkButton("LnkRechazar").Visible = False
|
||||
End If
|
||||
'If e.Row.DBCampo("Estatus") = "True" Then
|
||||
' e.Row.Cells(1).ForeColor = Drawing.Color.Green
|
||||
' e.Row.Cells(1).Font.Bold = True
|
||||
' e.Row.Cells(1).Text = "Activo"
|
||||
'Else
|
||||
' e.Row.Cells(1).Text = "Inactivo"
|
||||
' e.Row.Cells(1).ForeColor = Drawing.Color.Red
|
||||
' e.Row.Cells(1).Font.Bold = True
|
||||
'End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
Protected Sub LnkAutorizar_Click(sender As Object, e As EventArgs)
|
||||
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
|
||||
Dim CveAutorizacion = gvRow.DataKey("CveAutorizacion").ToEntero()
|
||||
Dim CveCliente = gvRow.DataKey("CveCliente").ToEntero()
|
||||
Dim CveVendedor = gvRow.DataKey("CveVendedor").ToEntero()
|
||||
Dim Importe = gvRow.DataKey("Importe").ToEntero()
|
||||
Dim CveEstatusAutorizacion As Integer = 1
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.AutorizacionLimitesUpdate(CveAutorizacion, CveCliente, CveVendedor, Importe, CveEstatusAutorizacion) Then
|
||||
Alert("El límite de crédito fue autorizado.")
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkRechazar_Click(sender As Object, e As EventArgs)
|
||||
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
|
||||
Dim CveAutorizacion = gvRow.DataKey("CveAutorizacion").ToEntero()
|
||||
Dim CveCliente = gvRow.DataKey("CveCliente").ToEntero()
|
||||
Dim CveVendedor = gvRow.DataKey("CveVendedor").ToEntero()
|
||||
Dim Importe = gvRow.DataKey("Importe").ToEntero()
|
||||
Dim CveEstatusAutorizacion As Integer = 3
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.AutorizacionLimitesUpdate(CveAutorizacion, CveCliente, CveVendedor, Importe, CveEstatusAutorizacion) Then
|
||||
Alert("El límite de crédito fue rechazado.")
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
CargaDatos()
|
||||
End Sub
|
||||
Protected Sub DdlTipoAutorizacion_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
DivImporte.Visible = DdlTipoAutorizacion.SelectedValue.ToEntero() = 1
|
||||
UpModal.Update()
|
||||
End Sub
|
||||
Protected Sub DdlCliente_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
Dim CveCliente As Integer = DdlCliente.SelectedValue.ToEntero()
|
||||
If CveCliente > 0 Then
|
||||
Using ObjClientes As New ClsClientes
|
||||
If ObjClientes.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) AndAlso ObjClientes.DtResultados.Rows.Count > 0 Then
|
||||
DdlVendedor.SelectedValueExist(ObjClientes.DtResultados.Rows(0)("CveVendedor"))
|
||||
End If
|
||||
End Using
|
||||
End If
|
||||
|
||||
UpModal.Update()
|
||||
@@ -855,7 +855,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
Dim tipoCambioVentaDiferenciaCambiaria As Double = 1
|
||||
Dim EsAnticipoEspecial As Boolean = False
|
||||
|
||||
If gvr.DataKey("TipoDocto") = "Ant" AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then EsAnticipoEspecial = True
|
||||
If gvr.DataKey("TipoDocto") = "Ant" AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119, 158) Then EsAnticipoEspecial = True
|
||||
|
||||
If dtConceptos IsNot Nothing Then
|
||||
For Each Row As DataRow In dtConceptos.Rows
|
||||
@@ -900,9 +900,9 @@ Partial Class Ventas_ClientesAbonar
|
||||
Else
|
||||
ConceptoMovimiento += $" TC:{tipoCambioVentaValuacion} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
IdCtaContable = If(EsAnticipoEspecial, IdCtaContMonedaComplementariaAnticipo, IdCtaContComplementaria)
|
||||
If ImporteMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsuarioActual.CveEmpresa = 119) Then
|
||||
If ImporteMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsuarioActual.CveEmpresa.Contiene(119, 158)) Then
|
||||
importeMX = ImporteMovimiento
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Referencia, If(gvr.DataKey("TipoDocto") = "Ant" AndAlso UsuarioActual.CveEmpresa = 119, 226, 207), ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=(ImporteMovimiento * tipoCambioVentaValuacion - ImporteMovimiento).RoundSQL, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioVentaValuacion) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Referencia, If(gvr.DataKey("TipoDocto") = "Ant" AndAlso UsuarioActual.CveEmpresa.Contiene(119, 158), 226, 207), ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=(ImporteMovimiento * tipoCambioVentaValuacion - ImporteMovimiento).RoundSQL, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioVentaValuacion) Then
|
||||
MsgError = "No se pudo insertar la póliza"
|
||||
End If
|
||||
End If
|
||||
@@ -2579,7 +2579,6 @@ Partial Class Ventas_ClientesAbonar
|
||||
For Each gr As GridViewRow In GvCxC.Rows
|
||||
If gr.FCCheckBox("Chk").Checked Then
|
||||
Dim IdCtaContable As Integer = IdCuentaCliente
|
||||
Dim CveCuenta As Integer = 0
|
||||
Dim PorcentajePago As Decimal = gr.DataKey("Saldo").ToDecimal / gr.DataKey("Original").ToDecimal
|
||||
Dim Saldo As Decimal = gr.DataKey("Saldo").ToDecimal
|
||||
Dim RETIVA As Decimal = gr.DataKey("RetIVA").ToDecimal
|
||||
@@ -2632,11 +2631,11 @@ Partial Class Ventas_ClientesAbonar
|
||||
|
||||
End If
|
||||
|
||||
Dim UsaComplementaria As Boolean = False
|
||||
Dim UsaComplementaria As Boolean = True
|
||||
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
UsaComplementaria = True
|
||||
End If
|
||||
'If UsuarioActual.CveEmpresa = 119 Then
|
||||
' UsaComplementaria = True
|
||||
'End If
|
||||
|
||||
If MsgError = "" Then
|
||||
|
||||
@@ -2648,16 +2647,16 @@ Partial Class Ventas_ClientesAbonar
|
||||
|
||||
If UsaComplementaria AndAlso tCveMoneda = 2 Then
|
||||
'normal
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, Saldo, gr.DataKey("SerieFolio").ToString, CveConceptoCliente, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, Saldo), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, Saldo, gr.DataKey("SerieFolio").ToString, CveConceptoCliente, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, Saldo), TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
'complementaria
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, 0, gr.DataKey("SerieFolio").ToString, 207, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=IdCtaContComplementaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, (Saldo * TCVenta) - Saldo).RoundSQL, ImporteME:=Saldo, CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, 0, gr.DataKey("SerieFolio").ToString, 207, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=IdCtaContComplementaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, (Saldo * TCVenta) - Saldo).RoundSQL, ImporteME:=Saldo, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
|
||||
Else
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, Saldo, gr.DataKey("SerieFolio").ToString, CveConceptoCliente, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, Saldo * TCVenta), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, Saldo, gr.DataKey("SerieFolio").ToString, CveConceptoCliente, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, Saldo * TCVenta), TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
|
||||
@@ -2673,11 +2672,11 @@ Partial Class Ventas_ClientesAbonar
|
||||
End If
|
||||
|
||||
If TCPago > TCVenta Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
Else
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 65, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 65, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
End If
|
||||
@@ -2700,19 +2699,17 @@ Partial Class Ventas_ClientesAbonar
|
||||
End If
|
||||
|
||||
IdCtaContable = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar)
|
||||
CveCuenta = If(CveCuentaIVAxTrasladar > 0, CveCuentaIVAxTrasladar, UsuarioActual.Empresa.CveCuentaIVAxTrasladar)
|
||||
|
||||
If (IVA > 0 Or UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) And IVA < 0) AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IVA, gr.DataKey("SerieFolio").ToString, 13, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, IVA, IVA * TCVenta), CveCuenta:=CveCuenta, PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
|
||||
If (IVA > 0 Or UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) And IVA < 0) AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IVA, gr.DataKey("SerieFolio").ToString, 13, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, IVA, IVA * TCVenta), PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
|
||||
If (RETIVA > 0 Or UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) And RETIVA < 0) AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, RETIVA, gr.DataKey("SerieFolio").ToString, 8, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContRetIVA, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, RETIVA, RETIVA * TCVenta), CveCuenta:=CveCuenta, PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
|
||||
If (RETIVA > 0 Or UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) And RETIVA < 0) AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, RETIVA, gr.DataKey("SerieFolio").ToString, 8, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContRetIVA, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, RETIVA, RETIVA * TCVenta), PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSxTrasladar
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaIEPSxTrasladar
|
||||
If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IEPS, gr.DataKey("SerieFolio").ToString, 38, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, IEPS, IEPS * TCVenta), CveCuenta:=CveCuenta, PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
|
||||
If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IEPS, gr.DataKey("SerieFolio").ToString, 38, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, IEPS, IEPS * TCVenta), PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
|
||||
|
||||
@@ -4993,13 +4993,13 @@ Partial Class PV
|
||||
If CveVentaDetalle <= 0 AndAlso Not EsCargo Then
|
||||
Dim ListaPSCargo = CalculaUsados(Consec)
|
||||
If ListaPSCargo.Count > 0 Then
|
||||
CalculaRecepcionUsados(CvePS, ListaPSCargo)
|
||||
CalculaRecepcionUsados(CvePS, ListaPSCargo, Cantidad)
|
||||
End If
|
||||
ElseIf CveVentaDetalle > 0 AndAlso Not EsCargo Then
|
||||
EliminarUsados()
|
||||
Dim ListaPSCargo = CalculaUsados(Consec, LimpiarUsados:=False)
|
||||
If ListaPSCargo.Count > 0 Then
|
||||
CalculaRecepcionUsados(CvePS, ListaPSCargo)
|
||||
CalculaRecepcionUsados(CvePS, ListaPSCargo, Cantidad)
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -7091,7 +7091,7 @@ Partial Class PV
|
||||
|
||||
EmitirImprimirNew()
|
||||
End Sub
|
||||
Private Sub CalculaRecepcionUsados(CvePS As Integer, ListaPSCargo As List(Of Integer))
|
||||
Private Sub CalculaRecepcionUsados(CvePS As Integer, ListaPSCargo As List(Of Integer), CantidadUsado As Decimal)
|
||||
|
||||
If Modalidad = "U" Then
|
||||
If TmpDTRecepcionUsados.Rows.Count > 0 Then
|
||||
@@ -7139,14 +7139,14 @@ Partial Class PV
|
||||
Dim DrTamanio As DataRow = GlobalDTAcumTamaños.FiltroPrimero($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CvePSCargo = {DdlRecepcionUsados.SelectedValue}")
|
||||
|
||||
If DdlRecepcionUsados.SelectedValue.ToEntero() > 0 Then
|
||||
TotalCargos += 1D * DrTamanio("Cargo").ToString().ToDecimal
|
||||
TotalCantidad += 1D
|
||||
TotalCargos += CantidadUsado * DrTamanio("Cargo").ToString().ToDecimal
|
||||
TotalCantidad += CantidadUsado
|
||||
StrTamanios.AppendFormat("{0},", DrTamanio("CodigoPS"))
|
||||
|
||||
Dim Row As DataRow = TmpDTRecepcionUsados.NewRow()
|
||||
Row("CvePS") = DrTamanio("CvePSCargo").ToString().ToEntero
|
||||
Row("CvePSRelacionado") = CvePS
|
||||
Row("Cantidad") = 1D
|
||||
Row("Cantidad") = CantidadUsado
|
||||
Row("CveUM") = DrTamanio("CveUM").ToString().ToEntero
|
||||
Row("CveVentaDetalle") = -1
|
||||
Row("PU") = DrTamanio("Cargo").ToString().ToDecimal
|
||||
@@ -7176,11 +7176,14 @@ Partial Class PV
|
||||
' Exit Sub
|
||||
'End If
|
||||
|
||||
For Each Dr As DataRow In TmpDT.FiltraParametros($"EsCargo = True AND EliminarDB = False AND CvePS IN ({StrCargos})").Rows
|
||||
Dim DtUsadosFiltro As DataTable = TmpDT.FiltraParametros($"EsCargo = True AND EliminarDB = False AND CvePS IN ({StrCargos})")
|
||||
Dim DivisorUsado = DtUsadosFiltro.Rows.Count.ToString().ToDecimal()
|
||||
|
||||
For Each Dr As DataRow In DtUsadosFiltro.Rows
|
||||
|
||||
Dim TotalAnterior As Decimal = Dr("Cantidad").ToString.ToDecimal * Dr("PU").ToString.ToDecimal
|
||||
'Dim PUActual As Decimal = (TotalAnterior - TotalCargos) / Dr("Cantidad").ToString.ToDecimal
|
||||
Dim DescuentoCargo As Decimal = (TotalCargos / Dr("Cantidad").ToString.ToDecimal)
|
||||
Dim DescuentoCargo As Decimal = (TotalCargos / DivisorUsado)
|
||||
|
||||
If DescuentoCargo > (TotalAnterior - Dr("Descuento").ToString.ToDecimal()) Then
|
||||
DescuentoCargo = (TotalAnterior - Dr("Descuento").ToString.ToDecimal())
|
||||
@@ -7218,20 +7221,23 @@ Partial Class PV
|
||||
Next
|
||||
TmpDT.AcceptChanges()
|
||||
If TotalCargos > 0 Then ' cuando se entrega más valor de usados, que los cargos hechos, se descuenta sobre el PU del producto de venta
|
||||
For Each Dr As DataRow In TmpDT.FiltraParametros($"EsCargo = False AND EliminarDB = False AND CvePS={CvePS}").Rows
|
||||
Dim DtPSFiltro As DataTable = TmpDT.FiltraParametros($"EsCargo = False AND EliminarDB = False AND CvePS={CvePS}")
|
||||
Dim Divisor = DtPSFiltro.Rows.Count.ToString().ToDecimal()
|
||||
|
||||
Dim PUAnterior As Decimal = Dr("Cantidad").ToString.ToDecimal * Dr("PU").ToString.ToDecimal
|
||||
Dim DescuentoCargo As Decimal = (TotalCargos / Dr("Cantidad").ToString.ToDecimal)
|
||||
For Each Dr As DataRow In DtPSFiltro.Rows
|
||||
|
||||
If DescuentoCargo > (PUAnterior - Dr("Descuento").ToString.ToDecimal()) Then
|
||||
DescuentoCargo = (PUAnterior - Dr("Descuento").ToString.ToDecimal())
|
||||
Dim TotalAnterior As Decimal = Dr("Cantidad").ToString.ToDecimal * Dr("PU").ToString.ToDecimal
|
||||
Dim DescuentoCargo As Decimal = (TotalCargos / Divisor)
|
||||
|
||||
If DescuentoCargo > (TotalAnterior - Dr("Descuento").ToString.ToDecimal()) Then
|
||||
DescuentoCargo = (TotalAnterior - Dr("Descuento").ToString.ToDecimal())
|
||||
End If
|
||||
|
||||
'Dim PUActual As Decimal = PUAnterior - DescuentoCargo
|
||||
Dim Descuento As Decimal = Dr("Descuento").ToString.ToDecimal + DescuentoCargo
|
||||
|
||||
Dim TotalCalculableImpuestos As Decimal = (Dr("Cantidad").ToString.ToDecimal * (PUAnterior)) - Descuento
|
||||
TotalCargos += -DescuentoCargo
|
||||
Dim TotalCalculableImpuestos As Decimal = (Dr("Cantidad").ToString.ToDecimal * Dr("PU").ToString.ToDecimal) - Descuento
|
||||
TotalCargos -= DescuentoCargo
|
||||
|
||||
Dim drt As DataRow() = TmpDT.Select("Consec = " & Dr("Consec").ToString)
|
||||
Dim drr As DataRow = drt(0)
|
||||
|
||||
@@ -2944,7 +2944,10 @@ Partial Class ProductosyServicios
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
|
||||
GlobalDTPSSimplificado(CveEmpresaFranquicia) = Nothing
|
||||
Next
|
||||
|
||||
Return False
|
||||
End Function
|
||||
|
||||
|
||||
@@ -196,6 +196,11 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlSubProyectoSaldar" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlSubProyectoSaldar.ClientID.ToString()%>">Centro Costo:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtConcepto" CssClass="form-control" runat="server"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RfvConcepto" runat="server" ControlToValidate="TxtConcepto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="VgGuardar"></asp:RequiredFieldValidator>
|
||||
|
||||
@@ -94,7 +94,9 @@ public partial class Ventas_RepAnticipo_NC_IXCDetalle : ClsPaginas
|
||||
DdlSucursal.DataSource = get_GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa);
|
||||
DdlSucursal.DataBind();
|
||||
DdlSucursal.Items.Insert(0, new ListItem("Todos", "-1"));
|
||||
DdlSucursal.SelectedValue = "-1";
|
||||
DdlSucursal.SelectedValue = "-1";
|
||||
DdlSubProyectoSaldar.DataSource = get_GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa);
|
||||
DdlSubProyectoSaldar.DataBind();
|
||||
}
|
||||
|
||||
//protected void CargaClientes()
|
||||
@@ -386,7 +388,7 @@ public partial class Ventas_RepAnticipo_NC_IXCDetalle : ClsPaginas
|
||||
break;
|
||||
}
|
||||
|
||||
if (!ObjConta.AddPrePolizasDetalle(CvePrePoliza, true, Gv.DataKey("Saldo").ToDecimal(), Gv.DataKey("Folio").ToString(), 78, TxtConcepto.Text, TxtFecha.Text.ToDate(), UsuarioActual.Empresa.IdCuentaOtrosIngresos, -1, CveIE, CveVenta, ImporteMX: Gv.DataKey("Saldo").ToDecimal(), CveCuenta: -1, CveSubProyecto: Gv.DataKey("CveSubProyecto").ToEntero()))
|
||||
if (!ObjConta.AddPrePolizasDetalle(CvePrePoliza, true, Gv.DataKey("Saldo").ToDecimal(), Gv.DataKey("Folio").ToString(), 78, TxtConcepto.Text, TxtFecha.Text.ToDate(), UsuarioActual.Empresa.IdCuentaOtrosIngresos, -1, CveIE, CveVenta, ImporteMX: Gv.DataKey("Saldo").ToDecimal(), CveCuenta: -1, CveSubProyecto: DdlSubProyectoSaldar.SelectedValue.ToEntero()))
|
||||
{
|
||||
MsgError = "Ocurrio un error al saldar el movimiento";
|
||||
break;
|
||||
|
||||
@@ -775,9 +775,9 @@ Partial Class Ventas_RepPS
|
||||
'worksheet.Cells(IdxSucursalesServiciosAmortPolizas, 9).Value = Row("PolizasCantidadAcumulada")
|
||||
worksheet.Cells(IdxSucursalesServiciosAmortPolizas, 9).Formula = $"=SUM({worksheet.Cells(IdxSucursalesServiciosAmortPolizas, 7).Name}:{worksheet.Cells(IdxSucursalesServiciosAmortPolizas, 8).Name})"
|
||||
|
||||
worksheet.Cells(IdxSucursalesServiciosAmortPolizas, 10).Value = Row("VentaAnterior")
|
||||
worksheet.Cells(IdxSucursalesServiciosAmortPolizas, 11).Value = Row("VentaDia")
|
||||
'worksheet.Cells(IdxSucursalesServiciosAmortPolizas, 12).Value = Row("VentaAcumulada")
|
||||
worksheet.Cells(IdxSucursalesServiciosAmortPolizas, 10).Value = Row("ManoObraCantidadAnterior")
|
||||
worksheet.Cells(IdxSucursalesServiciosAmortPolizas, 11).Value = Row("ManoObraCantidadDia")
|
||||
'worksheet.Cells(IdxSucursalesServiciosAmortPolizas, 12).Value = Row("ManoObraCantidadAcumulada")
|
||||
worksheet.Cells(IdxSucursalesServiciosAmortPolizas, 12).Formula = $"=SUM({worksheet.Cells(IdxSucursalesServiciosAmortPolizas, 10).Name}:{worksheet.Cells(IdxSucursalesServiciosAmortPolizas, 11).Name})"
|
||||
|
||||
Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxSucursalesServiciosAmortPolizas, 0, IdxSucursalesServiciosAmortPolizas, 12).Style
|
||||
|
||||
@@ -244,7 +244,7 @@
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Ventas Utilidad con los filtros especificados" ToolTip="Listado de Ventas" CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Ventas Utilidad con los filtros especificados" CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
|
||||
<Columns>
|
||||
<asp:HyperLinkField ItemStyle-HorizontalAlign="Center" HeaderText="Serie Folio" DataTextField="SerieFolio" DataTextFormatString="{0}" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/>
|
||||
<asp:HyperLinkField ItemStyle-HorizontalAlign="Center" HeaderText="Fecha" DataTextField="FechaVenta" DataTextFormatString="{0:d}" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/>
|
||||
|
||||
@@ -181,6 +181,9 @@ Partial Class Ventas_RepVentasUtilidad
|
||||
End If
|
||||
|
||||
If Not e.Row.RowIndex = 0 AndAlso e.Row.DBCampo("SubTotal").ToDecimal = 0 AndAlso e.Row.DBCampo("CveVenta").ToEntero > 0 Then
|
||||
If e.Row.DBCampo("FechaVenta").ToDate < txtFechaI.Text.ToDate.FirstDayOfMonth Then
|
||||
e.Row.ToolTip = "Venta con realizada en un periodo anterior"
|
||||
End If
|
||||
e.Row.CssClass = "danger"
|
||||
ElseIf Not e.Row.RowIndex = 0 AndAlso e.Row.DBCampo("CveVenta") <> "" Then
|
||||
e.Row.Cells(0).BackColor = ColorTranslator.FromHtml("#e9e9e9")
|
||||
@@ -218,6 +221,7 @@ Partial Class Ventas_RepVentasUtilidad
|
||||
|
||||
If e.Row.DBCampo("CveVenta").ToEntero > 0 AndAlso Not CBool(e.Row.DBCampo("TienePago")) Then
|
||||
e.Row.Cells(15).BackColor = Drawing.Color.LightPink
|
||||
e.Row.Cells(15).ToolTip = "Factura sin pago registrado"
|
||||
End If
|
||||
|
||||
|
||||
|
||||
@@ -367,6 +367,9 @@
|
||||
<li>
|
||||
<asp:HyperLink ID="HlFacturasRelaciondas" Visible="false" NavigateUrl="#" data-toggle="modal" data-backdrop="static" data-keyboard="false" data-target="#DivFacturasRelaciondas" runat="server"><i class='fa fa-file'></i> Relacionar Facturas</asp:HyperLink>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkSolicitarCredito" Visible="false" runat="server"><i class="fa fa-plus"></i>Solicitar autorización de crédito</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:AsyncPostBackTrigger ControlID="LnkImprimir" EventName="Click" />
|
||||
@@ -3657,7 +3660,7 @@
|
||||
</div>
|
||||
|
||||
<div class="col-md-4" align="right">
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="col-md-12" align="right" style="padding-bottom: 15px;">
|
||||
<asp:UpdatePanel ID="UpFacturar" runat="server" class="portlet light xspadding bordered " style="width: 300px;" align="right" UpdateMode="Conditional">
|
||||
<Triggers>
|
||||
@@ -3765,23 +3768,23 @@
|
||||
|
||||
<tr runat="server" id="Tr3">
|
||||
<td align="center" style="" runat="server" id="tdAdjuntar">
|
||||
<asp:LinkButton ID="BtnAdjuntar" runat="server" Text="Adjuntar" data-toggle="modal" data-target="#ModalAdjuntar" CssClass="btn myventasbutton btn-primary" />
|
||||
<asp:LinkButton ID="BtnAdjuntar" runat="server" Text="Adjuntar" data-toggle="modal" data-target="#ModalAdjuntar" CssClass="btn myventasbutton btn-primary" />
|
||||
</td>
|
||||
<td align="left" style="display: none;" runat="server" id="tdAdjunto">
|
||||
<div class="col-md-6">
|
||||
<asp:LinkButton ID="BtnArchivoAdjunto" runat="server" Text="" Font-Size="14px" />
|
||||
</div>
|
||||
<div class="col-md-6" style="text-align: right;">
|
||||
<asp:LinkButton ID="BtnEliminarAdjunto" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" Visible="false"/>
|
||||
<asp:LinkButton ID="BtnEliminarAdjunto" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" Visible="false" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="BtnArchivoAdjunto" />
|
||||
</Triggers>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="BtnArchivoAdjunto" />
|
||||
</Triggers>
|
||||
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
@@ -3956,7 +3959,7 @@
|
||||
<div style="max-height: 300px; overflow-y: auto;">
|
||||
<asp:GridView ID="GVAnticipos" runat="server" AutoGenerateColumns="False" ClientIDMode="Static" EmptyDataText="No se encontraron Anticipos del Cliente"
|
||||
ToolTip="Listado de Anticipos" CssClass="GVAnticipos table table-striped table-hover Widthall" data-height="300" Style="text-align: center;" GridLines="None"
|
||||
DataKeyNames="ISTotal,Saldo,CveIE,Folio,Tipo,CveVenta,CveConceptoContable,CveConceptoContableAmor, TotalAnticipo, SubTotalAnticipo, IVAAnticipo,IEPS, ImpuestosLocalesAnticipo, SubTotalAmortizacion, SubTotal, Original, IVA, RetIVA, RetISR, IdCtaContableNC,FolioFiscal, CveClasificacionNC, IdCtaContableNCSIG, TipoCambio,TipoCambioPago,TipoCambioHoy, CveMoneda,Fecha,SaldoSubTotal,SaldoConImpuestos,RegresarImpuesto,CveCliente">
|
||||
DataKeyNames="ISTotal,Saldo,CveIE,Folio,Tipo,CveVenta,CveConceptoContable,CveConceptoContableAmor, TotalAnticipo, SubTotalAnticipo, IVAAnticipo,IEPS, ImpuestosLocalesAnticipo, SubTotalAmortizacion, SubTotal, Original, IVA, RetIVA, RetISR, IdCtaContableNC,FolioFiscal, CveClasificacionNC, TipoCambio,TipoCambioPago,TipoCambioHoy, CveMoneda,Fecha,SaldoSubTotal,SaldoConImpuestos,RegresarImpuesto,CveCliente">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
@@ -6239,7 +6242,7 @@
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">Facturas Relacionadas</h4>
|
||||
</div>
|
||||
<div class="modal-body" style="width:900px;">
|
||||
<div class="modal-body" style="width: 900px;">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<label>Relación:</label>
|
||||
@@ -6267,7 +6270,7 @@
|
||||
<label>Folio Fiscal:</label>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<asp:TextBox ID="TxtFolioFiscalRelacionar" runat="server" Text="" Width="100%" CssClass="form-control input-sm"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtFolioFiscalRelacionar" runat="server" Text="" Width="100%" CssClass="form-control input-sm"></asp:TextBox>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<asp:LinkButton ID="LnkAgregarFolioFiscalRelacionada" runat="server" CssClass="btn btn-sm btn-primary" OnClick="LnkAgregarFolioFiscalRelacionada_Click"><i class="fa fa-plus"></i>Agregar Folio</asp:LinkButton>
|
||||
@@ -6312,8 +6315,9 @@
|
||||
<asp:UpdatePanel runat="server" ID="UpdatePanel3" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-2"> Folio Fiscal</div>
|
||||
<div class="col-md-10"> <asp:TextBox ID="TxtModalFolioFiscal" runat="server" Width="100%"></asp:TextBox></div>
|
||||
<div class="col-md-2">Folio Fiscal</div>
|
||||
<div class="col-md-10">
|
||||
<asp:TextBox ID="TxtModalFolioFiscal" runat="server" Width="100%"></asp:TextBox></div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
@@ -7539,6 +7543,47 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="DivModalSolicitarCredito" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalSolicitud" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title">Solicitar crédito</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlTipoDocto" runat="server" Width="100%" CssClass="form-control marginFixRow select2me" AutoPostBack="true">
|
||||
<asp:ListItem Value="Ing" Selected="True" Text="Factura de Ingreso"></asp:ListItem>
|
||||
<asp:ListItem Value="Egs" Text="Nota de crédito"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlTipoDocto.ClientID.ToString()%>">Tipo Documento:</label>
|
||||
</div>
|
||||
<div id="DivAutorizacion" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlTipoAutorizacion" runat="server" Width="100%" CssClass="form-control marginFixRow select2me" AutoPostBack="true">
|
||||
<asp:ListItem Selected="True" Value="-1" Text="Seleccione"></asp:ListItem>
|
||||
<asp:ListItem Value="1" Text="Importe"></asp:ListItem>
|
||||
<asp:ListItem Value="2" Text="Vencimiento"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlTipoAutorizacion.ClientID.ToString()%>">Tipo Autorización:</label>
|
||||
</div>
|
||||
<div id="DivImporteSolicitud" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtImporteSolicitud" inputmode="numeric" runat="server" CausesValidation="true" lang="nb" ClientIDMode="Static" Text="0.00" MaxLength="12" ValidationGroup="VgmGuardarAut" Width="200px" CssClass="form-control "></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FTBImporteSolicitud" runat="server" TargetControlID="TxtImporteSolicitud" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<asp:RequiredFieldValidator ID="RFVImporteSolicitud" runat="server" ControlToValidate="TxtImporteSolicitud" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe''</b> es necesario, por favor ingréselo." ValidationGroup="VgmGuardarAut"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender6" runat="server" HighlightCssClass="vco" TargetControlID="RFVImporteSolicitud" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<asp:CustomValidator ID="CVImporteSolcitud" runat="server" ClientValidationFunction="ValidaDecimal6digits" ControlToValidate="TxtImporteSolicitud" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe''</b> no tiene el formato correcto. Por favor rectifique y vuelva a intentar." ValidateEmptyText="True" ValidationGroup="VgmGuardarAut"></asp:CustomValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEImporteSolicitud" runat="server" HighlightCssClass="vco" TargetControlID="CVImporteSolcitud" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<label for="<%= TxtImporteSolicitud.ClientID.ToString()%>">Importe:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnSolicitarCredito" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VgmGuardarAut" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="/Metronic/assets/global/scripts/jquery-sortable.js"></script>
|
||||
@@ -7672,12 +7717,20 @@
|
||||
Importe = ToDouble(Importe.toFixed(2));
|
||||
|
||||
if (Importe > 0) {
|
||||
|
||||
let pu = (ImporteTotal / CantidadPendiente);
|
||||
|
||||
if (pu > 0) {
|
||||
TxtCantidad.value = (Importe / pu).toString();
|
||||
}
|
||||
|
||||
const cantidadSugerida = (Importe / pu);
|
||||
if (cantidadSugerida > CantidadPendiente) {
|
||||
TxtCantidad.value = CantidadPendiente.toString();
|
||||
}else {
|
||||
TxtCantidad.value = cantidadSugerida.toString();
|
||||
}
|
||||
|
||||
}else {
|
||||
TxtCantidad.value = "0";
|
||||
}
|
||||
|
||||
}else {
|
||||
TxtCantidad.value = "0";
|
||||
@@ -8616,7 +8669,7 @@
|
||||
}
|
||||
|
||||
//Suma Totales
|
||||
function FnSuma() {
|
||||
function FnSuma() {
|
||||
debugger;
|
||||
$get('TxtSubTotal2').value = FormatoNumero(ToDouble($get('TxtSubTotal').value) - ToDouble($get('LblDescuentos').innerHTML) - ToDouble($get('LblAmortizacion').innerHTML), 2);
|
||||
var totalVenta = ToDouble($get('TxtSubTotal2').value) + ToDouble($get('TxtIVA').value) + ToDouble($get('TxtIEPS') ? ToDouble($get('TxtIEPS').value) : 0) - ToDouble($get('TxtRetIVA') ? $get('TxtRetIVA').value : 0) - ToDouble($get('TxtRetISR') ? $get('TxtRetISR').value:0);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user