This commit is contained in:
@@ -3225,7 +3225,7 @@ Public Class ClsContabilidad
|
|||||||
|
|
||||||
|
|
||||||
#Region " CUENTAS "
|
#Region " CUENTAS "
|
||||||
Public Function GetCuentas(CveCuenta As Integer, Codigo As String, Afectable As Integer, CveEmpresa As Integer, Optional RowNum As Integer = 100000, Optional CvePadre As Integer = -1) As Boolean ', Codigo As String, Nombre As String, CveClasificacionCuenta As Integer, TipoCuenta As Integer, Afectable As Integer, Estatus As Integer, CveEmpresa As Integer) As Boolean
|
Public Function GetCuentas(CveCuenta As Integer, Codigo As String, Afectable As Integer, CveEmpresa As Integer, Optional RowNum As Integer = 100000, Optional CvePadre As Integer = -1, Optional Nombre As String = "-1") As Boolean ', Codigo As String, Nombre As String, CveClasificacionCuenta As Integer, TipoCuenta As Integer, Afectable As Integer, Estatus As Integer, CveEmpresa As Integer) As Boolean
|
||||||
Dim Retorno = False
|
Dim Retorno = False
|
||||||
|
|
||||||
DataAdapter("PA_Conta_CuentasGet")
|
DataAdapter("PA_Conta_CuentasGet")
|
||||||
@@ -3234,6 +3234,7 @@ Public Class ClsContabilidad
|
|||||||
.Add("@Codigo", SqlDbType.VarChar).Value = Codigo
|
.Add("@Codigo", SqlDbType.VarChar).Value = Codigo
|
||||||
.Add("@Afectable", SqlDbType.VarChar).Value = Afectable
|
.Add("@Afectable", SqlDbType.VarChar).Value = Afectable
|
||||||
.Add("@CveEmpresa", SqlDbType.VarChar).Value = CveEmpresa
|
.Add("@CveEmpresa", SqlDbType.VarChar).Value = CveEmpresa
|
||||||
|
.Add("@Nombre", SqlDbType.VarChar).Value = Nombre
|
||||||
.Add("@RowNum", SqlDbType.VarChar).Value = RowNum
|
.Add("@RowNum", SqlDbType.VarChar).Value = RowNum
|
||||||
.Add("@CvePadre", SqlDbType.Int).Value = CvePadre
|
.Add("@CvePadre", SqlDbType.Int).Value = CvePadre
|
||||||
End With
|
End With
|
||||||
|
|||||||
@@ -2619,12 +2619,13 @@ Public Class ClsGenerales
|
|||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "SAT PRODUCTOS SERVICIOS Y UNIDAD DE MEDIDA"
|
#Region "SAT PRODUCTOS SERVICIOS Y UNIDAD DE MEDIDA"
|
||||||
Public Function GetSATProductosServicios(Optional SATClaveProductoServicio As String = "-1") As Boolean
|
Public Function GetSATProductosServicios(Optional SATClaveProductoServicio As String = "-1", Optional CveSATPS As Integer = -1) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_Gral_SAT_ProductosServiciosGet")
|
DataAdapter("PA_Gral_SAT_ProductosServiciosGet")
|
||||||
|
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
.Add("@SATClaveProductoServicio", SqlDbType.Int).Value = SATClaveProductoServicio
|
.Add("@SATClaveProductoServicio", SqlDbType.VarChar).Value = SATClaveProductoServicio
|
||||||
|
.Add("@CveSATPS", SqlDbType.Int).Value = CveSATPS
|
||||||
End With
|
End With
|
||||||
'SqlTypes.SqlDateTime.Null
|
'SqlTypes.SqlDateTime.Null
|
||||||
Try
|
Try
|
||||||
|
|||||||
@@ -293,7 +293,7 @@ Public Class ClsPaginas
|
|||||||
Application("Directorio") = value
|
Application("Directorio") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
Public Shared ReadOnly Property GlobalDTPSATPS(SATClaveProductoServicio As String) As DataTable
|
Public Shared ReadOnly Property GlobalDTPSATPS(SATClaveProductoServicio As String, Optional CveSATPS As Integer = -1) As DataTable
|
||||||
Get
|
Get
|
||||||
'If Application("GlobalDTPSATPS") Is Nothing Then
|
'If Application("GlobalDTPSATPS") Is Nothing Then
|
||||||
' Dim ObjGrales As New ClsGenerales
|
' Dim ObjGrales As New ClsGenerales
|
||||||
@@ -304,13 +304,13 @@ Public Class ClsPaginas
|
|||||||
'GlobalDTPSATPS = DirectCast(Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow)).CopyToDataTable
|
'GlobalDTPSATPS = DirectCast(Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow)).CopyToDataTable
|
||||||
|
|
||||||
Dim ObjGrales As New ClsGenerales
|
Dim ObjGrales As New ClsGenerales
|
||||||
If ObjGrales.GetSATProductosServicios(SATClaveProductoServicio) Then
|
If ObjGrales.GetSATProductosServicios(SATClaveProductoServicio, CveSATPS) Then
|
||||||
GlobalDTPSATPS = ObjGrales.DtResultados
|
GlobalDTPSATPS = ObjGrales.DtResultados
|
||||||
Else
|
Else
|
||||||
GlobalDTPSATPS = Nothing
|
GlobalDTPSATPS = Nothing
|
||||||
End If
|
End If
|
||||||
ObjGrales.Dispose()
|
|
||||||
|
|
||||||
|
'GlobalDTPSATPS = DirectCast(Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow)).CopyToDataTable
|
||||||
End Get
|
End Get
|
||||||
'Set(value As DataTable)
|
'Set(value As DataTable)
|
||||||
' Application("GlobalDTPSATPS") = value
|
' Application("GlobalDTPSATPS") = value
|
||||||
@@ -647,7 +647,7 @@ Public Class ClsPaginas
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
|
||||||
Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1, Optional Estatus As Integer = 1) As DataTable
|
Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable
|
||||||
Get
|
Get
|
||||||
Dim AppNombre As String = String.Format("GlobalDTClasificaciones-{0}", CveEmpresa)
|
Dim AppNombre As String = String.Format("GlobalDTClasificaciones-{0}", CveEmpresa)
|
||||||
'sino existe, recarga los datos
|
'sino existe, recarga los datos
|
||||||
@@ -662,7 +662,6 @@ Public Class ClsPaginas
|
|||||||
If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria)
|
If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria)
|
||||||
If UsoClasificacion <> -1 Then Str.AppendFormat(" AND UsoClasificacion IN ({0},3) ", UsoClasificacion)
|
If UsoClasificacion <> -1 Then Str.AppendFormat(" AND UsoClasificacion IN ({0},3) ", UsoClasificacion)
|
||||||
If CveClasificacion <> -1 Then Str.AppendFormat(" AND CveClasificacion = {0}", CveClasificacion)
|
If CveClasificacion <> -1 Then Str.AppendFormat(" AND CveClasificacion = {0}", CveClasificacion)
|
||||||
If Estatus <> -1 Then Str.AppendFormat(" AND Estatus = '{0}'", If(Estatus = 1, "Activo", "Inactivo"))
|
|
||||||
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
|
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
|
||||||
GlobalDTClasificaciones = Dv.ToTable
|
GlobalDTClasificaciones = Dv.ToTable
|
||||||
Dv.Dispose()
|
Dv.Dispose()
|
||||||
@@ -1759,7 +1758,7 @@ Public Class ClsPaginas
|
|||||||
ObjProveedores.Dispose()
|
ObjProveedores.Dispose()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If CveEmpresa <> -1 Then
|
If CveEmpresa <> -1 AndAlso Application(AppNombre) IsNot Nothing Then
|
||||||
Dim StrSQL As New StringBuilder
|
Dim StrSQL As New StringBuilder
|
||||||
StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa)
|
StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa)
|
||||||
If CveProveedor >= 0 Then StrSQL.AppendFormat(" AND CveProveedor = {0} ", CveProveedor)
|
If CveProveedor >= 0 Then StrSQL.AppendFormat(" AND CveProveedor = {0} ", CveProveedor)
|
||||||
@@ -3076,6 +3075,8 @@ Public Class ClsPaginas
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Property GlobalDTContaConceptosContables(CvePlantillaPoliza As Integer) As DataTable
|
Property GlobalDTContaConceptosContables(CvePlantillaPoliza As Integer) As DataTable
|
||||||
Get
|
Get
|
||||||
If CvePlantillaPoliza <> -1 Then
|
If CvePlantillaPoliza <> -1 Then
|
||||||
@@ -3848,7 +3849,6 @@ Public Class ClsPaginas
|
|||||||
If Application("GlobalSIGAppPaginas") Is Nothing Then
|
If Application("GlobalSIGAppPaginas") Is Nothing Then
|
||||||
PaginaDict = New System.Collections.Hashtable
|
PaginaDict = New System.Collections.Hashtable
|
||||||
|
|
||||||
|
|
||||||
PaginaDict.Add("/Nomina/ISRCalculoAnual.aspx".ToUpper(), 918)
|
PaginaDict.Add("/Nomina/ISRCalculoAnual.aspx".ToUpper(), 918)
|
||||||
PaginaDict.Add("/Nomina/Acumulados.aspx".ToUpper(), 916)
|
PaginaDict.Add("/Nomina/Acumulados.aspx".ToUpper(), 916)
|
||||||
PaginaDict.Add("/RH/CalculoSBC.aspx".ToUpper(), 915)
|
PaginaDict.Add("/RH/CalculoSBC.aspx".ToUpper(), 915)
|
||||||
@@ -4619,7 +4619,6 @@ Public Class ClsPaginas
|
|||||||
PaginaDict.Add("/GPS/RepGastos.aspx".ToUpper(), 685)
|
PaginaDict.Add("/GPS/RepGastos.aspx".ToUpper(), 685)
|
||||||
PaginaDict.Add("/GPS/RecursoConfiableTracking.aspx".ToUpper(), 692)
|
PaginaDict.Add("/GPS/RecursoConfiableTracking.aspx".ToUpper(), 692)
|
||||||
PaginaDict.Add("/GPS/KimberlyClarkTracking.aspx".ToUpper(), -1)
|
PaginaDict.Add("/GPS/KimberlyClarkTracking.aspx".ToUpper(), -1)
|
||||||
PaginaDict.Add("/GPS/RepUnidades.aspx".ToUpper(), 780)
|
|
||||||
#End Region
|
#End Region
|
||||||
'INVENTARIOS
|
'INVENTARIOS
|
||||||
#Region "Inventarios"
|
#Region "Inventarios"
|
||||||
@@ -5953,19 +5952,6 @@ Public Class ClsPaginas
|
|||||||
Dim TipoDocumentoRef As String = ""
|
Dim TipoDocumentoRef As String = ""
|
||||||
Dim AplicaPagare As String = "1"
|
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 RutaCBB As String = String.Format("{0}CBB\{1}.jpg", Ruta, Vta.SerieFolio)
|
||||||
Dim ImagenCBB As New System.IO.FileInfo(RutaCBB)
|
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)
|
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)
|
||||||
@@ -6095,7 +6081,7 @@ Public Class ClsPaginas
|
|||||||
'Si no tiene CBB, SE GENERA
|
'Si no tiene CBB, SE GENERA
|
||||||
If Not ImagenCBB.Exists Then
|
If Not ImagenCBB.Exists Then
|
||||||
Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar()
|
Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar()
|
||||||
CBB.GenerarCBB(UsuarioActual.Empresa.RFC, RFCReceptor, Vta.Total.ToString.ToDecimal, Vta.FolioFiscal, RutaCBB)
|
CBB.GenerarCBB(UsuarioActual.Empresa.RFC, Vta.Cliente.RFC, Vta.Total.ToString.ToDecimal, Vta.FolioFiscal, RutaCBB)
|
||||||
End If
|
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)
|
ImgCBB = String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/{4}.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, Vta.SerieFolio)
|
||||||
|
|
||||||
@@ -6110,7 +6096,7 @@ Public Class ClsPaginas
|
|||||||
|
|
||||||
'CLIENTE
|
'CLIENTE
|
||||||
params.Add(New CrystalParametro("ClienteCodigo", Vta.Cliente.Codigo))
|
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 RFCReceptor = "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 Vta.Cliente.RFC = "XAXX010101000", $"{Vta.Cliente.Nombre}({Vta.AtencionA})", Vta.Cliente.Nombre))))
|
||||||
params.Add(New CrystalParametro("ClienteDireccion", ClienteDireccion))
|
params.Add(New CrystalParametro("ClienteDireccion", ClienteDireccion))
|
||||||
params.Add(New CrystalParametro("ClienteLugar", ClienteLugar))
|
params.Add(New CrystalParametro("ClienteLugar", ClienteLugar))
|
||||||
|
|
||||||
@@ -6142,7 +6128,7 @@ Public Class ClsPaginas
|
|||||||
params.Add(New CrystalParametro("SelloSAT", Vta.SelloSAT))
|
params.Add(New CrystalParametro("SelloSAT", Vta.SelloSAT))
|
||||||
|
|
||||||
params.Add(New CrystalParametro("QR", ImgCBB))
|
params.Add(New CrystalParametro("QR", ImgCBB))
|
||||||
params.Add(New CrystalParametro("ClienteRFC", RFCReceptor))
|
params.Add(New CrystalParametro("ClienteRFC", Vta.Cliente.RFC))
|
||||||
params.Add(New CrystalParametro("FormaPago", Vta.FormaPagoText))
|
params.Add(New CrystalParametro("FormaPago", Vta.FormaPagoText))
|
||||||
params.Add(New CrystalParametro("Moneda", Vta.Moneda))
|
params.Add(New CrystalParametro("Moneda", Vta.Moneda))
|
||||||
params.Add(New CrystalParametro("TipoCambio", Vta.TipoCambio.ToString))
|
params.Add(New CrystalParametro("TipoCambio", Vta.TipoCambio.ToString))
|
||||||
@@ -6477,18 +6463,7 @@ Public Class ClsPaginas
|
|||||||
Dim NombreArchivoDescarga As String = ""
|
Dim NombreArchivoDescarga As String = ""
|
||||||
Dim TipoDocumento As String = ""
|
Dim TipoDocumento As String = ""
|
||||||
Dim TipoDocumentoRef 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 RutaCBB As String = String.Format("{0}CBB\{1}.jpg", Ruta, Vta.SerieFolio)
|
||||||
Dim ImagenCBB As New System.IO.FileInfo(RutaCBB)
|
Dim ImagenCBB As New System.IO.FileInfo(RutaCBB)
|
||||||
@@ -6643,7 +6618,7 @@ Public Class ClsPaginas
|
|||||||
'Si no tiene CBB, SE GENERA
|
'Si no tiene CBB, SE GENERA
|
||||||
If Not ImagenCBB.Exists AndAlso Vta.CveCliente.ToEntero > 0 Then
|
If Not ImagenCBB.Exists AndAlso Vta.CveCliente.ToEntero > 0 Then
|
||||||
Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar()
|
Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar()
|
||||||
CBB.GenerarCBB(UsuarioActual.Empresa.RFC, RFCReceptor, Vta.Total.ToString.ToDecimal, Vta.FolioFiscal, RutaCBB)
|
CBB.GenerarCBB(UsuarioActual.Empresa.RFC, Vta.Cliente.RFC, Vta.Total.ToString.ToDecimal, Vta.FolioFiscal, RutaCBB)
|
||||||
End If
|
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)
|
ImgCBB = String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/{4}.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, Vta.SerieFolio)
|
||||||
|
|
||||||
@@ -6664,14 +6639,14 @@ Public Class ClsPaginas
|
|||||||
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 Vta.Cliente.RFC = "XAXX010101000", $"{Vta.Cliente.Nombre}({Vta.AtencionA})", Vta.Cliente.Nombre))))
|
||||||
params.Add(New ReportParameter("ClienteDireccion", ClienteDireccion))
|
params.Add(New ReportParameter("ClienteDireccion", ClienteDireccion))
|
||||||
params.Add(New ReportParameter("ClienteLugar", ClienteLugar))
|
params.Add(New ReportParameter("ClienteLugar", ClienteLugar))
|
||||||
params.Add(New ReportParameter("ClienteRFC", RFCReceptor))
|
params.Add(New ReportParameter("ClienteRFC", Vta.Cliente.RFC))
|
||||||
End If
|
End If
|
||||||
If Vta.CveEmpresaCRM.ToEntero > 0 Then
|
If Vta.CveEmpresaCRM.ToEntero > 0 Then
|
||||||
params.Add(New ReportParameter("ClienteCodigo", Vta.Cliente.Codigo))
|
params.Add(New ReportParameter("ClienteCodigo", Vta.Cliente.Codigo))
|
||||||
params.Add(New ReportParameter("ClienteNombre", Vta.Cliente.Nombre))
|
params.Add(New ReportParameter("ClienteNombre", Vta.Cliente.Nombre))
|
||||||
params.Add(New ReportParameter("ClienteDireccion", ClienteDireccion))
|
params.Add(New ReportParameter("ClienteDireccion", ClienteDireccion))
|
||||||
params.Add(New ReportParameter("ClienteLugar", ClienteLugar))
|
params.Add(New ReportParameter("ClienteLugar", ClienteLugar))
|
||||||
params.Add(New ReportParameter("ClienteRFC", RFCReceptor))
|
params.Add(New ReportParameter("ClienteRFC", Vta.Cliente.RFC))
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'TOTALES
|
'TOTALES
|
||||||
|
|||||||
@@ -4388,6 +4388,134 @@ Public Class ClsVentas
|
|||||||
End Function
|
End Function
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
|
#Region " AUTORIZACION LIMITES "
|
||||||
|
|
||||||
|
Public Function AutorizacionLimitesGet(CveCliente As Integer, CveCveVendedor As Integer, CveEstatus As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
DataAdapter("PA_Vta_AutorizacionLimitesGet", CommandType.StoredProcedure)
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||||
|
.Add("@CveCveVendedor", SqlDbType.Int).Value = CveCveVendedor
|
||||||
|
.Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
|
||||||
|
OnError("Ocurrió un error al obtener las Autorizaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function AutorizacionLimitesRemove(CveAutorizacion As Integer, CveCliente As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
DataAdapter("PA_Vta_AutorizacionLimitesRemove", CommandType.StoredProcedure)
|
||||||
|
|
||||||
|
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 la Autorización.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function AutorizacionLimitesAdd(CveCliente As Integer, CveVendedor As Integer, Importe As Decimal, CveUsuario As Integer, CveEstatus As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
DataAdapter("PA_Vta_AutorizacionLimitesAdd", CommandType.StoredProcedure)
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
|
||||||
|
.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
|
||||||
|
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
|
||||||
|
OnError("Ocurrió un error al agregar la Autorización.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function AutorizacionLimitesEstatusUpdate(CveAutorizacion As Integer, CveCliente As Integer, CveVenta As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
DataAdapter("PA_Vta_AutorizacionlimitesEstatusUpdate", CommandType.StoredProcedure)
|
||||||
|
|
||||||
|
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 la Autorización.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function AutorizacionLimitesUpdate(CveAutorizacion As Integer, CveCliente As Integer, CveVendedor As Integer, Importe As Decimal, CveEstatus As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
DataAdapter("PA_Vta_AutorizacionLimitesUpdate", CommandType.StoredProcedure)
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
|
||||||
|
.Add("@CveAutorizacion", SqlDbType.Int).Value = CveAutorizacion
|
||||||
|
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||||
|
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||||
|
.Add("@Importe", SqlDbType.Money).Value = Importe
|
||||||
|
.Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus
|
||||||
|
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
|
||||||
|
OnError("Ocurrió un error al actualizar el Estatus de la Autorización.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
#End Region
|
||||||
|
|
||||||
#Region "CANCELACION REMISION"
|
#Region "CANCELACION REMISION"
|
||||||
|
|
||||||
Public Function UpdateCancelaRemision(CveVenta As Integer, SeCancelaRemision As Boolean) As Boolean
|
Public Function UpdateCancelaRemision(CveVenta As Integer, SeCancelaRemision As Boolean) As Boolean
|
||||||
|
|||||||
@@ -406,6 +406,8 @@ Public Class E141 : Implements IHttpHandler
|
|||||||
Else
|
Else
|
||||||
retorno = "False"
|
retorno = "False"
|
||||||
End If
|
End If
|
||||||
|
Case "ActualizarPreciosJson"
|
||||||
|
retorno = ActualizarPreciosJson(If(FiltrarTodos = "1", True, False))
|
||||||
Case "ActualizarExistencias"
|
Case "ActualizarExistencias"
|
||||||
respuesta = ActualizarExistencias()
|
respuesta = ActualizarExistencias()
|
||||||
If respuesta Then
|
If respuesta Then
|
||||||
@@ -413,6 +415,8 @@ Public Class E141 : Implements IHttpHandler
|
|||||||
Else
|
Else
|
||||||
retorno = "False"
|
retorno = "False"
|
||||||
End If
|
End If
|
||||||
|
Case "ActualizarExistenciasJson"
|
||||||
|
retorno = ActualizarExistenciasJson(If(FiltrarTodos = "1", True, False))
|
||||||
Case "ActualizarVendedores"
|
Case "ActualizarVendedores"
|
||||||
respuesta = ActualizarVendedores(If(FiltrarTodos = "1", True, False))
|
respuesta = ActualizarVendedores(If(FiltrarTodos = "1", True, False))
|
||||||
If respuesta Then
|
If respuesta Then
|
||||||
@@ -2118,6 +2122,26 @@ Public Class E141 : Implements IHttpHandler
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Function ActualizarPreciosJson(Todos As Boolean) As String
|
||||||
|
Dim payload = New JObject()
|
||||||
|
|
||||||
|
Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0
|
||||||
|
|
||||||
|
Dim DtPS As DataTable = Nothing
|
||||||
|
Using ObjPS As New ClsProductosServicios
|
||||||
|
'OBTERNER PRECIOS DE PUBLICO GENERAL
|
||||||
|
If ObjPS.GetPreciosModificados(CveEmpresa, 44, If(Todos, -1, 1)) Then
|
||||||
|
DtPS = ObjPS.DtResultados.Copy()
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
|
|
||||||
|
If DtPS IsNot Nothing Then
|
||||||
|
payload.Add(New JProperty("products", GenerarPayloadPrecios(DtPS)))
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return payload.ToString()
|
||||||
|
End Function
|
||||||
|
|
||||||
Private Function GenerarPayloadPrecios(DtPS As DataTable) As JArray
|
Private Function GenerarPayloadPrecios(DtPS As DataTable) As JArray
|
||||||
Dim ArrayPS As New JArray
|
Dim ArrayPS As New JArray
|
||||||
For Each RowPS As DataRow In DtPS.Rows
|
For Each RowPS As DataRow In DtPS.Rows
|
||||||
@@ -2215,6 +2239,25 @@ Public Class E141 : Implements IHttpHandler
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Function ActualizarExistenciasJson(Todos As Boolean) As String
|
||||||
|
Dim payload = New JObject()
|
||||||
|
|
||||||
|
Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0
|
||||||
|
|
||||||
|
Dim DtPS As DataTable = Nothing
|
||||||
|
Using ObjPS As New ClsProductosServicios
|
||||||
|
If ObjPS.GetExistenciasEmpresa("-1", CveEmpresa) Then
|
||||||
|
DtPS = ObjPS.DtResultados.Copy()
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
|
|
||||||
|
If DtPS IsNot Nothing Then
|
||||||
|
payload.Add(New JProperty("stock", GenerarPayloadExistencias(DtPS)))
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return payload.ToString()
|
||||||
|
End Function
|
||||||
|
|
||||||
Private Function GenerarPayloadExistencias(DtPS As DataTable) As JArray
|
Private Function GenerarPayloadExistencias(DtPS As DataTable) As JArray
|
||||||
Dim ArrayPS As New JArray
|
Dim ArrayPS As New JArray
|
||||||
For Each RowPS As DataRow In DtPS.Rows
|
For Each RowPS As DataRow In DtPS.Rows
|
||||||
@@ -2233,7 +2276,7 @@ Public Class E141 : Implements IHttpHandler
|
|||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
#Region "A C T U A L I Z A R - E X I S T E N C I A S"
|
#Region "A C T U A L I Z A R - V E N D E D O R E S"
|
||||||
|
|
||||||
Private Function ActualizarVendedores(Todos As Boolean) As Boolean
|
Private Function ActualizarVendedores(Todos As Boolean) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
|
|||||||
@@ -92,6 +92,8 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
|||||||
ActualizaPrePoliza(context)
|
ActualizaPrePoliza(context)
|
||||||
Case "getpersonal"
|
Case "getpersonal"
|
||||||
getpersonal(context)
|
getpersonal(context)
|
||||||
|
Case "getcuentascontables"
|
||||||
|
GetCuentasContables(context)
|
||||||
Case "getcontratos"
|
Case "getcontratos"
|
||||||
GetContratos(context)
|
GetContratos(context)
|
||||||
Case "GettingCURP"
|
Case "GettingCURP"
|
||||||
@@ -580,6 +582,15 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
|
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
|
||||||
|
'Dim i As Integer = 0 'limpieza de columnas
|
||||||
|
'While i < DtRetorno.Columns.Count
|
||||||
|
' If Not DtRetorno.Columns(i).ColumnName.Contiene("CveProveedor", "NombreCortoProveedor") Then
|
||||||
|
' DtRetorno.Columns.RemoveAt(i)
|
||||||
|
' Else
|
||||||
|
' i = i + 1
|
||||||
|
' End If
|
||||||
|
'End While
|
||||||
|
|
||||||
DtRetorno.Columns("CveCliente").ColumnName = "id"
|
DtRetorno.Columns("CveCliente").ColumnName = "id"
|
||||||
DtRetorno.Columns(ColumnaNombre).ColumnName = "text"
|
DtRetorno.Columns(ColumnaNombre).ColumnName = "text"
|
||||||
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
|
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
|
||||||
@@ -615,11 +626,6 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
|||||||
ObjProveedores.Dispose()
|
ObjProveedores.Dispose()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Dim ObjProveedores As New ClsCompProveedores
|
|
||||||
'If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, "-1", Name, "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then
|
|
||||||
' DtRetorno = ObjProveedores.DtResultados
|
|
||||||
'End If
|
|
||||||
'ObjProveedores.Dispose()
|
|
||||||
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable) '.FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
|
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable) '.FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
|
||||||
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||||
DtRetorno = dt.FiltraParametros(String.Format("NombreCortoProveedor like '%{0}%'", Name))
|
DtRetorno = dt.FiltraParametros(String.Format("NombreCortoProveedor like '%{0}%'", Name))
|
||||||
@@ -628,14 +634,24 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
|
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
|
||||||
|
Dim i As Integer = 0 'limpieza de columnas
|
||||||
|
While i < DtRetorno.Columns.Count
|
||||||
|
If Not DtRetorno.Columns(i).ColumnName.Contiene("CveProveedor", "NombreCortoProveedor") Then
|
||||||
|
DtRetorno.Columns.RemoveAt(i)
|
||||||
|
Else
|
||||||
|
i = i + 1
|
||||||
|
End If
|
||||||
|
End While
|
||||||
|
|
||||||
DtRetorno.Columns("CveProveedor").ColumnName = "id"
|
DtRetorno.Columns("CveProveedor").ColumnName = "id"
|
||||||
DtRetorno.Columns("NombreCortoProveedor").ColumnName = "text"
|
DtRetorno.Columns("NombreCortoProveedor").ColumnName = "text"
|
||||||
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
|
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
|
||||||
context.Response.Write(retorno)
|
context.Response.Write(retorno)
|
||||||
|
DtRetorno.Dispose()
|
||||||
Else
|
Else
|
||||||
context.Response.Write("[]")
|
context.Response.Write("[]")
|
||||||
End If
|
End If
|
||||||
DtRetorno.Dispose()
|
|
||||||
Return retorno
|
Return retorno
|
||||||
End Function
|
End Function
|
||||||
#End Region
|
#End Region
|
||||||
@@ -1169,11 +1185,6 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
|||||||
ObjPersonal.Dispose()
|
ObjPersonal.Dispose()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Dim ObjProveedores As New ClsCompProveedores
|
|
||||||
'If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, "-1", Name, "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then
|
|
||||||
' DtRetorno = ObjProveedores.DtResultados
|
|
||||||
'End If
|
|
||||||
'ObjProveedores.Dispose()
|
|
||||||
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable).FiltraParametros($"CveEmpresa = {CveEmpresa}")
|
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable).FiltraParametros($"CveEmpresa = {CveEmpresa}")
|
||||||
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||||
DtRetorno = dt.FiltraParametros($"NombreCompleto like '%{Name}%'")
|
DtRetorno = dt.FiltraParametros($"NombreCompleto like '%{Name}%'")
|
||||||
@@ -1181,6 +1192,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
|
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
|
||||||
|
|
||||||
DtRetorno.Columns("CvePersonal").ColumnName = "id"
|
DtRetorno.Columns("CvePersonal").ColumnName = "id"
|
||||||
DtRetorno.Columns("NombreCompleto").ColumnName = "text"
|
DtRetorno.Columns("NombreCompleto").ColumnName = "text"
|
||||||
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
|
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
|
||||||
@@ -1227,4 +1239,47 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
|||||||
Return retorno
|
Return retorno
|
||||||
End Function
|
End Function
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
#Region "Get Cuentas"
|
||||||
|
Private Function GetCuentasContables(ByVal context As HttpContext) As String
|
||||||
|
Dim retorno As String = ""
|
||||||
|
Dim DtRetorno As DataTable = Nothing
|
||||||
|
|
||||||
|
Dim usuario As Usuario = UsuarioActual(context)
|
||||||
|
Dim CveEmpresa As String
|
||||||
|
If IsNothing(usuario) Then
|
||||||
|
context.Response.Write("")
|
||||||
|
Else
|
||||||
|
CveEmpresa = usuario.CveEmpresa
|
||||||
|
|
||||||
|
Dim Name = IfNull(context.Request("Name"), "-1").ToString
|
||||||
|
Dim ObjConta As New ClsContabilidad
|
||||||
|
If ObjConta.GetCuentas(-1, "-1", 1, CveEmpresa, Nombre:=Name) Then
|
||||||
|
DtRetorno = ObjConta.DtResultados
|
||||||
|
End If
|
||||||
|
ObjConta.Dispose()
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
|
||||||
|
Dim i As Integer = 0 'limpieza de columnas
|
||||||
|
While i < DtRetorno.Columns.Count
|
||||||
|
If Not DtRetorno.Columns(i).ColumnName.Contiene("CveCuenta", "CtaCodigo") Then
|
||||||
|
DtRetorno.Columns.RemoveAt(i)
|
||||||
|
Else
|
||||||
|
i = i + 1
|
||||||
|
End If
|
||||||
|
End While
|
||||||
|
DtRetorno.Columns("CveCuenta").ColumnName = "id"
|
||||||
|
DtRetorno.Columns("CtaCodigo").ColumnName = "text"
|
||||||
|
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
|
||||||
|
context.Response.Write(retorno)
|
||||||
|
Else
|
||||||
|
context.Response.Write("[]")
|
||||||
|
End If
|
||||||
|
|
||||||
|
DtRetorno.Dispose()
|
||||||
|
Return retorno
|
||||||
|
End Function
|
||||||
|
#End Region
|
||||||
End Class
|
End Class
|
||||||
@@ -715,7 +715,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas
|
|||||||
TCDoc = get_GlobalTipoCambio(TxtFechaDocumento.Text.ToDate().AddMonths(-1).LastDayOfMonth()).ToDecimal();
|
TCDoc = get_GlobalTipoCambio(TxtFechaDocumento.Text.ToDate().AddMonths(-1).LastDayOfMonth()).ToDecimal();
|
||||||
}
|
}
|
||||||
|
|
||||||
Importe = gvr.FCTextBox("TxtAbonar").Text.ToDecimal();
|
Importe = gvr.FCTextBox("TxtAbonar").Text.ToDecimal().RoundSQL();
|
||||||
ImporteMN = Importe;
|
ImporteMN = Importe;
|
||||||
ImporteComplementaria = 0;
|
ImporteComplementaria = 0;
|
||||||
|
|
||||||
@@ -756,8 +756,8 @@ public partial class Bancos_PagoDeudor : ClsPaginas
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImporteMN = Math.Round(ImporteMN, 2, MidpointRounding.AwayFromZero);
|
ImporteMN = ImporteMN.RoundSQL();
|
||||||
ImporteComplementaria = Math.Round(ImporteComplementaria, 2, MidpointRounding.AwayFromZero);
|
ImporteComplementaria = ImporteComplementaria.RoundSQL();
|
||||||
|
|
||||||
if (tCveMoneda != 1)
|
if (tCveMoneda != 1)
|
||||||
{
|
{
|
||||||
@@ -825,7 +825,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ImporteMNBanco = ImporteBanco * TC;
|
ImporteMNBanco = (ImporteBanco * TC).RoundSQL();
|
||||||
ImporteComplementaria = 0;
|
ImporteComplementaria = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4422,7 +4422,7 @@
|
|||||||
<asp:UpdatePanel ID="UpIVA" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="UpIVA" runat="server" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-3" id="divIVA" runat="server" visible="false">
|
<div class="col-md-3" id="divIVA" runat="server" visible="true">
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
<asp:DropDownList ID="DdlIVA" CssClass="form-control select2me" Style="width: 100%; display: inline-block;" runat="server" Enabled="false">
|
<asp:DropDownList ID="DdlIVA" CssClass="form-control select2me" Style="width: 100%; display: inline-block;" runat="server" Enabled="false">
|
||||||
<asp:ListItem Selected="True" Value="1.08">8%</asp:ListItem>
|
<asp:ListItem Selected="True" Value="1.08">8%</asp:ListItem>
|
||||||
|
|||||||
@@ -4621,6 +4621,13 @@ Partial Class Compras_Compras
|
|||||||
'End If
|
'End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'Compra
|
||||||
|
Dim CveFactura As Integer = -1
|
||||||
|
If Request("CveFactura") IsNot Nothing Then
|
||||||
|
CveFactura = Request("CveFactura").ToString.ToEntero
|
||||||
|
End If
|
||||||
|
|
||||||
'si el registro es manual, toma el mismo dato
|
'si el registro es manual, toma el mismo dato
|
||||||
If CveFactura <= 0 Then TotalOriginal = TxtTotal.Text.ToDecimal
|
If CveFactura <= 0 Then TotalOriginal = TxtTotal.Text.ToDecimal
|
||||||
|
|
||||||
@@ -4637,14 +4644,13 @@ Partial Class Compras_Compras
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
'Compra
|
|
||||||
|
|
||||||
If ObjCompras.AddCompra(DdlTipoComprobante.SelectedValue, TxtDescripcion.Text.Trim, TxtSerie.Text.Trim, TxtFolio.Text.Trim, TxtFolioSecundario.Text.Trim, CveProveedor, TxtSubTotal.Text.ToDouble, TxtDescuento.Text.ToDouble,
|
If ObjCompras.AddCompra(DdlTipoComprobante.SelectedValue, TxtDescripcion.Text.Trim, TxtSerie.Text.Trim, TxtFolio.Text.Trim, TxtFolioSecundario.Text.Trim, CveProveedor, TxtSubTotal.Text.ToDouble, TxtDescuento.Text.ToDouble,
|
||||||
LblAmortizacion.Text.ToDouble, TxtIVA.Text.ToDouble, TxtRetIVA.Text.ToDouble, TxtRetISR.Text.ToDouble, TxtIEPS.Text.ToDouble, TxtOtrosImpuestos.Text.ToDouble,
|
LblAmortizacion.Text.ToDouble, TxtIVA.Text.ToDouble, TxtRetIVA.Text.ToDouble, TxtRetISR.Text.ToDouble, TxtIEPS.Text.ToDouble, TxtOtrosImpuestos.Text.ToDouble,
|
||||||
TxtRedondeo.Text.ToDouble, TxtTotal.Text.ToDouble, TxtFecha.Text.Trim.ToDate, DdlMoneda.SelectedValue.ToEntero, TipoCambio, TxtFechaPago.Text.Trim.ToDate, ChkAplicaNotaCredito.Checked, TxtObsFact.Text.Trim, CveEstatusFactura,
|
TxtRedondeo.Text.ToDouble, TxtTotal.Text.ToDouble, TxtFecha.Text.Trim.ToDate, DdlMoneda.SelectedValue.ToEntero, TipoCambio, TxtFechaPago.Text.Trim.ToDate, ChkAplicaNotaCredito.Checked, TxtObsFact.Text.Trim, CveEstatusFactura,
|
||||||
CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, IdPoliza, CveCajaChica:=CveCajaChica, CvePersonal:=CvePersonal, NumeroReembolso:=NumeroReembolso, CveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero,
|
CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, IdPoliza, CveCajaChica:=CveCajaChica, CvePersonal:=CvePersonal, NumeroReembolso:=NumeroReembolso, CveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero,
|
||||||
AplicoPromocion:=ChkOCPromocion.Checked, PorcentajeIVA:=PorcentajeIVA, CveMetodoPago:=CveMetodoPago, CveRetIVAConcepto:=If(DdlRetIVAConcepto.Items.Count > 0, DdlRetIVAConcepto.SelectedValue.ToEntero, -1), CveConceptoContableAlmacen:=CveConceptoContableAlmacen,
|
AplicoPromocion:=ChkOCPromocion.Checked, PorcentajeIVA:=PorcentajeIVA, CveMetodoPago:=CveMetodoPago, CveRetIVAConcepto:=If(DdlRetIVAConcepto.Items.Count > 0, DdlRetIVAConcepto.SelectedValue.ToEntero, -1), CveConceptoContableAlmacen:=CveConceptoContableAlmacen,
|
||||||
CveRetISRConcepto:=If(DdlRetISRConcepto.Items.Count > 0, DdlRetISRConcepto.SelectedValue.ToEntero, -1), NoDeducible:=EsNoDeducible, CveTipoCompra:=DdlTipoCompra.SelectedValue.ToEntero, TotalOriginal:=TotalOriginal, CveTipoConcepto:=CveTipoConcepto, EsImportacion:=EsImportacion) Then
|
CveRetISRConcepto:=If(DdlRetISRConcepto.Items.Count > 0, DdlRetISRConcepto.SelectedValue.ToEntero, -1), NoDeducible:=EsNoDeducible, CveTipoCompra:=DdlTipoCompra.SelectedValue.ToEntero, TotalOriginal:=TotalOriginal, CveTipoConcepto:=CveTipoConcepto, EsImportacion:=EsImportacion, CveFactura:=CveFactura) Then
|
||||||
|
|
||||||
ViewState("CveCompra") = ObjCompras.CveCompra
|
ViewState("CveCompra") = ObjCompras.CveCompra
|
||||||
If ObjCompras.DtResultados.Rows.Count > 0 Then ViewState("CompraFolio") = ObjCompras.DtResultados.Rows(0)("vFolio").ToString
|
If ObjCompras.DtResultados.Rows.Count > 0 Then ViewState("CompraFolio") = ObjCompras.DtResultados.Rows(0)("vFolio").ToString
|
||||||
@@ -8424,16 +8430,20 @@ Partial Class Compras_Compras
|
|||||||
Msg.Append("¿Desea realizar una evaluacion al proveedor?")
|
Msg.Append("¿Desea realizar una evaluacion al proveedor?")
|
||||||
Msg.AppendFormat($"</br><a class=""Texto"" target='_blank' href=""/Compras/EvaluacionProveedor.aspx?CveEvaluacionProveedor={CveEvaluacionProveedor}"">Evaluar Proveedor.</a>")
|
Msg.AppendFormat($"</br><a class=""Texto"" target='_blank' href=""/Compras/EvaluacionProveedor.aspx?CveEvaluacionProveedor={CveEvaluacionProveedor}"">Evaluar Proveedor.</a>")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
BtnGuardar.Enabled = False
|
||||||
|
UpFacturar.Update()
|
||||||
|
|
||||||
|
Alert(Msg.ToString, TipoMensaje.MsgInformacion, MsgAccionAceptar)
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
ObjCompras.RollBack()
|
ObjCompras.RollBack()
|
||||||
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
|
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
|
||||||
Alert("Ocurrio un error al guardar la compra. Por favor intente nuevamente.", TipoMensaje.MsgError)
|
Alert("Ocurrio un error al guardar la compra. Por favor intente nuevamente.", TipoMensaje.MsgError)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
BtnGuardar.Enabled = False
|
|
||||||
UpFacturar.Update()
|
|
||||||
|
|
||||||
Alert(Msg.ToString, TipoMensaje.MsgInformacion, MsgAccionAceptar)
|
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
@@ -18225,12 +18235,12 @@ Partial Class Compras_Compras
|
|||||||
If Version = "3.3" And CveSATPS > 0 Then
|
If Version = "3.3" And CveSATPS > 0 Then
|
||||||
Dim DrPSSAT As DataRow = Nothing
|
Dim DrPSSAT As DataRow = Nothing
|
||||||
If CargaXml Then
|
If CargaXml Then
|
||||||
DrPSSAT = GlobalDTPSATPS("-1").FiltroPrimero(String.Format("SATClavePS={0}", CveSATPS))
|
DrPSSAT = GlobalDTPSATPS("-1", CveSATPS).FiltroPrimero("")
|
||||||
'If GlobalDTPSATPS().FiltraParametros(String.Format("SATClavePS={0}", CveSATPS)).Rows.Count > 0 Then
|
'If GlobalDTPSATPS().FiltraParametros(String.Format("SATClavePS={0}", CveSATPS)).Rows.Count > 0 Then
|
||||||
' DrPSSAT = GlobalDTPSATPS().FiltraParametros(String.Format("SATClavePS={0}", CveSATPS)).Rows(0)
|
' DrPSSAT = GlobalDTPSATPS().FiltraParametros(String.Format("SATClavePS={0}", CveSATPS)).Rows(0)
|
||||||
'End If
|
'End If
|
||||||
Else
|
Else
|
||||||
DrPSSAT = GlobalDTPSATPS("-1").FiltroPrimero(String.Format("SATClavePS={0}", CveSATPS))
|
DrPSSAT = GlobalDTPSATPS("-1", CveSATPS).FiltroPrimero("") '= GlobalDTPSATPS().FiltroPrimero(String.Format("SATClavePS={0}", CveSATPS))
|
||||||
'If GlobalDTPSATPS().FiltraParametros(String.Format("CveSATPS={0}", CveSATPS)).Rows.Count > 0 Then
|
'If GlobalDTPSATPS().FiltraParametros(String.Format("CveSATPS={0}", CveSATPS)).Rows.Count > 0 Then
|
||||||
' DrPSSAT = GlobalDTPSATPS().FiltraParametros(String.Format("CveSATPS={0}", CveSATPS)).Rows(0)
|
' DrPSSAT = GlobalDTPSATPS().FiltraParametros(String.Format("CveSATPS={0}", CveSATPS)).Rows(0)
|
||||||
'End If
|
'End If
|
||||||
|
|||||||
@@ -453,8 +453,6 @@ Partial Class ContabilidadC_RegPrePolizaS
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
divDatosPrincipales.Visible = False
|
divDatosPrincipales.Visible = False
|
||||||
divObservaciones.Visible = False
|
divObservaciones.Visible = False
|
||||||
UPMovs.Visible = False
|
UPMovs.Visible = False
|
||||||
@@ -1958,7 +1956,7 @@ Partial Class ContabilidadC_RegPrePolizaS
|
|||||||
End If
|
End If
|
||||||
ObjConta2.Dispose()
|
ObjConta2.Dispose()
|
||||||
|
|
||||||
If CveCuenta <= 0 Then
|
If CveCuenta <= 0 AndAlso CveConceptoContable <> 30 Then ' concepto 30-Bancos, tomará la cuetna de las especificaciones que se hagan enel modal
|
||||||
Alert(String.Format("La cuenta <b>{0}</b> no se reconoció, favor de verificar el archivo.", Row("Cuenta").ToString))
|
Alert(String.Format("La cuenta <b>{0}</b> no se reconoció, favor de verificar el archivo.", Row("Cuenta").ToString))
|
||||||
DtMovimientos.Clear()
|
DtMovimientos.Clear()
|
||||||
Exit For
|
Exit For
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ Partial Class AC_RepEstadoActividades
|
|||||||
'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray
|
'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray
|
||||||
'e.Row.ControlStyle.ForeColor = Drawing.Color.White
|
'e.Row.ControlStyle.ForeColor = Drawing.Color.White
|
||||||
e.Row.ControlStyle.Font.Bold = True
|
e.Row.ControlStyle.Font.Bold = True
|
||||||
ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then
|
ElseIf e.Row.DBCampo("CtaMayor").ToString.Contiene("3", "4") Then
|
||||||
'e.Row.CssClass = "SubTotales3"
|
'e.Row.CssClass = "SubTotales3"
|
||||||
e.Row.ControlStyle.Font.Bold = True
|
e.Row.ControlStyle.Font.Bold = True
|
||||||
End If
|
End If
|
||||||
@@ -277,7 +277,7 @@ Partial Class AC_RepEstadoActividades
|
|||||||
'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray
|
'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray
|
||||||
'e.Row.ControlStyle.ForeColor = Drawing.Color.White
|
'e.Row.ControlStyle.ForeColor = Drawing.Color.White
|
||||||
e.Row.ControlStyle.Font.Bold = True
|
e.Row.ControlStyle.Font.Bold = True
|
||||||
ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then
|
ElseIf e.Row.DBCampo("CtaMayor").ToString.Contiene("3", "4") Then
|
||||||
'e.Row.CssClass = "SubTotales"
|
'e.Row.CssClass = "SubTotales"
|
||||||
e.Row.ControlStyle.Font.Bold = True
|
e.Row.ControlStyle.Font.Bold = True
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -1233,14 +1233,14 @@ Partial Class General_SaldosIniciales
|
|||||||
Dim Folio As Integer = Row("Folio").ToString.ToEntero
|
Dim Folio As Integer = Row("Folio").ToString.ToEntero
|
||||||
Dim Fecha As Date = Row("Fecha").ToString.ToDate
|
Dim Fecha As Date = Row("Fecha").ToString.ToDate
|
||||||
Dim FechaVencimiento As Date = Row("Fecha Vencimiento").ToString.ToDate
|
Dim FechaVencimiento As Date = Row("Fecha Vencimiento").ToString.ToDate
|
||||||
Dim ImpuestoLocal As Double = If(dt.Columns.Contains("ImpuestoLocal"), Row("ImpuestoLocal").ToString.ToDouble, 0.0)
|
Dim ImpuestoLocal As Decimal = If(dt.Columns.Contains("ImpuestoLocal"), Row("ImpuestoLocal").ToString.ToDecimal, 0D)
|
||||||
Dim Amortizacion As Double = If(dt.Columns.Contains("Amort.Ant"), Row("Amort.Ant").ToString.ToDouble, 0.0)
|
Dim Amortizacion As Double = If(dt.Columns.Contains("Amort.Ant"), Row("Amort.Ant").ToString.ToDouble, 0.0)
|
||||||
Dim SubTotal As Decimal = Row("SubTotal").ToString.ToDecimal
|
Dim SubTotal As Decimal = Row("SubTotal").ToString.ToDecimal
|
||||||
Dim IVA As Decimal = Row("IVA").ToString.ToDecimal
|
Dim IVA As Decimal = Row("IVA").ToString.ToDecimal
|
||||||
Dim Total As Decimal = Row("Total").ToString.ToDecimal
|
Dim Total As Decimal = Row("Total").ToString.ToDecimal
|
||||||
Dim Saldo As Decimal = Row("Saldo").ToString.ToDecimal
|
Dim Saldo As Decimal = Row("Saldo").ToString.ToDecimal
|
||||||
Dim CveCliente As Integer = DtClientes.FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString.ToEntero
|
Dim CveCliente As Integer = DtClientes.FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString.ToEntero
|
||||||
Dim RetIVA As Double = Row("Ret IVA").ToString.ToDouble
|
Dim RetIVA As Decimal = Row("Ret IVA").ToString.ToDecimal
|
||||||
Dim RetISR As Double = Row("Ret ISR").ToString.ToDouble
|
Dim RetISR As Double = Row("Ret ISR").ToString.ToDouble
|
||||||
Dim Moneda As String = Row("Moneda").ToString
|
Dim Moneda As String = Row("Moneda").ToString
|
||||||
Dim TipoCambio As String = Row("Tipo Cambio").ToString
|
Dim TipoCambio As String = Row("Tipo Cambio").ToString
|
||||||
@@ -1249,7 +1249,6 @@ Partial Class General_SaldosIniciales
|
|||||||
Dim CveVendedor As Integer = 0
|
Dim CveVendedor As Integer = 0
|
||||||
Dim IEPS As Decimal = 0 'Row("IEPS").ToString.ToDecimal
|
Dim IEPS As Decimal = 0 'Row("IEPS").ToString.ToDecimal
|
||||||
Dim CveClienteSucursal As Integer = 0 'Row("CveClienteSucursal").ToString.ToEntero
|
Dim CveClienteSucursal As Integer = 0 'Row("CveClienteSucursal").ToString.ToEntero
|
||||||
Dim ImpuestosLocales As Decimal = If(dt.Columns.Contains("ImpuestoLocal"), Row("ImpuestoLocal").ToString.ToDecimal, 0)
|
|
||||||
Dim FolioFiscal As String = If(dt.Columns.Contains("Folio Fiscal"), Row("Folio Fiscal").ToString, "")
|
Dim FolioFiscal As String = If(dt.Columns.Contains("Folio Fiscal"), Row("Folio Fiscal").ToString, "")
|
||||||
Dim PorcentajeIVA As Decimal = If(dt.Columns.Contains("PorcentajeIVA"), Round(Row("PorcentajeIVA").ToString.ToDecimal, 4), 0)
|
Dim PorcentajeIVA As Decimal = If(dt.Columns.Contains("PorcentajeIVA"), Round(Row("PorcentajeIVA").ToString.ToDecimal, 4), 0)
|
||||||
|
|
||||||
@@ -1300,7 +1299,7 @@ Partial Class General_SaldosIniciales
|
|||||||
0, 0, 0, FechaVencimiento, Fecha, "", "", Fecha, CveVendedor, Folio2, "", "", 0, 0, 0, "-1".ToDate, "-1".ToDate, "-1".ToDate, -1, -1, 0, CvePrePoliza,
|
0, 0, 0, FechaVencimiento, Fecha, "", "", Fecha, CveVendedor, Folio2, "", "", 0, 0, 0, "-1".ToDate, "-1".ToDate, "-1".ToDate, -1, -1, 0, CvePrePoliza,
|
||||||
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Serie:=Serie, CveSubProyecto:=Sucursal.ToEntero, CveSubProyectoEjecucion:=Sucursal.ToEntero,
|
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Serie:=Serie, CveSubProyecto:=Sucursal.ToEntero, CveSubProyectoEjecucion:=Sucursal.ToEntero,
|
||||||
CveSubProyectoCobranza:=Sucursal.ToEntero, IEPS:=IEPS,
|
CveSubProyectoCobranza:=Sucursal.ToEntero, IEPS:=IEPS,
|
||||||
ObservacionesAlmacen:=Transaccion, Entrega:=CodCliente, ImpuestoLocal:=ImpuestosLocales) Then
|
ObservacionesAlmacen:=Transaccion, Entrega:=CodCliente, ImpuestoLocal:=ImpuestoLocal) Then
|
||||||
ErrorVentas = True
|
ErrorVentas = True
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
@@ -1329,14 +1328,22 @@ Partial Class General_SaldosIniciales
|
|||||||
If UsuarioActual.CveEmpresa.Contiene(119, 158) Then UsaComplementaria = True
|
If UsuarioActual.CveEmpresa.Contiene(119, 158) Then UsaComplementaria = True
|
||||||
|
|
||||||
'PrePólizaDetalle
|
'PrePólizaDetalle
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SubTotal, Folio.ToString, 4, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveClasificacion:=CveClasificacion, ImporteMX:=SubTotal, CveSubProyecto:=Sucursal.ToEntero) Then ErrorVentas = True : Exit For
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SubTotal, Folio.ToString, 4, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveClasificacion:=CveClasificacion, ImporteMX:=SubTotal, CveSubProyecto:=Sucursal.ToEntero, PorcentajeImpuesto:=PorcentajeIVA) Then ErrorVentas = True : Exit For
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total, Folio.ToString, ConceptoContable, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Total) Then ErrorVentas = True : Exit For
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total, Folio.ToString, ConceptoContable, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Total, PorcentajeImpuesto:=PorcentajeIVA) Then ErrorVentas = True : Exit For
|
||||||
|
|
||||||
If IVA > 0 Then
|
If IVA > 0 Then
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IVA, Folio.ToString, 13, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=IVA, PorcentajeImpuesto:=PorcentajeIVA) Then ErrorVentas = True : Exit For
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IVA, Folio.ToString, 13, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=IVA, PorcentajeImpuesto:=PorcentajeIVA) Then ErrorVentas = True : Exit For
|
||||||
End If
|
End If
|
||||||
'If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IEPS, Folio.ToString, 38, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=IEPS) Then ErrorVentas = True : Exit For
|
'If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IEPS, Folio.ToString, 38, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=IEPS) Then ErrorVentas = True : Exit For
|
||||||
|
|
||||||
|
If RetIVA > 0 Then
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, RetIVA, Folio.ToString, 8, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=RetIVA, PorcentajeImpuesto:=PorcentajeIVA) Then ErrorVentas = True : Exit For
|
||||||
|
End If
|
||||||
|
If ImpuestoLocal > 0 Then
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImpuestoLocal, Folio.ToString, 27, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=ImpuestoLocal, PorcentajeImpuesto:=PorcentajeIVA) Then ErrorVentas = True : Exit For
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
If UsaComplementaria Then
|
If UsaComplementaria Then
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total * TipoCambio.ToDecimal - Total, Folio.ToString, 203, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteME:=Total, ImporteMX:=Total * TipoCambio.ToDecimal - Total, TipoCambio:=TipoCambio.ToDecimal) Then ErrorVentas = True : Exit For
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total * TipoCambio.ToDecimal - Total, Folio.ToString, 203, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteME:=Total, ImporteMX:=Total * TipoCambio.ToDecimal - Total, TipoCambio:=TipoCambio.ToDecimal) Then ErrorVentas = True : Exit For
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -1331,7 +1331,7 @@ Partial Class Inventarios_EntradasSalidas
|
|||||||
tCveSubProyecto = drA2("CveSubProyecto").ToString.ToEntero
|
tCveSubProyecto = drA2("CveSubProyecto").ToString.ToEntero
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.CveEmpresa = 119 AndAlso Not tCveSubProyecto.Contiene(10276) Then
|
If UsuarioActual.CveEmpresa = 119 AndAlso Not tCveSubProyecto.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then
|
||||||
FechaCaducidadVal = MinFecha
|
FechaCaducidadVal = MinFecha
|
||||||
FechaCaducidad = MinFecha
|
FechaCaducidad = MinFecha
|
||||||
Lote = ""
|
Lote = ""
|
||||||
@@ -3845,16 +3845,16 @@ Partial Class Inventarios_EntradasSalidas
|
|||||||
Dim ObjInventario As New ClsInventarios
|
Dim ObjInventario As New ClsInventarios
|
||||||
Dim CveUM As Integer
|
Dim CveUM As Integer
|
||||||
Dim Mensaje As String = ""
|
Dim Mensaje As String = ""
|
||||||
Dim FechaCaducidad As Date
|
'Dim FechaCaducidad As Date
|
||||||
Dim lote As String
|
'Dim lote As String
|
||||||
If ObjProductosServicios.GetPS(DdlPSSalida.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa) Then
|
If ObjProductosServicios.GetPS(DdlPSSalida.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa) Then
|
||||||
If ObjProductosServicios.DtResultados.Rows.Count > 0 Then
|
If ObjProductosServicios.DtResultados.Rows.Count > 0 Then
|
||||||
CveUM = ObjProductosServicios.CveUnidadMedida.ToString.ToEntero
|
CveUM = ObjProductosServicios.CveUnidadMedida.ToString.ToEntero
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
FechaCaducidad = If(ObjProductosServicios.AplicaCaducidad, TxtCaducidadSalida.Text.ToDate, MinFecha)
|
Dim Lote As String = If(TxtLoteSalida.Text = "", "", TxtLoteSalida.Text)
|
||||||
lote = If(ObjProductosServicios.AplicaLote, TxtLoteSalida.Text.ToString, "-1")
|
Dim FechaCaducidad As Date = If(TxtCaducidadSalida.Text = "", MinFecha.ToShortDateString, TxtCaducidadSalida.Text).ToDate
|
||||||
|
|
||||||
If ObjInventario.GetExistenciasPS(DdlPSSalida.SelectedValue.ToEntero, CveUM, UsuarioActual.CveEmpresa, DdlAlmacenInventarioFisico.SelectedValue.ToEntero, PendientePorSurtir:=1, Lote:=lote, FechaCaducidad:=FechaCaducidad) >= TxtCantidadSalidaInv.Text.ToDouble Then
|
If ObjInventario.GetExistenciasPS(DdlPSSalida.SelectedValue.ToEntero, CveUM, UsuarioActual.CveEmpresa, DdlAlmacenInventarioFisico.SelectedValue.ToEntero, PendientePorSurtir:=1, Lote:=lote, FechaCaducidad:=FechaCaducidad) >= TxtCantidadSalidaInv.Text.ToDouble Then
|
||||||
If Not DdlPSSalida.SelectedValue.ToEntero > 0 Then
|
If Not DdlPSSalida.SelectedValue.ToEntero > 0 Then
|
||||||
|
|||||||
@@ -973,8 +973,8 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
|
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
|
||||||
e.Row.FCTextBox("TxtCaducidad").Visible = True
|
e.Row.FCTextBox("TxtCaducidad").Visible = True
|
||||||
e.Row.FCLinkButton("LnkCaducidad").Visible = True
|
e.Row.FCLinkButton("LnkCaducidad").Visible = True
|
||||||
e.Row.FCTextBox("TxtCaducidad").ReadOnly = True
|
e.Row.FCTextBox("TxtCaducidad").readonly = True
|
||||||
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
|
CType(e.row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
|
||||||
|
|
||||||
'si aplica caducidad y viene vacía (posible por venta anterior), que se active su registro
|
'si aplica caducidad y viene vacía (posible por venta anterior), que se active su registro
|
||||||
If e.Row.FCTextBox("TxtCaducidad").Text = "" OrElse e.Row.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha Then
|
If e.Row.FCTextBox("TxtCaducidad").Text = "" OrElse e.Row.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha Then
|
||||||
@@ -2275,6 +2275,7 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
|
|
||||||
If ErrorMovInv Then Exit For
|
If ErrorMovInv Then Exit For
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
@@ -2601,27 +2602,24 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
Dim CveAlmacenOrigen = If(CveAlmacenTraspasoDestino > 0, CveAlmacenTraspasoDestino, DdlAlmacen.SelectedValue.ToEntero())
|
Dim CveAlmacenOrigen = If(CveAlmacenTraspasoDestino > 0, CveAlmacenTraspasoDestino, DdlAlmacen.SelectedValue.ToEntero())
|
||||||
Dim CveSeccionAlmacen As Integer = 0
|
Dim CveSeccionAlmacen As Integer = 0
|
||||||
Dim ValorTraspaso As Decimal = 0
|
Dim ValorTraspaso As Decimal = 0
|
||||||
|
If DtTempApartados IsNot Nothing AndAlso DtTempApartados.Rows.Count > 0 Then
|
||||||
'SI TIENE APARTADOS DEBE GENERAR LOS TRASPASOS
|
|
||||||
If DtTempApartados.Rows.Count > 0 Then
|
|
||||||
|
|
||||||
For Each Dr As DataRow In DtTempApartados.Rows
|
For Each Dr As DataRow In DtTempApartados.Rows
|
||||||
|
|
||||||
If CveMovimientoSalidaApartado = -1 Or CveAlmacenApartado <> Dr("CveAlmacen").ToString().ToEntero() Then
|
If CveMovimientoSalidaApartado = -1 Or CveAlmacenApartado <> Dr("CveAlmacen").ToString().ToEntero() Then
|
||||||
CveMovimientoSalidaApartado = ObjInventario.AddMovimiento(CveAlmacenOrigen, 8, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1,
|
CveMovimientoSalidaApartado = ObjInventario.AddMovimiento(CveAlmacenOrigen, 8, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1,
|
||||||
Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente,
|
Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente,
|
||||||
CveAlmacenDestino:=Dr("CveAlmacen").ToString().ToEntero(), Modulo:="RE/G9")
|
CveAlmacenDestino:=Dr("CveAlmacen").ToString().ToEntero(), Modulo:="RE/G9")
|
||||||
FolioSalida = ObjInventario.Folio
|
FolioSalida = ObjInventario.Folio
|
||||||
CveAlmacenApartado = Dr("CveAlmacen").ToString().ToEntero()
|
CveAlmacenApartado = Dr("CveAlmacen").ToString().ToEntero()
|
||||||
|
|
||||||
|
Dim DrMovto = DtTraspasos.NewRow
|
||||||
|
DrMovto("Almacen") = Dr("Almacen").ToString().ToEntero()
|
||||||
|
DrMovto("CveAlmacen") = Dr("CveAlmacen").ToString().ToEntero()
|
||||||
|
DrMovto("CveMovimientoSalida") = CveMovimientoSalidaApartado
|
||||||
|
DrMovto("FolioSalida") = FolioSalida
|
||||||
|
DtTraspasos.Rows.Add(DrMovto)
|
||||||
|
End If
|
||||||
|
|
||||||
Dim DrMovto = DtTraspasos.NewRow
|
|
||||||
DrMovto("Almacen") = Dr("Almacen").ToString().ToEntero()
|
|
||||||
DrMovto("CveAlmacen") = Dr("CveAlmacen").ToString().ToEntero()
|
|
||||||
DrMovto("CveMovimientoSalida") = CveMovimientoSalidaApartado
|
|
||||||
DrMovto("FolioSalida") = FolioSalida
|
|
||||||
DtTraspasos.Rows.Add(DrMovto)
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Not CveMovimientoSalidaApartado > 0 Then
|
If Not CveMovimientoSalidaApartado > 0 Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados")
|
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados")
|
||||||
@@ -2636,85 +2634,82 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
CveSeccionAlmacen = -3
|
CveSeccionAlmacen = -3
|
||||||
|
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaApartado, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), Lote:=Dr("Lote").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaApartado, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), Lote:=Dr("Lote").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen) Then
|
||||||
ErrorMovInv = True
|
|
||||||
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados")
|
|
||||||
Exit For
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
If Not ErrorMovInv Then
|
|
||||||
|
|
||||||
Dim CvePrePolizaTraspaso As Integer = ObjConta.AddPrePolizas("EA/Apart", 53, 0, 0, 1, TxtFecha.Text.ToDate, "Traspaso Apartado", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
|
||||||
If CvePrePolizaTraspaso > 0 Then
|
|
||||||
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, True, ValorTraspaso, TxtObservaciones.Text, 68, TxtObservaciones.Text, TxtFecha.Text.ToDate, -1, -1, CveMovimientoAlmacen:=CveMovimientoSalidaApartado, Contabilizable:=False, ImporteMX:=ValorTraspaso) Then
|
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
|
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados")
|
||||||
|
Exit For
|
||||||
End If
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
For Each Dr1 As DataRow In DtTraspasos.Rows
|
If Not ErrorMovInv Then
|
||||||
CveMovimientoSalida = Dr1("CveMovimientoSalida").ToString().ToEntero()
|
|
||||||
|
Dim CvePrePolizaTraspaso As Integer = ObjConta.AddPrePolizas("EA/Apart", 53, 0, 0, 1, TxtFecha.Text.ToDate, "Traspaso Apartado", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
|
If CvePrePolizaTraspaso > 0 Then
|
||||||
|
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, True, ValorTraspaso, TxtObservaciones.Text, 68, TxtObservaciones.Text, TxtFecha.Text.ToDate, -1, -1, CveMovimientoAlmacen:=CveMovimientoSalidaApartado, Contabilizable:=False, ImporteMX:=ValorTraspaso) Then
|
||||||
|
ErrorMovInv = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
For Each Dr1 As DataRow In DtTraspasos.Rows
|
||||||
|
CveMovimientoSalida = Dr1("CveMovimientoSalida").ToString().ToEntero()
|
||||||
|
|
||||||
CveMovimientoEntradaApartado = ObjInventario.AddMovimiento(Dr1("CveAlmacen").ToString().ToEntero(), 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
CveMovimientoEntradaApartado = ObjInventario.AddMovimiento(Dr1("CveAlmacen").ToString().ToEntero(), 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
||||||
-1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero(),
|
-1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero(),
|
||||||
If Not CveMovimientoEntradaApartado > 0 Then
|
CveMovimientoRelacionado:=CveMovimientoSalida, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor,
|
||||||
|
CveCliente:=CveCliente, Modulo:="RE/G10")
|
||||||
|
FolioEntrada = ObjInventario.Folio
|
||||||
|
|
||||||
|
If Not CveMovimientoEntradaApartado > 0 Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
TextoError.AppendFormat("Ocurrió un error al procesar los movimientos de traspaso de apartado. Por favor vuelva a intentar.")
|
TextoError.AppendFormat("Ocurrió un error al procesar los movimientos de traspaso de apartado. Por favor vuelva a intentar.")
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dr1("CveMovimientoEntrada") = CveMovimientoEntradaApartado
|
Dr1("CveMovimientoEntrada") = CveMovimientoEntradaApartado
|
||||||
Dr1("FolioEntrada") = FolioEntrada
|
Dr1("FolioEntrada") = FolioEntrada
|
||||||
|
|
||||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||||
ValorTraspaso = ObjInventario.DtResultados.SUMD("Total").RoundSQL
|
ValorTraspaso = ObjInventario.DtResultados.SUMD("Total").RoundSQL
|
||||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||||
|
|
||||||
CveSeccionAlmacen = -3
|
CveSeccionAlmacen = -3
|
||||||
|
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), Lote:=Dr("Lote").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), Lote:=Dr("Lote").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
|
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ErrorMovInv Then Exit For
|
If ErrorMovInv Then Exit For
|
||||||
|
|
||||||
If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, False, ValorTraspaso, TxtObservaciones.Text, 68, TxtObservaciones.Text, TxtFecha.Text.ToDate, -1, -1, CveMovimientoAlmacen:=CveMovimientoEntradaApartado, Contabilizable:=False, ImporteMX:=ValorTraspaso) Then
|
If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, False, ValorTraspaso, TxtObservaciones.Text, 68, TxtObservaciones.Text, TxtFecha.Text.ToDate, -1, -1, CveMovimientoAlmacen:=CveMovimientoEntradaApartado, Contabilizable:=False, ImporteMX:=ValorTraspaso) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
|
'QUEMAR REMISIONES
|
||||||
'QUEMAR REMISIONES
|
If Not ErrorMovInv And EsDevolucionVenta = 1 And TipoDocto = "Ing" Then
|
||||||
|
Dim DtDevRem As New DataTable
|
||||||
'CARGA REMISIONES DE LA VENTA DEVUELTA
|
|
||||||
|
'CARGA REMISIONES DE LA VENTA DEVUELTA
|
||||||
'CARGA REMISIONES DE LA VENTA DEVUELTA
|
If ObjInventario.GetDevolucionRemisionesFacturadas(CveVentaSurtir) Then
|
||||||
If ObjInventario.GetDevolucionRemisionesFacturadas(CveVentaSurtir) Then
|
DtDevRem = ObjInventario.DtResultados.FiltraParametros("CantidadAlmacen = 0")
|
||||||
DtDevRem = ObjInventario.DtResultados.FiltraParametros("CantidadAlmacen = 0")
|
Else
|
||||||
Else
|
ErrorMovInv = True
|
||||||
ErrorMovInv = True
|
End If
|
||||||
End If
|
|
||||||
|
If Not ErrorMovInv Then
|
||||||
If Not ErrorMovInv Then
|
|
||||||
If DtDevRem.Rows.Count > 0 Then
|
If DtDevRem.Rows.Count > 0 Then
|
||||||
For Each DrMovtos As DataRow In DtDevRem.FiltraParametros("", "CveRem", {"CveRem"}).Rows
|
For Each DrMovtos As DataRow In DtDevRem.FiltraParametros("", "CveRem", {"CveRem"}).Rows
|
||||||
If Not ObjInventario.ActualizarEsDevolucionVenta(DrMovtos("CveRem").ToString().ToEntero(), 2) Then
|
If Not ObjInventario.ActualizarEsDevolucionVenta(DrMovtos("CveRem").ToString().ToEntero(), 2) Then
|
||||||
@@ -3280,10 +3275,10 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
'sino es transitorio, los transitorios, ya no se hace otro movimiento
|
'sino es transitorio, los transitorios, ya no se hace otro movimiento
|
||||||
|
|
||||||
ConceptoMovimiento = If(ChkTransitorio.Checked, 2, 27)
|
ConceptoMovimiento = If(ChkTransitorio.Checked, 2, 27)
|
||||||
Almacen2 = If(ChkTransitorio.Checked, DdlAlmacenTransitorio.SelectedValue.ToEntero(), CveAlmacenTraspasoDestino)
|
Almacen2 = If(ChkTransitorio.Checked, DdlAlmacenTransitorio.SelectedValue.ToEntero(), CveAlmacenTraspasoDestino)
|
||||||
CveMovimientoEntrada = ObjInventario.AddMovimiento(Almacen2, ConceptoMovimiento, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim,
|
CveMovimientoEntrada = ObjInventario.AddMovimiento(Almacen2, ConceptoMovimiento, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim,
|
||||||
Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalida, CveAlmacenDestino:=CveAlmacenTraspasoDestino,
|
Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalida, CveAlmacenDestino:=CveAlmacenTraspasoDestino,
|
||||||
Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, ""), Modulo:="RE/GT1", CveOP:=CveOP)
|
Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, ""), Modulo:="RE/GT1", CveOP:=CveOP)
|
||||||
FolioEntrada = ObjInventario.Folio
|
FolioEntrada = ObjInventario.Folio
|
||||||
If CveMovimientoEntrada > 0 Then
|
If CveMovimientoEntrada > 0 Then
|
||||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||||
|
|||||||
@@ -605,14 +605,14 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
|||||||
Dim Drp As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteDesarmado).FiltroPrimero("")
|
Dim Drp As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteDesarmado).FiltroPrimero("")
|
||||||
|
|
||||||
Dim CveUMTemp As Integer = Drp("CveUM").ToString.ToEntero
|
Dim CveUMTemp As Integer = Drp("CveUM").ToString.ToEntero
|
||||||
Dim AplicaSeccion As Boolean = CBool(Drp("AplicaSeccion"))
|
'Dim AplicaSeccion As Boolean = CBool(Drp("AplicaSeccion"))
|
||||||
If AplicaSeccion Then
|
'If AplicaSeccion Then
|
||||||
CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenDesarmado, CvePaqueteDesarmado).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
|
' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenDesarmado, CvePaqueteDesarmado).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
|
||||||
End If
|
'End If
|
||||||
If AplicaSerie Then
|
If AplicaSerie Then
|
||||||
For Each Gvr As GridViewRow In GvSeriesPaqueteDesarmado.Rows
|
For Each Gvr As GridViewRow In GvSeriesPaqueteDesarmado.Rows
|
||||||
'AGREGA MOVTO DETALLE DE LA SALIDA DEL PAQUETE
|
'AGREGA MOVTO DETALLE DE LA SALIDA DEL PAQUETE
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, CveUMTemp, CvePSTemp, 0, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Gvr.DataKey("Serie").ToString) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, CveUMTemp, CvePSTemp, 0, CveSeccionAlmacen:=-3, Serie:=Gvr.DataKey("Serie").ToString) Then
|
||||||
TieneError = True
|
TieneError = True
|
||||||
MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de salida"
|
MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de salida"
|
||||||
Exit For
|
Exit For
|
||||||
|
|||||||
@@ -3009,10 +3009,8 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
Row("CveUM") = GvRow.DataKey("CveUM").ToEntero()
|
Row("CveUM") = GvRow.DataKey("CveUM").ToEntero()
|
||||||
DtPSVirtual.Rows.Add(Row)
|
DtPSVirtual.Rows.Add(Row)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
@@ -3065,36 +3063,32 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
|
|
||||||
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero()).FiltroPrimeroValor("CveAlmacenVirtual").ToEntero()
|
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero()).FiltroPrimeroValor("CveAlmacenVirtual").ToEntero()
|
||||||
|
|
||||||
|
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, 13, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, CveMovimientoRelacionado:=CveMovimientoRef, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/VD")
|
||||||
|
|
||||||
If CveMovimientoVirtual > 0 Then
|
If CveMovimientoVirtual > 0 Then
|
||||||
|
FolioVirtual = ObjInventario.Folio
|
||||||
|
|
||||||
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, 13, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, CveMovimientoRelacionado:=CveMovimientoRef, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/VD")
|
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
||||||
|
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||||
|
Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
|
||||||
|
Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal()
|
||||||
|
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
||||||
|
|
||||||
If CveMovimientoVirtual > 0 Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||||
FolioVirtual = ObjInventario.Folio
|
ErrorMovInv = True
|
||||||
|
Exit For
|
||||||
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
|
||||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
|
||||||
Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
|
|
||||||
Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal()
|
|
||||||
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
|
||||||
|
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
|
||||||
ErrorMovInv = True
|
|
||||||
Exit For
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
If SumarImporteUsados Then
|
|
||||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtual, UsuarioActual.CveEmpresa) Then
|
|
||||||
ImporteIngresoAdicional = ObjInventario.DtResultados.SUMD("TotalOriginal")
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
Else
|
If SumarImporteUsados Then
|
||||||
ErrorMovInv = True
|
If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtual, UsuarioActual.CveEmpresa) Then
|
||||||
|
ImporteIngresoAdicional = ObjInventario.DtResultados.SUMD("TotalOriginal")
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
|
Else
|
||||||
|
ErrorMovInv = True
|
||||||
|
End If
|
||||||
Else
|
Else
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -2761,7 +2761,7 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
CveClasificacion = drPS("CveClasificacion").ToString.ToEntero
|
CveClasificacion = drPS("CveClasificacion").ToString.ToEntero
|
||||||
|
|
||||||
Dim Arr = PS.Split("-"c)
|
Dim Arr = PS.Split("-"c)
|
||||||
If Arr.Count > 0 Then
|
If Arr.Count > 1 Then
|
||||||
If (DdlBCIAjuste.Items.FindByText(Arr(1).ToString) IsNot Nothing) Then
|
If (DdlBCIAjuste.Items.FindByText(Arr(1).ToString) IsNot Nothing) Then
|
||||||
DdlBCIAjuste.SelectedValueExist(DdlBCIAjuste.Items.FindByText(Arr(1).ToString).Value)
|
DdlBCIAjuste.SelectedValueExist(DdlBCIAjuste.Items.FindByText(Arr(1).ToString).Value)
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -37,10 +37,9 @@ Partial Class Inventario_ReconstruirCostos
|
|||||||
|
|
||||||
If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then
|
If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then
|
||||||
DdlMarca.DataSource = ObjPS.DtResultados
|
DdlMarca.DataSource = ObjPS.DtResultados
|
||||||
DdlMarca.DataBind()
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
ObjPS.Dispose()
|
ObjPS.Dispose()
|
||||||
|
DdlMarca.DataBind()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
|
|||||||
@@ -331,7 +331,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<label id="lblCompraRef" runat="server" class="col-md-2">Referencia:</label>
|
<label id="lblCompraRef" runat="server" class="col-md-2">Referencia:</label>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<asp:HyperLink runat="server" Target="_blank" ID="hplRef" CssClass="Texto">Ver Compra</asp:HyperLink>
|
<asp:HyperLink runat="server" Target="_blank" ID="hplRef" CssClass="Texto">VerCompra</asp:HyperLink>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -454,7 +454,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<div style="max-height: 300px; overflow-y: auto;">
|
<div style="max-height: 300px; overflow-y: auto;">
|
||||||
<asp:GridView ID="GvDatos" DataKeyNames="No,PS,CvePS,CveUM,Serie,Cantidad" runat="server" ShowHeader="false" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
|
<asp:GridView ID="GvDatos" DataKeyNames="No,PS,CvePS,CveUM,Serie,CveSeccionAlmacen,Cantidad" runat="server" ShowHeader="false" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:BoundField HeaderText="#" DataField="No" ItemStyle-Width="23px" />
|
<asp:BoundField HeaderText="#" DataField="No" ItemStyle-Width="23px" />
|
||||||
<asp:TemplateField ItemStyle-Width="93px" ItemStyle-HorizontalAlign ="Right">
|
<asp:TemplateField ItemStyle-Width="93px" ItemStyle-HorizontalAlign ="Right">
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
'End If
|
'End If
|
||||||
|
|
||||||
If Mov.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
If Mov.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||||
DtMovimientos = Mov.DtResultados.DefaultView.ToTable("Cantidad, CveUM, CvePS, CveAF, PS, Serie, CveClasificacion, EstatusExistencia")
|
DtMovimientos = Mov.DtResultados.DefaultView.ToTable("Cantidad, CveUM, CvePS, CveAF, PS, Serie, CveSeccionAlmacen, CveClasificacion, EstatusExistencia")
|
||||||
CargaGvDatos()
|
CargaGvDatos()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
@@ -88,10 +88,8 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="text-right"><b>Proveedor:</b></td>
|
<td class="text-right"><b>Proveedor:</b></td>
|
||||||
<td>
|
<td>
|
||||||
<asp:DropDownList ID="DdlProveedor" AutoPostBack="false" runat="server" CssClass="form-control input-sm select2me" DataTextField="RazonSocial" DataValueField="CveProveedor" Style="width: 200px !important;"></asp:DropDownList></td>
|
<ADS:Dropdownlost runat="server" ID="DdlProveedor" CssStyle="width: 100%;" CssClassDdl="select2me " DataTextField="NombreCortoProveedor" DataValueField="CveProveedor" />
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="4" class="text-center">
|
<td colspan="4" class="text-center">
|
||||||
|
|||||||
@@ -84,10 +84,14 @@ Partial Class OC_PopUpBuscarReq
|
|||||||
' DdlProyectos.Items.Insert(0, New ListItem("Todos", "-1"))
|
' DdlProyectos.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||||
'End If
|
'End If
|
||||||
|
|
||||||
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
'DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
||||||
DdlProveedor.DataBind()
|
'DdlProveedor.DataBind()
|
||||||
|
|
||||||
DdlProveedor.Items.Insert(0, New ListItem("Todos", "-1"))
|
'DdlProveedor.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||||
|
DdlProveedor.setEsWebService(True)
|
||||||
|
DdlProveedor.Attributes.Add("data-metodo", "getproveedores")
|
||||||
|
DdlProveedor.SelectedText = "Todos"
|
||||||
|
DdlProveedor.SelectedValue = "-1"
|
||||||
|
|
||||||
'DdlSubProyectos.DataSource = DtEstatusUsuarios.FiltraParametros("", "", {"CveSubProyecto", "SubProyecto"}) 'GlobalDTSubProyectos(DdlProyectos.SelectedValue.ToEntero).FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
|
'DdlSubProyectos.DataSource = DtEstatusUsuarios.FiltraParametros("", "", {"CveSubProyecto", "SubProyecto"}) 'GlobalDTSubProyectos(DdlProyectos.SelectedValue.ToEntero).FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
|
||||||
DdlSubProyectos.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110),
|
DdlSubProyectos.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110),
|
||||||
@@ -174,8 +178,10 @@ Partial Class OC_PopUpBuscarReq
|
|||||||
'Cargar Datos
|
'Cargar Datos
|
||||||
|
|
||||||
If ValidarFiltrosSeleccionado() Then
|
If ValidarFiltrosSeleccionado() Then
|
||||||
|
Dim CveProveedor As Integer = If(DdlProveedor.SelectedValue.ToEntero > 0, DdlProveedor.SelectedValue.ToEntero, -1)
|
||||||
|
|
||||||
Dim ObjOC As New ClsOC
|
Dim ObjOC As New ClsOC
|
||||||
ObjOC.GetOrdenesCompraRep(DdlTipo.SelectedValue, CveProyecto, CveSubProyecto, -1, DdlEstatus.SelectedValue.ToEntero, FI, MaxFecha, -1, DdlProveedor.SelectedValue.ToEntero,
|
ObjOC.GetOrdenesCompraRep(DdlTipo.SelectedValue, CveProyecto, CveSubProyecto, -1, DdlEstatus.SelectedValue.ToEntero, FI, MaxFecha, -1, CveProveedor,
|
||||||
If(TxtFolio.Text.ToEntero <= 0, -1, TxtFolio.Text.ToEntero), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Guia:=guia,
|
If(TxtFolio.Text.ToEntero <= 0, -1, TxtFolio.Text.ToEntero), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Guia:=guia,
|
||||||
SoloSubProyectosConPermiso:=If(UsuarioActual.Empresa.Funcionalidad(530) = "1", True, False), TopSelect:=100)
|
SoloSubProyectosConPermiso:=If(UsuarioActual.Empresa.Funcionalidad(530) = "1", True, False), TopSelect:=100)
|
||||||
Dim DtOC = ObjOC.DtResultados ' tipotermino, esattus inicial
|
Dim DtOC = ObjOC.DtResultados ' tipotermino, esattus inicial
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ Partial Class CatClasificaciones
|
|||||||
'End If
|
'End If
|
||||||
'Cuenta.Dispose()
|
'Cuenta.Dispose()
|
||||||
Else
|
Else
|
||||||
If UsuarioActual.Empresa.TipoContabilizacion = 2 Then
|
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
|
||||||
DivCuentaIngresos.Visible = False
|
DivCuentaIngresos.Visible = False
|
||||||
DivCuentaCostos.Visible = False
|
DivCuentaCostos.Visible = False
|
||||||
DivCuentaGasto.Visible = False
|
DivCuentaGasto.Visible = False
|
||||||
@@ -224,17 +224,26 @@ Partial Class CatClasificaciones
|
|||||||
|
|
||||||
|
|
||||||
Private Sub CargaCuentasContables(Optional IdCuentaPadre As Integer = -1)
|
Private Sub CargaCuentasContables(Optional IdCuentaPadre As Integer = -1)
|
||||||
Dim ObjEmpresa As New ClsSisEmpresas
|
|
||||||
Dim Empresa As Empresa = Nothing
|
If UsuarioActual.Empresa.TipoContabilizacion = 1 Then
|
||||||
If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
|
|
||||||
Empresa = ObjEmpresa.Empresa
|
Dim ObjEmpresa As New ClsSisEmpresas
|
||||||
Dim ObjContabilidad As New ClsContPAQi(Empresa)
|
Dim Empresa As Empresa = Nothing
|
||||||
If ObjContabilidad.GetCuentas(-1, "-1", 1, 20000) Then
|
If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||||
DtCuentasContables = ObjContabilidad.DtResultados
|
Empresa = ObjEmpresa.Empresa
|
||||||
|
Dim ObjContabilidad As New ClsContPAQi(Empresa)
|
||||||
|
If ObjContabilidad.GetCuentas(-1, "-1", 1, 20000) Then
|
||||||
|
DtCuentasContables = ObjContabilidad.DtResultados
|
||||||
|
End If
|
||||||
|
ObjContabilidad.Dispose()
|
||||||
End If
|
End If
|
||||||
ObjContabilidad.Dispose()
|
ObjEmpresa.Dispose()
|
||||||
|
ElseIf UsuarioActual.Empresa.TipoContabilizacion = 2 Then
|
||||||
|
DdlCuentaGasto.DataValueField = "CveCuenta"
|
||||||
|
DdlCuentaGasto.DataTextField = "Cuenta"
|
||||||
End If
|
End If
|
||||||
ObjEmpresa.Dispose()
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub BtnCargarCuentas_Click(sender As Object, e As EventArgs) Handles BtnCargarCuentas.Click
|
Protected Sub BtnCargarCuentas_Click(sender As Object, e As EventArgs) Handles BtnCargarCuentas.Click
|
||||||
|
|||||||
@@ -68,7 +68,7 @@
|
|||||||
<asp:LinkButton ID="ImgExcel" runat="server"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
|
<asp:LinkButton ID="ImgExcel" runat="server"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<asp:LinkButton ID="LnkRepDiario" runat="server" Visible="false" OnClick="LnkRepDiario_Click"> <i class="fa fa-file-o" style="font-weight:bold;"></i> Reporte Diario</asp:LinkButton>
|
<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivReporteDiario" ID="HLReporteDiario" runat="server"> <i class="fa fa-file-o"></i> Reporte Diario</asp:HyperLink>
|
||||||
</li>
|
</li>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||||
@@ -222,6 +222,53 @@
|
|||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
<asp:UpdatePanel runat="server" ID="UPPersonalizar" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div id="DivReporteDiario" class="modal fade" role="dialog">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<!-- Modal content-->
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<h4 class="modal-title">
|
||||||
|
<asp:Label ID="Label1" runat="server" ClientIDMode="Static" Text="Descargar Reporte Diario"></asp:Label></h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<table class="table table-striped table-advance table-hover Widthall">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align: left;">Fecha Consulta
|
||||||
|
</td>
|
||||||
|
<td style="text-align: left;">
|
||||||
|
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||||
|
<asp:TextBox Width="80px" ID="TxtFechaConsulta" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||||
|
<span class="input-group-btn ">
|
||||||
|
<asp:LinkButton ID="LnkFechaConsulta" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<ajax:MaskedEditExtender ID="MEEFechaConsulta" runat="server" TargetControlID="TxtFechaConsulta" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||||
|
<ajax:CalendarExtender runat="server" ID="CEFechaConsulta" TargetControlID="TxtFechaConsulta" PopupButtonID="LnkFechaConsulta" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVFechaConsulta" runat="server" ControlToValidate="TxtFechaConsulta" Display="None" ErrorMessage="El campo <b>''Fecha Consulta''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||||
|
<asp:CompareValidator ID="CVFechaConsulta" runat="server" ControlToValidate="TxtFechaConsulta" Display="None" ErrorMessage="El campo <b>''Fecha Consulta''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaConsulta" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaConsulta" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<asp:Button ID="BtnDescargar" runat="server" Text="Descargar" class="btn btn-success" />
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
<Triggers>
|
||||||
|
<asp:PostBackTrigger ControlID="BtnDescargar" />
|
||||||
|
</Triggers>
|
||||||
|
</asp:UpdatePanel>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ Partial Class Ventas_RepPS
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.TienePermisoProceso(320) OrElse UsuarioActual.CveRol = 1 Then
|
If UsuarioActual.TienePermisoProceso(320) OrElse UsuarioActual.CveRol = 1 Then
|
||||||
LnkRepDiario.Visible = True
|
HLReporteDiario.Visible = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
@@ -49,6 +49,8 @@ Partial Class Ventas_RepPS
|
|||||||
Private Sub CargaDatosIniciales()
|
Private Sub CargaDatosIniciales()
|
||||||
txtFechaI.Text = $"01/{Now.Month}/{Now.Year}"
|
txtFechaI.Text = $"01/{Now.Month}/{Now.Year}"
|
||||||
txtFechaF.Text = Now.ToString("dd/MM/yyyy")
|
txtFechaF.Text = Now.ToString("dd/MM/yyyy")
|
||||||
|
|
||||||
|
TxtFechaConsulta.Text = Now.ToString("dd/MM/yyyy")
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CargaCombos()
|
Private Sub CargaCombos()
|
||||||
@@ -237,12 +239,12 @@ Partial Class Ventas_RepPS
|
|||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Protected Sub LnkRepDiario_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click
|
||||||
Dim CveMoneda As Integer = -1
|
Dim CveMoneda As Integer = -1
|
||||||
Dim TC As Integer = 1
|
Dim TC As Integer = 1
|
||||||
Dim TCEspecifico As Decimal = -1
|
Dim TCEspecifico As Decimal = -1
|
||||||
|
|
||||||
Dim FechaConsulta As DateTime = Now
|
Dim FechaConsulta As DateTime = TxtFechaConsulta.Text.ToDateTime()
|
||||||
|
|
||||||
Dim DataSet As DataSet = New DataSet
|
Dim DataSet As DataSet = New DataSet
|
||||||
Dim ObjVentas As New ClsVentas()
|
Dim ObjVentas As New ClsVentas()
|
||||||
@@ -276,6 +278,8 @@ Partial Class Ventas_RepPS
|
|||||||
CellRangeTitulo.Style.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
CellRangeTitulo.Style.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
||||||
|
|
||||||
#Region "V E N T A S - L L A N T A S, R I N E S, A L I N E A C I O N E S"
|
#Region "V E N T A S - L L A N T A S, R I N E S, A L I N E A C I O N E S"
|
||||||
|
Dim CeldaTotalVentaAcumulada As ExcelCell = Nothing
|
||||||
|
|
||||||
worksheet.Cells(2, 0).Value = "Sucursal"
|
worksheet.Cells(2, 0).Value = "Sucursal"
|
||||||
'TITULO DE LLANTAS
|
'TITULO DE LLANTAS
|
||||||
worksheet.Cells.GetSubrangeAbsolute(1, 1, 1, 3).Merged = True
|
worksheet.Cells.GetSubrangeAbsolute(1, 1, 1, 3).Merged = True
|
||||||
@@ -322,7 +326,9 @@ Partial Class Ventas_RepPS
|
|||||||
|
|
||||||
'INICIA DESDE LA CUARTA FILA
|
'INICIA DESDE LA CUARTA FILA
|
||||||
Dim IdxSucursalesLlantasAlin As Integer = 3
|
Dim IdxSucursalesLlantasAlin As Integer = 3
|
||||||
|
Dim idxTabla As Integer = 0
|
||||||
For Each Row As DataRow In DtSucursalesLLantasAlin.Rows
|
For Each Row As DataRow In DtSucursalesLLantasAlin.Rows
|
||||||
|
idxTabla += 1
|
||||||
worksheet.Cells(IdxSucursalesLlantasAlin, 0).Value = Row("SubProyecto")
|
worksheet.Cells(IdxSucursalesLlantasAlin, 0).Value = Row("SubProyecto")
|
||||||
|
|
||||||
worksheet.Cells(IdxSucursalesLlantasAlin, 1).Value = Row("LlantasCantidadAnterior")
|
worksheet.Cells(IdxSucursalesLlantasAlin, 1).Value = Row("LlantasCantidadAnterior")
|
||||||
@@ -345,6 +351,10 @@ Partial Class Ventas_RepPS
|
|||||||
'worksheet.Cells(IdxSucursalesLlantasAlin, 12).Value = Row("VentaAcumulada")
|
'worksheet.Cells(IdxSucursalesLlantasAlin, 12).Value = Row("VentaAcumulada")
|
||||||
worksheet.Cells(IdxSucursalesLlantasAlin, 12).Formula = $"=SUM({worksheet.Cells(IdxSucursalesLlantasAlin, 10).Name}:{worksheet.Cells(IdxSucursalesLlantasAlin, 11).Name})"
|
worksheet.Cells(IdxSucursalesLlantasAlin, 12).Formula = $"=SUM({worksheet.Cells(IdxSucursalesLlantasAlin, 10).Name}:{worksheet.Cells(IdxSucursalesLlantasAlin, 11).Name})"
|
||||||
|
|
||||||
|
If idxTabla = DtSucursalesLLantasAlin.Rows.Count Then
|
||||||
|
CeldaTotalVentaAcumulada = worksheet.Cells(IdxSucursalesLlantasAlin, 12)
|
||||||
|
End If
|
||||||
|
|
||||||
Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxSucursalesLlantasAlin, 0, IdxSucursalesLlantasAlin, 12).Style
|
Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxSucursalesLlantasAlin, 0, IdxSucursalesLlantasAlin, 12).Style
|
||||||
StyleData.Font.Weight = ExcelFont.BoldWeight
|
StyleData.Font.Weight = ExcelFont.BoldWeight
|
||||||
StyleData.Font.Name = "Calibri"
|
StyleData.Font.Name = "Calibri"
|
||||||
@@ -368,11 +378,336 @@ Partial Class Ventas_RepPS
|
|||||||
'LA FILA DE LOS TOTALES DEBE ESTAR EN NEGITAS
|
'LA FILA DE LOS TOTALES DEBE ESTAR EN NEGITAS
|
||||||
worksheet.Cells.GetSubrangeAbsolute(IdxSucursalesLlantasAlin - 1, 0, IdxSucursalesLlantasAlin - 1, 12).Style.Font.Weight = ExcelFont.BoldWeight
|
worksheet.Cells.GetSubrangeAbsolute(IdxSucursalesLlantasAlin - 1, 0, IdxSucursalesLlantasAlin - 1, 12).Style.Font.Weight = ExcelFont.BoldWeight
|
||||||
|
|
||||||
|
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
#Region "L L A N T A S M E S A Ñ O A N T E R I O R R E S U M E N"
|
||||||
|
Dim IdxRefMesAnioAnteriorLlantasResumen As Integer = IdxSucursalesLlantasAlin + 1
|
||||||
|
|
||||||
|
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 0).Value = "Mes"
|
||||||
|
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 1).Value = String.Format("{0}", (FechaConsulta.Year - 1))
|
||||||
|
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 2).Value = String.Format("{0}", (FechaConsulta.Year))
|
||||||
|
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 3).Value = "DIF UDS"
|
||||||
|
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 4).Value = "DIF %"
|
||||||
|
|
||||||
|
Dim StyleTitleTable6 = worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantasResumen, 0, IdxRefMesAnioAnteriorLlantasResumen, 4).Style
|
||||||
|
StyleTitleTable6.Font.Weight = ExcelFont.BoldWeight
|
||||||
|
StyleTitleTable6.Font.Name = "Calibri"
|
||||||
|
StyleTitleTable6.Font.Size = 8 * 20
|
||||||
|
StyleTitleTable6.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
||||||
|
StyleTitleTable6.VerticalAlignment = VerticalAlignmentStyle.Center
|
||||||
|
StyleTitleTable6.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
||||||
|
|
||||||
|
|
||||||
|
Dim DtMesAnioAnteriorLLantasResumen As DataTable = DataSet.Tables(5)
|
||||||
|
'INICIA DESDE LA CUARTA FILA
|
||||||
|
Dim IdxMesAnioAnteriorLlantasResumen As Integer = IdxRefMesAnioAnteriorLlantasResumen + 1
|
||||||
|
|
||||||
|
For Each Row As DataRow In DtMesAnioAnteriorLLantasResumen.Rows
|
||||||
|
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 0).Value = ToMonthName(FechaConsulta).ToUpper() + " - LLANTAS"
|
||||||
|
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Value = Row("LLantasAnioAnterior")
|
||||||
|
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Value = Row("LLantas")
|
||||||
|
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 3).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Name} - {worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Name})"
|
||||||
|
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 4).Formula = $"=+({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Name} / {worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Name})"
|
||||||
|
|
||||||
|
Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantasResumen, 0, IdxMesAnioAnteriorLlantasResumen, 4).Style
|
||||||
|
StyleData.Font.Weight = ExcelFont.NormalWeight
|
||||||
|
StyleData.Font.Name = "Calibri"
|
||||||
|
StyleData.Font.Size = 8 * 20
|
||||||
|
StyleData.VerticalAlignment = VerticalAlignmentStyle.Center
|
||||||
|
StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
||||||
|
StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
||||||
|
StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
|
||||||
|
|
||||||
|
IdxMesAnioAnteriorLlantasResumen += 1
|
||||||
|
Next
|
||||||
|
|
||||||
|
IdxMesAnioAnteriorLlantasResumen += 1
|
||||||
|
|
||||||
|
'RESUMEN DE METAS
|
||||||
|
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 0).Value = "Mes"
|
||||||
|
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Value = "Meta"
|
||||||
|
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Value = String.Format("{0}", (FechaConsulta.Year - 1))
|
||||||
|
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 3).Value = "DIF UDS"
|
||||||
|
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 4).Value = "DIF %"
|
||||||
|
|
||||||
|
Dim StyleTitleTableMeta = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantasResumen, 0, IdxMesAnioAnteriorLlantasResumen, 4).Style
|
||||||
|
StyleTitleTableMeta.Font.Weight = ExcelFont.BoldWeight
|
||||||
|
StyleTitleTableMeta.Font.Name = "Calibri"
|
||||||
|
StyleTitleTableMeta.Font.Size = 8 * 20
|
||||||
|
StyleTitleTableMeta.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
||||||
|
StyleTitleTableMeta.VerticalAlignment = VerticalAlignmentStyle.Center
|
||||||
|
StyleTitleTableMeta.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
||||||
|
|
||||||
|
IdxMesAnioAnteriorLlantasResumen += 1
|
||||||
|
|
||||||
|
For Each Row As DataRow In DtMesAnioAnteriorLLantasResumen.Rows
|
||||||
|
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 0).Value = ToMonthName(FechaConsulta).ToUpper() + " - LLANTAS"
|
||||||
|
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Value = 0
|
||||||
|
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Value = Row("LLantasAnioAnterior")
|
||||||
|
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 3).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Name} - {worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Name})"
|
||||||
|
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 4).Formula = $"=+({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Name} / {worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Name})"
|
||||||
|
|
||||||
|
Dim StyleDataMeta = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantasResumen, 0, IdxMesAnioAnteriorLlantasResumen, 4).Style
|
||||||
|
StyleDataMeta.Font.Weight = ExcelFont.NormalWeight
|
||||||
|
StyleDataMeta.Font.Name = "Calibri"
|
||||||
|
StyleDataMeta.Font.Size = 8 * 20
|
||||||
|
StyleDataMeta.VerticalAlignment = VerticalAlignmentStyle.Center
|
||||||
|
StyleDataMeta.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
||||||
|
StyleDataMeta.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
||||||
|
StyleDataMeta.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
|
||||||
|
|
||||||
|
IdxMesAnioAnteriorLlantasResumen += 1
|
||||||
|
Next
|
||||||
|
|
||||||
|
DtMesAnioAnteriorLLantasResumen.Dispose()
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
#Region "F R A N Q U I C I A S R E S U M E N"
|
||||||
|
|
||||||
|
Dim TotalFranquicias As Decimal = DtSucursalesLLantasAlin.FiltroPrimeroValor("LlantasCantidadAcumulada", "CveSubProyecto=11842").ToDecimal()
|
||||||
|
|
||||||
DtSucursalesLLantasAlin.Dispose()
|
DtSucursalesLLantasAlin.Dispose()
|
||||||
|
|
||||||
|
Dim IdxRefFranquiciasResumen As Integer = IdxRefMesAnioAnteriorLlantasResumen
|
||||||
|
|
||||||
|
Dim columnRefFranquiciasResumen As Integer = 6
|
||||||
|
|
||||||
|
'PRM 19
|
||||||
|
worksheet.Cells(IdxRefFranquiciasResumen, columnRefFranquiciasResumen).Value = $"PRM {Now.Year - 1}"
|
||||||
|
worksheet.Cells(IdxRefFranquiciasResumen, columnRefFranquiciasResumen + 1).Value = "ALM PS"
|
||||||
|
worksheet.Cells(IdxRefFranquiciasResumen, columnRefFranquiciasResumen + 2).Value = ""
|
||||||
|
worksheet.Cells(IdxRefFranquiciasResumen, columnRefFranquiciasResumen + 3).Value = TotalFranquicias
|
||||||
|
|
||||||
|
'TOMA EL VALOR DE DIF LLANTAS
|
||||||
|
worksheet.Cells(IdxRefFranquiciasResumen + 1, columnRefFranquiciasResumen).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen - 4, 3).Name})"
|
||||||
|
|
||||||
|
worksheet.Cells(IdxRefFranquiciasResumen + 2, columnRefFranquiciasResumen + 1).Value = $"FRANQ {Now.Year}"
|
||||||
|
worksheet.Cells(IdxRefFranquiciasResumen + 2, columnRefFranquiciasResumen + 2).Value = 4988
|
||||||
|
|
||||||
|
worksheet.Cells(IdxRefFranquiciasResumen + 3, columnRefFranquiciasResumen).Value = $"PRM {Now.Year}"
|
||||||
|
worksheet.Cells(IdxRefFranquiciasResumen + 3, columnRefFranquiciasResumen + 1).Value = ""
|
||||||
|
worksheet.Cells(IdxRefFranquiciasResumen + 3, columnRefFranquiciasResumen + 2).Formula = $"=({worksheet.Cells(IdxRefFranquiciasResumen, columnRefFranquiciasResumen + 3).Name} - {worksheet.Cells(IdxRefFranquiciasResumen + 2, columnRefFranquiciasResumen + 2).Name})"
|
||||||
|
worksheet.Cells(IdxRefFranquiciasResumen + 3, columnRefFranquiciasResumen + 3).Formula = $"+({worksheet.Cells(IdxRefFranquiciasResumen + 3, columnRefFranquiciasResumen + 2)})"
|
||||||
|
|
||||||
|
'TOMA EL VALOR DE DIF LLANTAS METAS
|
||||||
|
worksheet.Cells(IdxRefFranquiciasResumen + 4, columnRefFranquiciasResumen).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen - 1, 3).Name})"
|
||||||
|
|
||||||
|
|
||||||
|
Dim StyleTitleTableFR = worksheet.Cells.GetSubrangeAbsolute(IdxRefFranquiciasResumen, columnRefFranquiciasResumen, IdxRefFranquiciasResumen + 4, columnRefFranquiciasResumen + 3).Style
|
||||||
|
StyleTitleTableFR.Font.Weight = ExcelFont.BoldWeight
|
||||||
|
StyleTitleTableFR.Font.Name = "Calibri"
|
||||||
|
StyleTitleTableFR.Font.Size = 8 * 20
|
||||||
|
StyleTitleTableFR.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
||||||
|
StyleTitleTableFR.VerticalAlignment = VerticalAlignmentStyle.Center
|
||||||
|
StyleTitleTableFR.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
||||||
|
|
||||||
|
'Dim StyleDataFranquicias = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantasResumen, 0, IdxMesAnioAnteriorLlantasResumen, 4).Style
|
||||||
|
'StyleData.Font.Weight = ExcelFont.NormalWeight
|
||||||
|
'StyleData.Font.Name = "Calibri"
|
||||||
|
'StyleData.Font.Size = 8 * 20
|
||||||
|
'StyleData.VerticalAlignment = VerticalAlignmentStyle.Center
|
||||||
|
'StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
||||||
|
'StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
||||||
|
'StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
|
||||||
|
|
||||||
|
IdxRefFranquiciasResumen += 1
|
||||||
|
|
||||||
|
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
#Region "A Ñ O R E S U M E N"
|
||||||
|
Dim IdxRefAnioResumen As Integer = IdxRefFranquiciasResumen - 1
|
||||||
|
|
||||||
|
Dim columnRefAnioResumen As Integer = columnRefFranquiciasResumen + 5
|
||||||
|
|
||||||
|
'AÑO ANTERIOR
|
||||||
|
worksheet.Cells(IdxRefAnioResumen, columnRefAnioResumen).Value = Now.Year - 1
|
||||||
|
Dim CellAnioAnterior = worksheet.Cells(IdxRefAnioResumen, columnRefAnioResumen + 1)
|
||||||
|
CellAnioAnterior.Value = 0
|
||||||
|
|
||||||
|
'AÑO ACTUAL
|
||||||
|
worksheet.Cells(IdxRefAnioResumen + 1, columnRefAnioResumen).Value = Now.Year
|
||||||
|
Dim CellAnioActual = worksheet.Cells(IdxRefAnioResumen + 1, columnRefAnioResumen + 1)
|
||||||
|
CellAnioActual.Value = 0
|
||||||
|
|
||||||
|
worksheet.Cells(IdxRefAnioResumen + 2, columnRefAnioResumen + 1).Formula = $"=({CeldaTotalVentaAcumulada.Name} - {worksheet.Cells(IdxRefAnioResumen, columnRefAnioResumen + 1).Name})"
|
||||||
|
|
||||||
|
worksheet.Cells(IdxRefAnioResumen + 3, columnRefAnioResumen).Value = $"X DIA {Now.Year - 1}"
|
||||||
|
worksheet.Cells(IdxRefAnioResumen + 4, columnRefAnioResumen).Value = $"X DIA {Now.Year}"
|
||||||
|
|
||||||
|
Dim DiasFinMes As Integer = 0
|
||||||
|
|
||||||
|
Dim Day As Integer = Now.Day
|
||||||
|
Dim DaysMonth As Integer = DateTime.DaysInMonth(Now.Year, Now.Month)
|
||||||
|
Dim Month As Integer = Now.Month
|
||||||
|
Dim Year As Integer = Now.Year
|
||||||
|
|
||||||
|
For i = Day To DaysMonth
|
||||||
|
Dim DayRef As DateTime = New DateTime(Year, Month, i)
|
||||||
|
If DayRef.DayOfWeek <> DayOfWeek.Sunday Then
|
||||||
|
DiasFinMes += 1
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
worksheet.Cells(IdxRefAnioResumen + 3, columnRefAnioResumen + 1).Formula = $"=({CellAnioAnterior.Name} - {CeldaTotalVentaAcumulada.Name})/{If(DiasFinMes > 0, DiasFinMes, 1)}"
|
||||||
|
worksheet.Cells(IdxRefAnioResumen + 3, columnRefAnioResumen + 2).Formula = $"=({CeldaTotalVentaAcumulada.Name}/{CellAnioAnterior.Name})"
|
||||||
|
|
||||||
|
worksheet.Cells(IdxRefAnioResumen + 4, columnRefAnioResumen + 1).Formula = $"=({CellAnioActual.Name} - {CeldaTotalVentaAcumulada.Name})/{If(DiasFinMes > 0, DiasFinMes, 1)}"
|
||||||
|
worksheet.Cells(IdxRefAnioResumen + 4, columnRefAnioResumen + 2).Formula = $"=({CeldaTotalVentaAcumulada.Name}/{CellAnioActual.Name})"
|
||||||
|
|
||||||
|
Dim StyleTitleTableAR = worksheet.Cells.GetSubrangeAbsolute(IdxRefAnioResumen, columnRefAnioResumen, IdxRefAnioResumen + 4, columnRefAnioResumen + 2).Style
|
||||||
|
StyleTitleTableAR.Font.Weight = ExcelFont.BoldWeight
|
||||||
|
StyleTitleTableAR.Font.Name = "Calibri"
|
||||||
|
StyleTitleTableAR.Font.Size = 8 * 20
|
||||||
|
StyleTitleTableAR.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
||||||
|
StyleTitleTableAR.VerticalAlignment = VerticalAlignmentStyle.Center
|
||||||
|
StyleTitleTableAR.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
||||||
|
|
||||||
|
Dim StyleDataAR = worksheet.Cells.GetSubrangeAbsolute(IdxRefAnioResumen, columnRefAnioResumen + 1, IdxRefAnioResumen + 4, columnRefAnioResumen + 2).Style
|
||||||
|
StyleDataAR.Font.Weight = ExcelFont.NormalWeight
|
||||||
|
StyleDataAR.Font.Name = "Calibri"
|
||||||
|
StyleDataAR.Font.Size = 8 * 20
|
||||||
|
StyleDataAR.VerticalAlignment = VerticalAlignmentStyle.Center
|
||||||
|
StyleDataAR.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
||||||
|
StyleDataAR.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
||||||
|
StyleDataAR.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
|
||||||
|
|
||||||
|
IdxRefAnioResumen += 1
|
||||||
|
|
||||||
|
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
#Region "L L A N T A S M E S A Ñ O A N T E R I O R"
|
||||||
|
Dim IdxRefMesAnioAnteriorLlantas As Integer = IdxSucursalesLlantasAlin + 8
|
||||||
|
|
||||||
|
worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas - 1, 1, IdxRefMesAnioAnteriorLlantas - 1, 3).Merged = True
|
||||||
|
worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas - 1, 4, IdxRefMesAnioAnteriorLlantas - 1, 6).Merged = True
|
||||||
|
worksheet.Cells(IdxRefMesAnioAnteriorLlantas - 1, 1).Value = "LLANTAS"
|
||||||
|
worksheet.Cells(IdxRefMesAnioAnteriorLlantas - 1, 4).Value = "%"
|
||||||
|
|
||||||
|
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 0).Value = "Sucursal"
|
||||||
|
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 1).Value = String.Format("{0} {1}", ToShortMonthName(FechaConsulta).ToUpper(), (FechaConsulta.Year - 1))
|
||||||
|
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 2).Value = String.Format("{0} {1}", ToShortMonthName(FechaConsulta).ToUpper(), (FechaConsulta.Year))
|
||||||
|
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 3).Value = "DIF %"
|
||||||
|
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 4).Value = String.Format("{0} - %", (FechaConsulta.Year - 1))
|
||||||
|
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 5).Value = String.Format("{0} - %", (FechaConsulta.Year))
|
||||||
|
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 6).Value = "DIF %"
|
||||||
|
|
||||||
|
Dim StyleTitleTable5 = worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas - 1, 0, IdxRefMesAnioAnteriorLlantas - 1, 6).Style
|
||||||
|
StyleTitleTable5.Font.Weight = ExcelFont.BoldWeight
|
||||||
|
StyleTitleTable5.Font.Name = "Calibri"
|
||||||
|
StyleTitleTable5.Font.Size = 8 * 20
|
||||||
|
StyleTitleTable5.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
||||||
|
StyleTitleTable5.VerticalAlignment = VerticalAlignmentStyle.Center
|
||||||
|
StyleTitleTable5.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
||||||
|
|
||||||
|
Dim StyleSubTitleTable5 = worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas, 0, IdxRefMesAnioAnteriorLlantas, 6).Style
|
||||||
|
StyleSubTitleTable5.Font.Weight = ExcelFont.BoldWeight
|
||||||
|
StyleSubTitleTable5.Font.Name = "Calibri"
|
||||||
|
StyleSubTitleTable5.Font.Size = 8 * 20
|
||||||
|
StyleSubTitleTable5.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
||||||
|
StyleSubTitleTable5.VerticalAlignment = VerticalAlignmentStyle.Center
|
||||||
|
StyleSubTitleTable5.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
||||||
|
|
||||||
|
Dim DtMesAnioAnteriorLLantas As DataTable = DataSet.Tables(4)
|
||||||
|
'INICIA DESDE LA CUARTA FILA
|
||||||
|
Dim IdxMesAnioAnteriorLlantas As Integer = IdxRefMesAnioAnteriorLlantas + 1
|
||||||
|
|
||||||
|
For Each Row As DataRow In DtMesAnioAnteriorLLantas.Rows
|
||||||
|
worksheet.Cells(IdxMesAnioAnteriorLlantas, 0).Value = Row("Sucursal")
|
||||||
|
worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Value = Row("LLantasAnioAnterior")
|
||||||
|
worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Value = Row("LLantas")
|
||||||
|
worksheet.Cells(IdxMesAnioAnteriorLlantas, 3).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name} - {worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name})"
|
||||||
|
worksheet.Cells(IdxMesAnioAnteriorLlantas, 4).Formula = $"=+(({worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name} * 1.07) - {worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name}) /12"
|
||||||
|
worksheet.Cells(IdxMesAnioAnteriorLlantas, 5).Formula = $"=+(({worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name} * 1) - {worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name}) /12"
|
||||||
|
worksheet.Cells(IdxMesAnioAnteriorLlantas, 6).Formula = $"=+({worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name} / {worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name}) - 1"
|
||||||
|
|
||||||
|
Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantas, 0, IdxMesAnioAnteriorLlantas, 6).Style
|
||||||
|
StyleData.Font.Weight = ExcelFont.NormalWeight
|
||||||
|
StyleData.Font.Name = "Calibri"
|
||||||
|
StyleData.Font.Size = 8 * 20
|
||||||
|
StyleData.VerticalAlignment = VerticalAlignmentStyle.Center
|
||||||
|
StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
||||||
|
StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
||||||
|
StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
|
||||||
|
|
||||||
|
IdxMesAnioAnteriorLlantas += 1
|
||||||
|
Next
|
||||||
|
|
||||||
|
DtMesAnioAnteriorLLantas.Dispose()
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
#Region "A Ñ O A N T E R I O R"
|
||||||
|
Dim IdxRefAnioAnteriorLlantas As Integer = IdxRefMesAnioAnteriorLlantas
|
||||||
|
|
||||||
|
Dim columnRefAnioAnterior As Integer = 9
|
||||||
|
|
||||||
|
worksheet.Cells(IdxRefAnioAnteriorLlantas, columnRefAnioAnterior).Value = "Sucursal"
|
||||||
|
worksheet.Cells(IdxRefAnioAnteriorLlantas, columnRefAnioAnterior + 1).Value = (FechaConsulta.Year - 1).ToString()
|
||||||
|
worksheet.Cells(IdxRefAnioAnteriorLlantas, columnRefAnioAnterior + 2).Value = FechaConsulta.Year.ToString()
|
||||||
|
worksheet.Cells(IdxRefAnioAnteriorLlantas, columnRefAnioAnterior + 3).Value = "Dif"
|
||||||
|
|
||||||
|
Dim StyleTitleTable4 = worksheet.Cells.GetSubrangeAbsolute(IdxRefAnioAnteriorLlantas, columnRefAnioAnterior, IdxRefAnioAnteriorLlantas, columnRefAnioAnterior + 3).Style
|
||||||
|
StyleTitleTable4.Font.Weight = ExcelFont.BoldWeight
|
||||||
|
StyleTitleTable4.Font.Name = "Calibri"
|
||||||
|
StyleTitleTable4.Font.Size = 8 * 20
|
||||||
|
StyleTitleTable4.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
||||||
|
StyleTitleTable4.VerticalAlignment = VerticalAlignmentStyle.Center
|
||||||
|
StyleTitleTable4.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
||||||
|
|
||||||
|
Dim DtAnioAnteriorLLantas As DataTable = DataSet.Tables(3)
|
||||||
|
'INICIA DESDE LA CUARTA FILA
|
||||||
|
Dim IdxAnioAnteriorLlantas As Integer = IdxRefAnioAnteriorLlantas + 1
|
||||||
|
|
||||||
|
For Each Row As DataRow In DtAnioAnteriorLLantas.FiltraParametros("TipoFila > 1").Rows
|
||||||
|
worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior).Value = Row("Grupo")
|
||||||
|
worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 1).Value = Row("LLantasAnioAnterior")
|
||||||
|
worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 2).Value = Row("LLantas")
|
||||||
|
worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 3).Formula = $"=({worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 1).Name} - {worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 2).Name})"
|
||||||
|
|
||||||
|
|
||||||
|
Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxAnioAnteriorLlantas, columnRefAnioAnterior, IdxAnioAnteriorLlantas, columnRefAnioAnterior + 3).Style
|
||||||
|
StyleData.Font.Weight = ExcelFont.NormalWeight
|
||||||
|
StyleData.Font.Name = "Calibri"
|
||||||
|
StyleData.Font.Size = 8 * 20
|
||||||
|
StyleData.VerticalAlignment = VerticalAlignmentStyle.Center
|
||||||
|
StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
||||||
|
StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
||||||
|
StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
|
||||||
|
|
||||||
|
If Row("TipoFila").ToString() = "2" Then
|
||||||
|
StyleData.Font.Weight = ExcelFont.BoldWeight
|
||||||
|
StyleData.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(255, 215, 0), SpreadsheetColor.FromArgb(255, 255, 255))
|
||||||
|
End If
|
||||||
|
|
||||||
|
IdxAnioAnteriorLlantas += 1
|
||||||
|
Next
|
||||||
|
|
||||||
|
For Each Row As DataRow In DtAnioAnteriorLLantas.FiltraParametros("TipoFila = 1").Rows
|
||||||
|
worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior).Value = Row("Grupo")
|
||||||
|
worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 1).Value = Row("LLantasAnioAnterior")
|
||||||
|
worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 2).Value = Row("LLantas")
|
||||||
|
worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 3).Formula = $"=(+{worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 1).Name} - {worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 2).Name})"
|
||||||
|
|
||||||
|
|
||||||
|
Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxAnioAnteriorLlantas, columnRefAnioAnterior, IdxAnioAnteriorLlantas, columnRefAnioAnterior + 3).Style
|
||||||
|
StyleData.Font.Weight = ExcelFont.BoldWeight
|
||||||
|
StyleData.Font.Name = "Calibri"
|
||||||
|
StyleData.Font.Size = 8 * 20
|
||||||
|
StyleData.VerticalAlignment = VerticalAlignmentStyle.Center
|
||||||
|
StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
||||||
|
StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
||||||
|
StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
|
||||||
|
StyleData.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(255, 215, 0), SpreadsheetColor.FromArgb(255, 255, 255))
|
||||||
|
|
||||||
|
IdxAnioAnteriorLlantas += 1
|
||||||
|
Next
|
||||||
|
DtAnioAnteriorLLantas.Dispose()
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "V E N T A S - S E R V I C I O S D E I N S T A L A C I O N, A M O R T I G U A D O R E S, P O L I Z A S"
|
#Region "V E N T A S - S E R V I C I O S D E I N S T A L A C I O N, A M O R T I G U A D O R E S, P O L I Z A S"
|
||||||
Dim IdxRefSucursalesServiciosAmortPolizas As Integer = IdxSucursalesLlantasAlin + 3
|
Dim IdxRefSucursalesServiciosAmortPolizas As Integer = IdxMesAnioAnteriorLlantas + 3
|
||||||
|
|
||||||
worksheet.Cells(IdxRefSucursalesServiciosAmortPolizas, 0).Value = "Sucursal"
|
worksheet.Cells(IdxRefSucursalesServiciosAmortPolizas, 0).Value = "Sucursal"
|
||||||
'TITULO SERVICIOS DE INSTALACION
|
'TITULO SERVICIOS DE INSTALACION
|
||||||
@@ -550,176 +885,6 @@ Partial Class Ventas_RepPS
|
|||||||
DtPorcentajes.Dispose()
|
DtPorcentajes.Dispose()
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "A Ñ O A N T E R I O R"
|
|
||||||
Dim IdxRefAnioAnteriorLlantas As Integer = IdxPorcentajes + 3
|
|
||||||
|
|
||||||
worksheet.Cells(IdxRefAnioAnteriorLlantas, 0).Value = "Sucursal"
|
|
||||||
worksheet.Cells(IdxRefAnioAnteriorLlantas, 1).Value = (FechaConsulta.Year - 1).ToString()
|
|
||||||
worksheet.Cells(IdxRefAnioAnteriorLlantas, 2).Value = FechaConsulta.Year.ToString()
|
|
||||||
worksheet.Cells(IdxRefAnioAnteriorLlantas, 3).Value = "Dif"
|
|
||||||
|
|
||||||
Dim StyleTitleTable4 = worksheet.Cells.GetSubrangeAbsolute(IdxRefAnioAnteriorLlantas, 0, IdxRefAnioAnteriorLlantas, 3).Style
|
|
||||||
StyleTitleTable4.Font.Weight = ExcelFont.BoldWeight
|
|
||||||
StyleTitleTable4.Font.Name = "Calibri"
|
|
||||||
StyleTitleTable4.Font.Size = 8 * 20
|
|
||||||
StyleTitleTable4.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
|
||||||
StyleTitleTable4.VerticalAlignment = VerticalAlignmentStyle.Center
|
|
||||||
StyleTitleTable4.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
|
||||||
|
|
||||||
Dim DtAnioAnteriorLLantas As DataTable = DataSet.Tables(3)
|
|
||||||
'INICIA DESDE LA CUARTA FILA
|
|
||||||
Dim IdxAnioAnteriorLlantas As Integer = IdxRefAnioAnteriorLlantas + 1
|
|
||||||
|
|
||||||
For Each Row As DataRow In DtAnioAnteriorLLantas.FiltraParametros("TipoFila > 1").Rows
|
|
||||||
worksheet.Cells(IdxAnioAnteriorLlantas, 0).Value = Row("Grupo")
|
|
||||||
worksheet.Cells(IdxAnioAnteriorLlantas, 1).Value = Row("LLantasAnioAnterior")
|
|
||||||
worksheet.Cells(IdxAnioAnteriorLlantas, 2).Value = Row("LLantas")
|
|
||||||
worksheet.Cells(IdxAnioAnteriorLlantas, 3).Formula = $"=({worksheet.Cells(IdxAnioAnteriorLlantas, 1).Name} - {worksheet.Cells(IdxAnioAnteriorLlantas, 2).Name})"
|
|
||||||
|
|
||||||
|
|
||||||
Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxAnioAnteriorLlantas, 0, IdxAnioAnteriorLlantas, 3).Style
|
|
||||||
StyleData.Font.Weight = ExcelFont.NormalWeight
|
|
||||||
StyleData.Font.Name = "Calibri"
|
|
||||||
StyleData.Font.Size = 8 * 20
|
|
||||||
StyleData.VerticalAlignment = VerticalAlignmentStyle.Center
|
|
||||||
StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
|
||||||
StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
|
||||||
StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
|
|
||||||
|
|
||||||
If Row("TipoFila").ToString() = "2" Then
|
|
||||||
StyleData.Font.Weight = ExcelFont.BoldWeight
|
|
||||||
StyleData.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(255, 215, 0), SpreadsheetColor.FromArgb(255, 255, 255))
|
|
||||||
End If
|
|
||||||
|
|
||||||
IdxAnioAnteriorLlantas += 1
|
|
||||||
Next
|
|
||||||
|
|
||||||
For Each Row As DataRow In DtAnioAnteriorLLantas.FiltraParametros("TipoFila = 1").Rows
|
|
||||||
worksheet.Cells(IdxAnioAnteriorLlantas, 0).Value = Row("Grupo")
|
|
||||||
worksheet.Cells(IdxAnioAnteriorLlantas, 1).Value = Row("LLantasAnioAnterior")
|
|
||||||
worksheet.Cells(IdxAnioAnteriorLlantas, 2).Value = Row("LLantas")
|
|
||||||
worksheet.Cells(IdxAnioAnteriorLlantas, 3).Formula = $"=(+{worksheet.Cells(IdxAnioAnteriorLlantas, 1).Name} - {worksheet.Cells(IdxAnioAnteriorLlantas, 2).Name})"
|
|
||||||
|
|
||||||
|
|
||||||
Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxAnioAnteriorLlantas, 0, IdxAnioAnteriorLlantas, 3).Style
|
|
||||||
StyleData.Font.Weight = ExcelFont.BoldWeight
|
|
||||||
StyleData.Font.Name = "Calibri"
|
|
||||||
StyleData.Font.Size = 8 * 20
|
|
||||||
StyleData.VerticalAlignment = VerticalAlignmentStyle.Center
|
|
||||||
StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
|
||||||
StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
|
||||||
StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
|
|
||||||
StyleData.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(255, 215, 0), SpreadsheetColor.FromArgb(255, 255, 255))
|
|
||||||
|
|
||||||
IdxAnioAnteriorLlantas += 1
|
|
||||||
Next
|
|
||||||
DtAnioAnteriorLLantas.Dispose()
|
|
||||||
#End Region
|
|
||||||
|
|
||||||
#Region "L L A N T A S M E S A Ñ O A N T E R I O R"
|
|
||||||
Dim IdxRefMesAnioAnteriorLlantas As Integer = IdxAnioAnteriorLlantas + 3
|
|
||||||
|
|
||||||
worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas - 1, 1, IdxRefMesAnioAnteriorLlantas - 1, 3).Merged = True
|
|
||||||
worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas - 1, 4, IdxRefMesAnioAnteriorLlantas - 1, 6).Merged = True
|
|
||||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantas - 1, 1).Value = "LLANTAS"
|
|
||||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantas - 1, 4).Value = "%"
|
|
||||||
|
|
||||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 0).Value = "Sucursal"
|
|
||||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 1).Value = String.Format("{0} {1}", ToShortMonthName(FechaConsulta).ToUpper(), (FechaConsulta.Year - 1))
|
|
||||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 2).Value = String.Format("{0} {1}", ToShortMonthName(FechaConsulta).ToUpper(), (FechaConsulta.Year))
|
|
||||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 3).Value = "DIF %"
|
|
||||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 4).Value = String.Format("{0} - %", (FechaConsulta.Year - 1))
|
|
||||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 5).Value = String.Format("{0} - %", (FechaConsulta.Year))
|
|
||||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 6).Value = "DIF %"
|
|
||||||
|
|
||||||
Dim StyleTitleTable5 = worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas - 1, 0, IdxRefMesAnioAnteriorLlantas - 1, 6).Style
|
|
||||||
StyleTitleTable5.Font.Weight = ExcelFont.BoldWeight
|
|
||||||
StyleTitleTable5.Font.Name = "Calibri"
|
|
||||||
StyleTitleTable5.Font.Size = 8 * 20
|
|
||||||
StyleTitleTable5.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
|
||||||
StyleTitleTable5.VerticalAlignment = VerticalAlignmentStyle.Center
|
|
||||||
StyleTitleTable5.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
|
||||||
|
|
||||||
Dim StyleSubTitleTable5 = worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas, 0, IdxRefMesAnioAnteriorLlantas, 6).Style
|
|
||||||
StyleSubTitleTable5.Font.Weight = ExcelFont.BoldWeight
|
|
||||||
StyleSubTitleTable5.Font.Name = "Calibri"
|
|
||||||
StyleSubTitleTable5.Font.Size = 8 * 20
|
|
||||||
StyleSubTitleTable5.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
|
||||||
StyleSubTitleTable5.VerticalAlignment = VerticalAlignmentStyle.Center
|
|
||||||
StyleSubTitleTable5.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
|
||||||
|
|
||||||
Dim DtMesAnioAnteriorLLantas As DataTable = DataSet.Tables(4)
|
|
||||||
'INICIA DESDE LA CUARTA FILA
|
|
||||||
Dim IdxMesAnioAnteriorLlantas As Integer = IdxRefMesAnioAnteriorLlantas + 1
|
|
||||||
|
|
||||||
For Each Row As DataRow In DtMesAnioAnteriorLLantas.Rows
|
|
||||||
worksheet.Cells(IdxMesAnioAnteriorLlantas, 0).Value = Row("Sucursal")
|
|
||||||
worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Value = Row("LLantasAnioAnterior")
|
|
||||||
worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Value = Row("LLantas")
|
|
||||||
worksheet.Cells(IdxMesAnioAnteriorLlantas, 3).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name} - {worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name})"
|
|
||||||
worksheet.Cells(IdxMesAnioAnteriorLlantas, 4).Formula = $"=+(({worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name} * 1.07) - {worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name}) /12"
|
|
||||||
worksheet.Cells(IdxMesAnioAnteriorLlantas, 5).Formula = $"=+(({worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name} * 1) - {worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name}) /12"
|
|
||||||
worksheet.Cells(IdxMesAnioAnteriorLlantas, 6).Formula = $"=+({worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name} / {worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name}) - 1"
|
|
||||||
|
|
||||||
Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantas, 0, IdxMesAnioAnteriorLlantas, 6).Style
|
|
||||||
StyleData.Font.Weight = ExcelFont.NormalWeight
|
|
||||||
StyleData.Font.Name = "Calibri"
|
|
||||||
StyleData.Font.Size = 8 * 20
|
|
||||||
StyleData.VerticalAlignment = VerticalAlignmentStyle.Center
|
|
||||||
StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
|
||||||
StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
|
||||||
StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
|
|
||||||
|
|
||||||
IdxMesAnioAnteriorLlantas += 1
|
|
||||||
Next
|
|
||||||
|
|
||||||
DtMesAnioAnteriorLLantas.Dispose()
|
|
||||||
#End Region
|
|
||||||
|
|
||||||
#Region "L L A N T A S M E S A Ñ O A N T E R I O R"
|
|
||||||
Dim IdxRefMesAnioAnteriorLlantasResumen As Integer = IdxMesAnioAnteriorLlantas + 2
|
|
||||||
|
|
||||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 0).Value = "Mes"
|
|
||||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 1).Value = String.Format("{0}", (FechaConsulta.Year - 1))
|
|
||||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 2).Value = String.Format("{0}", (FechaConsulta.Year))
|
|
||||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 3).Value = "DIF UDS"
|
|
||||||
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 4).Value = "DIF %"
|
|
||||||
|
|
||||||
Dim StyleTitleTable6 = worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantasResumen, 0, IdxRefMesAnioAnteriorLlantasResumen, 4).Style
|
|
||||||
StyleTitleTable6.Font.Weight = ExcelFont.BoldWeight
|
|
||||||
StyleTitleTable6.Font.Name = "Calibri"
|
|
||||||
StyleTitleTable6.Font.Size = 8 * 20
|
|
||||||
StyleTitleTable6.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
|
||||||
StyleTitleTable6.VerticalAlignment = VerticalAlignmentStyle.Center
|
|
||||||
StyleTitleTable6.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
|
||||||
|
|
||||||
|
|
||||||
Dim DtMesAnioAnteriorLLantasResumen As DataTable = DataSet.Tables(5)
|
|
||||||
'INICIA DESDE LA CUARTA FILA
|
|
||||||
Dim IdxMesAnioAnteriorLlantasResumen As Integer = IdxRefMesAnioAnteriorLlantasResumen + 1
|
|
||||||
|
|
||||||
For Each Row As DataRow In DtMesAnioAnteriorLLantasResumen.Rows
|
|
||||||
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 0).Value = ToMonthName(FechaConsulta).ToUpper()
|
|
||||||
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Value = Row("LLantasAnioAnterior")
|
|
||||||
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Value = Row("LLantas")
|
|
||||||
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 3).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Name} - {worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Name})"
|
|
||||||
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 4).Formula = $"=+({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Name} / {worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Name})"
|
|
||||||
|
|
||||||
Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantasResumen, 0, IdxMesAnioAnteriorLlantasResumen, 4).Style
|
|
||||||
StyleData.Font.Weight = ExcelFont.NormalWeight
|
|
||||||
StyleData.Font.Name = "Calibri"
|
|
||||||
StyleData.Font.Size = 8 * 20
|
|
||||||
StyleData.VerticalAlignment = VerticalAlignmentStyle.Center
|
|
||||||
StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center
|
|
||||||
StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
|
|
||||||
StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
|
|
||||||
|
|
||||||
IdxMesAnioAnteriorLlantasResumen += 1
|
|
||||||
Next
|
|
||||||
|
|
||||||
DtMesAnioAnteriorLLantasResumen.Dispose()
|
|
||||||
#End Region
|
|
||||||
|
|
||||||
Dim columnCount = worksheet.CalculateMaxUsedColumns()
|
Dim columnCount = worksheet.CalculateMaxUsedColumns()
|
||||||
|
|
||||||
For i = 0 To columnCount
|
For i = 0 To columnCount
|
||||||
|
|||||||
@@ -1867,7 +1867,7 @@ Public Class WSSIGApp
|
|||||||
|
|
||||||
'VALIDA PROMOCIONES Y EXISTENCIAS
|
'VALIDA PROMOCIONES Y EXISTENCIAS
|
||||||
Dim ObjVentas As New ClsVentas
|
Dim ObjVentas As New ClsVentas
|
||||||
If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, CveCliente, ObjFactura.CveVendedor, -1, UsuarioActual.CveEmpresa) Then
|
If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, CveCliente, ObjFactura.CveVendedor, 1, UsuarioActual.CveEmpresa) Then
|
||||||
ObjFactura.DtPromociones = ObjVentas.DtResultados
|
ObjFactura.DtPromociones = ObjVentas.DtResultados
|
||||||
End If
|
End If
|
||||||
ObjVentas.Dispose()
|
ObjVentas.Dispose()
|
||||||
@@ -1951,13 +1951,13 @@ Public Class WSSIGApp
|
|||||||
ObjFactura.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", $"CveUsoCFDI = {ObjCliente.CveUsoCFDI}")
|
ObjFactura.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", $"CveUsoCFDI = {ObjCliente.CveUsoCFDI}")
|
||||||
ObjFactura.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", $"CveUsoCFDI = {ObjCliente.CveUsoCFDI}")
|
ObjFactura.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", $"CveUsoCFDI = {ObjCliente.CveUsoCFDI}")
|
||||||
|
|
||||||
ObjFactura.CveMetodoPago = ObjCliente.CveMetodoPago
|
'ObjFactura.CveMetodoPago = ObjCliente.CveMetodoPago
|
||||||
If GlobalDTMetodosPago.FiltraParametros($"CveMetodoPago = {ObjCliente.CveMetodoPago}").Rows.Count > 0 Then
|
'If GlobalDTMetodosPago.FiltraParametros($"CveMetodoPago = {ObjCliente.CveMetodoPago}").Rows.Count > 0 Then
|
||||||
ObjFactura.MetodoPago = GlobalDTMetodosPago.FiltraParametros($"CveMetodoPago = {ObjCliente.CveMetodoPago}").Rows(0)("MetodoPago").ToString
|
' ObjFactura.MetodoPago = GlobalDTMetodosPago.FiltraParametros($"CveMetodoPago = {ObjCliente.CveMetodoPago}").Rows(0)("MetodoPago").ToString
|
||||||
Else
|
'Else
|
||||||
ObjFactura.CveMetodoPago = 1
|
' ObjFactura.CveMetodoPago = 1
|
||||||
ObjFactura.MetodoPago = "Efectivo"
|
' ObjFactura.MetodoPago = "Efectivo"
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
ObjFactura.CveClienteSucursal = -1
|
ObjFactura.CveClienteSucursal = -1
|
||||||
End If
|
End If
|
||||||
|
|||||||
Reference in New Issue
Block a user