Merge branch 'master' of http://oirigoyen@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -1070,16 +1070,16 @@ Partial Class AF_AF
|
||||
TmpServicios.Columns.Add("OdHorometro", GetType(Double))
|
||||
TmpServicios.Columns.Add("Observaciones", GetType(String))
|
||||
|
||||
Dim Row As DataRow = TmpServicios.NewRow
|
||||
Row("CveProveedor") = 3100
|
||||
Row("CveCompra") = 181656
|
||||
Row("Tipo") = "Preventivo"
|
||||
Row("Fecha") = "01/02/2016"
|
||||
Row("Proveedor") = "EMPRESAS MATCO, S.A. DE C.V."
|
||||
Row("Factura") = "HERAA-158591"
|
||||
Row("OdHorometro") = "198,567"
|
||||
Row("Observaciones") = "Servicio Preventivo 200,000 Kilometros - Servicio Completo"
|
||||
TmpServicios.Rows.Add(Row)
|
||||
'Dim Row As DataRow = TmpServicios.NewRow
|
||||
'Row("CveProveedor") = 3100
|
||||
'Row("CveCompra") = 181656
|
||||
'Row("Tipo") = "Preventivo"
|
||||
'Row("Fecha") = "01/02/2016"
|
||||
'Row("Proveedor") = "EMPRESAS MATCO, S.A. DE C.V."
|
||||
'Row("Factura") = "HERAA-158591"
|
||||
'Row("OdHorometro") = "198,567"
|
||||
'Row("Observaciones") = "Servicio Preventivo 200,000 Kilometros - Servicio Completo"
|
||||
'TmpServicios.Rows.Add(Row)
|
||||
|
||||
GvServiciosMant.DataSource = TmpServicios
|
||||
GvServiciosMant.DataBind()
|
||||
|
||||
@@ -386,12 +386,12 @@
|
||||
<div class="col-md-12">
|
||||
<div style="overflow-y: auto; height: 400px; width: 1200px;" runat="server">
|
||||
<asp:GridView ID="GvGarantiasDetalle" runat="server" AutoGenerateColumns="false" Width="100%" EmptyDataText="No se encontraron datos" CssClass="table table-striped table-hover Widthall"
|
||||
DataKeyNames="Consecutivo,CodigoCliente,CodigoProducto,CodigoTipoUso,CodigoTipoDefecto,CodigoEnsamble,CodigoLinea,CodigoInspeccion,FechaVenta,FechaReclamacion,TipoComprobante,Comprobante,Autorizo,Comentarios,ClaveAutorizacion" BorderColor="#D3D3D3" GridLines="None">
|
||||
DataKeyNames="Consecutivo,CodigoCliente,Codigo,CodigoTipoUso,CodigoTipoDefecto,CodigoEnsamble,CodigoLinea,CodigoInspeccion,FechaVenta,FechaReclamacion,TipoComprobante,Comprobante,Autorizo,Comentarios,ClaveAutorizacion" BorderColor="#D3D3D3" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Consecutivo" HeaderText="Consecutivo" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
<asp:BoundField DataField="FolioFactura" HeaderText="Factura" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
|
||||
<asp:BoundField DataField="Cliente" HeaderText="Cliente" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="30%" />
|
||||
<asp:BoundField DataField="CodigoProducto" HeaderText="Código" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
<asp:BoundField DataField="Codigo" HeaderText="Código" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
<asp:BoundField DataField="PS" HeaderText="Producto" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="20%" />
|
||||
<asp:BoundField DataField="TipoUso" HeaderText="Tipo Uso" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
<asp:BoundField DataField="CodigoEnsamble" HeaderText="Código Ensamble" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
|
||||
@@ -265,7 +265,7 @@ Partial Class Acumuladores_CatFoliosGarantia
|
||||
'2.- Cliente-->100407
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoCliente"))
|
||||
'3. Codigo De Articulo --> 171402
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoProducto"))
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("Codigo"))
|
||||
'4. Tipo De Uso --> A
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoTipoUso"))
|
||||
'5. Defecto --> P
|
||||
|
||||
@@ -1410,6 +1410,8 @@ Public Class ClsContabilidad
|
||||
_ContaIdPoliza = tIdPoliza
|
||||
_ContaFolio = ObjConta.Folio
|
||||
End If
|
||||
Else
|
||||
StrLog.AppendFormat(" Error 0.2 - ")
|
||||
End If
|
||||
|
||||
Else
|
||||
|
||||
@@ -2918,11 +2918,12 @@ Public Class ClsInventarios
|
||||
#End Region
|
||||
|
||||
#Region " INVENTARIOS - VENTAS "
|
||||
Public Function EntregaAlmacenGet(CveVenta As Integer) As Boolean
|
||||
Public Function EntregaAlmacenGet(CveVenta As Integer, Optional CveAlmacen As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Inv_EntregaAlmacenGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
@@ -1517,7 +1517,7 @@ Public Class ClsMovimientos
|
||||
Optional CveCuenta As Integer = -1, Optional Grupo As String = "-1",
|
||||
Optional TipoCambio As Integer = -1, Optional TCEspecifico As Double = 0,
|
||||
Optional CveMoneda As Integer = -1, Optional CveClienteClasificacion As Integer = -1, Optional Tipo As Integer = -1,
|
||||
Optional EsDistribuidor As Integer = -1) As Boolean
|
||||
Optional EsDistribuidor As Integer = -1, Optional FechaAplicadoI As Date = Nothing, Optional FechaAplicadoF As Date = Nothing) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
@@ -1546,7 +1546,12 @@ Public Class ClsMovimientos
|
||||
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
|
||||
.Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion
|
||||
.Add("@Tipo", SqlDbType.Int).Value = Tipo
|
||||
.Add("@EsDistribuidor", SqlDbType.Int).Value = EsDistribuidor
|
||||
.Add("@EsDistribuidor", SqlDbType.Int).Value = EsDistribuidor
|
||||
|
||||
|
||||
.Add("@FechaAplicadoI", SqlDbType.Date).Value = FechaAplicadoI.ToShortDateString
|
||||
.Add("@FechaAplicadoF", SqlDbType.Date).Value = FechaAplicadoF.ToShortDateString
|
||||
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -5276,14 +5276,14 @@ Public Class ClsPaginas
|
||||
|
||||
Usuario.CerrarSession()
|
||||
End Sub
|
||||
Public Sub Alert(Mensaje As String, Optional pOpcion As TipoMensaje = TipoMensaje.MsgInformacion, Optional JSBtnAceptar As String = "", Optional timeout As Integer = 5)
|
||||
Public Sub Alert(Mensaje As String, Optional pOpcion As TipoMensaje = TipoMensaje.MsgInformacion, Optional JSBtnAceptar As String = "", Optional timeout As Integer = 5, Optional ShowCloseButton As Boolean = True)
|
||||
If DirectCast(pOpcion, Integer) >= 5 Then
|
||||
Mensaje = Mensaje.Replace("'"c, "\'").Replace(vbCrLf, "").Replace("""", "\'").Replace(vbLf, " ")
|
||||
JSBtnAceptar = JSBtnAceptar.Replace("'"c, "\'")
|
||||
Dim toastscript As String = String.Format("alertatoast({3},'{0}',function(){{{1}}},{2});", Mensaje, JSBtnAceptar, timeout, DirectCast(pOpcion, Integer))
|
||||
ViewState("strToastMsglargonoreplace") = String.Format("{0}{1}", If(Not IsNothing(ViewState("strToastMsglargonoreplace")) AndAlso ViewState("strToastMsglargonoreplace").ToString().Length > 0, ViewState("strToastMsglargonoreplace").ToString(), ""), toastscript)
|
||||
Else
|
||||
Mensaje.Alert(Mensaje, pOpcion, JSBtnAceptar, TimeoutToast:=timeout)
|
||||
Mensaje.Alert(Mensaje, pOpcion, JSBtnAceptar, TimeoutToast:=timeout, ShowCloseButton:=ShowCloseButton)
|
||||
End If
|
||||
End Sub
|
||||
Protected Overridable Sub Page_PreRender(sender As Object, e As EventArgs) Handles Me.PreRender
|
||||
|
||||
@@ -333,7 +333,7 @@ Public Class ClsSubProyectos
|
||||
Public Function AddCentroCosto(SubProyecto As String, IdSegNeg As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveProyecto As Integer, Optional Serie As String = "", Optional IVA As Double = 0.0, Optional Calle As String = "", Optional NoExt As String = "",
|
||||
Optional NoInt As String = "", Optional Colonia As String = "", Optional Localidad As String = "", Optional Municipio As String = "", Optional Estado As String = "", Optional Pais As String = "", Optional CP As String = "", Optional TipoSucursal As Integer = 0, Optional EsSucursal As Integer = 0,
|
||||
Optional CvePais As Integer = -1, Optional CveEstado As Integer = -1, Optional CveMunicipio As Integer = -1, Optional CveColonia As Integer = -1, Optional AplicaComercioExterior As Boolean = False, Optional Correo As String = "", Optional CvePrecioLista As Integer = -1,
|
||||
Optional Telefono As String = "") As Boolean
|
||||
Optional Telefono As String = "", Optional NoVerificaAlmacen As Boolean = False) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_CentroCostoAdd")
|
||||
@@ -365,6 +365,7 @@ Public Class ClsSubProyectos
|
||||
.Add("@Correo", SqlDbType.VarChar).Value = Correo
|
||||
.Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
|
||||
.Add("@Telefono", SqlDbType.VarChar).Value = Telefono
|
||||
.Add("@NoVerificaAlmacen", SqlDbType.Bit).Value = NoVerificaAlmacen
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
End With
|
||||
|
||||
@@ -387,7 +388,7 @@ Public Class ClsSubProyectos
|
||||
Public Function UpdateCentroCosto(CveSubProyecto As Integer, SubProyecto As String, IdSegNeg As Integer, Estatus As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveProyecto As Integer, Optional Serie As String = "", Optional IVA As Double = 0.0, Optional Calle As String = "", Optional NoExt As String = "",
|
||||
Optional NoInt As String = "", Optional Colonia As String = "", Optional Localidad As String = "", Optional Municipio As String = "", Optional Estado As String = "", Optional Pais As String = "", Optional CP As String = "", Optional TipoSucursal As Integer = 0, Optional EsSucursal As Integer = 0,
|
||||
Optional CvePais As Integer = -1, Optional CveEstado As Integer = -1, Optional CveMunicipio As Integer = -1, Optional CveColonia As Integer = -1, Optional AplicaComercioExterior As Boolean = False, Optional Correo As String = "", Optional CvePrecioLista As Integer = -1,
|
||||
Optional Telefono As String = "", Optional HorarioVerano As Integer = Nothing, Optional HorarioInvierno As Integer = Nothing) As Boolean
|
||||
Optional Telefono As String = "", Optional HorarioVerano As Integer = Nothing, Optional HorarioInvierno As Integer = Nothing, Optional NoVerificaAlmacen As Boolean = False) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_CentroCostoUpdate")
|
||||
@@ -423,6 +424,7 @@ Public Class ClsSubProyectos
|
||||
.Add("@Telefono", SqlDbType.VarChar).Value = Telefono
|
||||
.Add("@HorarioVerano", SqlDbType.Int).Value = HorarioVerano
|
||||
.Add("@HorarioInvierno", SqlDbType.Int).Value = HorarioInvierno
|
||||
.Add("@NoVerificaAlmacen", SqlDbType.Bit).Value = NoVerificaAlmacen
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -83,18 +83,18 @@ Public Class ClsValidaCFDi
|
||||
Return Me.EsValida
|
||||
End Function
|
||||
|
||||
Private Sub VerificaCFDI()
|
||||
|
||||
Private Sub VerificaCFDI()
|
||||
Dim Importe As String = LImporte.ToString("F6").PadLeft(17, "0")
|
||||
Dim MsgError As String = ""
|
||||
Dim MsgError2 As String = ""
|
||||
Try
|
||||
|
||||
Dim wsConsultaCFDI As New wsValidaCFDi2.ConsultaCFDIServiceClient
|
||||
Dim oAcuse As New wsValidaCFDi2.Acuse
|
||||
|
||||
'oAcuse = wsConsultaCFDI.Consulta("?re=BEN9501023I0&rr=SARM8209281F1&tt=440.000000&id=EC609EC1-5F63-4333-A2B8-2EDC10B68075")
|
||||
'?re=BEN9501023I0&rr=SARM8209281F1&tt=440.000000&id=EC609EC1-5F63-4333-A2B8-2EDC10B68075
|
||||
|
||||
Dim Importe As String = LImporte.ToString("F6").PadLeft(17, "0")
|
||||
|
||||
Dim oAcuse As New wsValidaCFDi2.Acuse
|
||||
|
||||
'oAcuse = wsConsultaCFDI.Consulta("?re=BEN9501023I0&rr=SARM8209281F1&tt=440.000000&id=EC609EC1-5F63-4333-A2B8-2EDC10B68075")
|
||||
'?re=BEN9501023I0&rr=SARM8209281F1&tt=440.000000&id=EC609EC1-5F63-4333-A2B8-2EDC10B68075
|
||||
|
||||
oAcuse = wsConsultaCFDI.Consulta(String.Format("?re={0}&rr={1}&tt={2}&id={3}", LRFCEmisor, LRFCReceptor, Importe, LFolioFiscal.ToUpper))
|
||||
'oAcuse = wsConsultaCFDI.Consulta("?re=LESA6211234B2&rr=GCO890418M56&tt=0000001360.000000&id=0C8BAD9C-A8C6-4A48-8FF5-0687AC6F1581")
|
||||
'Alert(oAcuse.Estado)
|
||||
@@ -106,18 +106,25 @@ Public Class ClsValidaCFDi
|
||||
End If
|
||||
|
||||
If oAcuse.ValidacionEFOS = "100" Then
|
||||
EnListaEFOS = True
|
||||
EnListaEFOS = True
|
||||
Else
|
||||
EnListaEFOS = False
|
||||
End If
|
||||
|
||||
'SI NO PUEDE ENCONTRAR EL ESTATUS UTILIZA EL SERVICIO PARA ESTATUS DE CANCELACION
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgError = "Op1. No se pudo validar la vigencia ante el SAT "
|
||||
GuardaLog(String.Format("Op1. {0}", ex.Message))
|
||||
End Try
|
||||
|
||||
Try
|
||||
|
||||
|
||||
'SI NO PUEDE ENCONTRAR EL ESTATUS UTILIZA EL SERVICIO PARA ESTATUS DE CANCELACION
|
||||
If EsValida = 0 Then
|
||||
|
||||
Dim Vigencia = Timbrado.VerificarVigenciaSAT(LFolioFiscal.ToUpper, LRFCEmisor, LRFCReceptor, Importe, True)
|
||||
|
||||
If Vigencia IsNot Nothing Then
|
||||
If Vigencia.EsCancelable.ToUpper() = "NO CANCELABLE" Then
|
||||
If Not Vigencia.Estado.ToUpper().Contains("NO ENCONTRADO") AndAlso Vigencia.EsCancelable.ToUpper() = "NO CANCELABLE" Then
|
||||
EsValida = 1
|
||||
End If
|
||||
If Vigencia.Estado.ToUpper().Contains("CANCELADO") Then
|
||||
@@ -132,18 +139,24 @@ Public Class ClsValidaCFDi
|
||||
End If
|
||||
Else
|
||||
EsValida = 0
|
||||
|
||||
End If
|
||||
Else
|
||||
EsValida = 0
|
||||
End If
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al consultar la vigencia ante el SAT", ex)
|
||||
End Try
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgError2 = "Op2. No se pudo validar la vigencia ante el SAT "
|
||||
GuardaLog(String.Format("Op2. {0}", ex.Message))
|
||||
End Try
|
||||
'sino se pudo validar, que muestre el mensaje de error, pero solo un mensaje
|
||||
If EsValida = 0 AndAlso (MsgError <> "" OrElse MsgError2 <> "") Then
|
||||
If MsgError <> "" Then Alert(MsgError, TipoMensaje.MsgError) Else If MsgError2 <> "" Then Alert(MsgError2, TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Verificar()
|
||||
Private Sub VerificaWeb()
|
||||
Try
|
||||
|
||||
Dim URL As String = "https://verificacfdi.facturaelectronica.sat.gob.mx/"
|
||||
|
||||
@@ -4507,11 +4507,16 @@ Public Class ClsVentas
|
||||
End Try
|
||||
Return retorno
|
||||
End Function
|
||||
Public Function GetMetasVendedores(CveEmpresa As Integer) As Boolean
|
||||
Public Function GetMetasVendedores(CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1, Optional CveVendedor As Integer = -1, Optional CveMarca As Integer = -1, Optional Mes As Integer = -1, Optional Anio As Integer = -1) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_MetasVendedoresGet", CommandType.StoredProcedure)
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
|
||||
.Add("@Mes", SqlDbType.Int).Value = Mes
|
||||
.Add("@Anio", SqlDbType.Int).Value = Anio
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
@@ -311,7 +311,7 @@ Namespace Extensiones
|
||||
ToastAdventencia = 8 'Warning
|
||||
End Enum
|
||||
<Runtime.CompilerServices.Extension()>
|
||||
Public Sub Alert(Obj As Object, Mensaje As String, pOpcion As TipoMensaje, Optional JSBtnAceptar As String = "", Optional TextoConfirmacion As String = "Aceptar", Optional TextoCancelacion As String = "Cancelar", Optional TimeoutToast As Integer = 5)
|
||||
Public Sub Alert(Obj As Object, Mensaje As String, pOpcion As TipoMensaje, Optional JSBtnAceptar As String = "", Optional TextoConfirmacion As String = "Aceptar", Optional TextoCancelacion As String = "Cancelar", Optional TimeoutToast As Integer = 5, Optional ShowCloseButton As Boolean = True)
|
||||
If System.Web.HttpContext.Current IsNot Nothing AndAlso System.Web.HttpContext.Current.Handler IsNot Nothing AndAlso System.Web.HttpContext.Current.Handler.GetType().IsSubclassOf(GetType(Page)) Then
|
||||
|
||||
Dim Titulo As String = ""
|
||||
@@ -331,6 +331,7 @@ Namespace Extensiones
|
||||
Dim b3title As String = ""
|
||||
Dim b3clas As String = "hide"
|
||||
Dim b3js As String = ""
|
||||
Dim closeButtonOption As String = ""
|
||||
Select Case pOpcion
|
||||
Case TipoMensaje.MsgInformacion
|
||||
Titulo = "<i class='fa fa-info-circle'></i> Información"
|
||||
@@ -371,15 +372,18 @@ Namespace Extensiones
|
||||
End Select
|
||||
|
||||
Try
|
||||
|
||||
'No cerrar el alert obliga a hacer click en los botones de opcion
|
||||
If Not ShowCloseButton Then
|
||||
closeButtonOption = "backdrop : ""static"", keyboard : false, closeButton: false,"
|
||||
End If
|
||||
|
||||
Dim Pag As Page = DirectCast(System.Web.HttpContext.Current.Handler, Page)
|
||||
Dim script As String = ""
|
||||
If showalert Then
|
||||
script = String.Format("bootbox.dialog({{message: ""{0} "",className: ""{11}"",onEscape: function() {{ {12} }},title: ""{1}"",buttons: {{ success: {{ label: ""{2}"", className: "" {3}""," &
|
||||
script = String.Format("bootbox.dialog({{message: ""{0} "", className: ""{11}"", {12} onEscape: function() {{ {12} }},title: ""{1}"",buttons: {{ success: {{ label: ""{2}"", className: "" {3}""," &
|
||||
"callback: function() {{ {4} }} }}, danger: {{ label: ""{5}"", className: "" {6}"",callback: function() {{ {7} }} }}," &
|
||||
"main: {{ label: ""{8}"", className: "" {9}"", callback: function() {{ {10} }} }} }} }});",
|
||||
Mensaje, Titulo, b3title, b3clas, b3js, b2title, b2clas, b2js, b1title, b1clas, b1js, headerclas, onEscape)
|
||||
Mensaje, Titulo, b3title, b3clas, b3js, b2title, b2clas, b2js, b1title, b1clas, b1js, headerclas, onEscape, closeButtonOption)
|
||||
Else
|
||||
|
||||
script = String.Format("alertatoast({3},'{0}',function(){{{1}}},{2});", Mensaje, JSBtnAceptar, TimeoutToast, DirectCast(pOpcion, Integer))
|
||||
@@ -3592,9 +3596,9 @@ Namespace Extensiones
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
End Class
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "A T R I B U T O S"
|
||||
Public Class BasicAuthenticationAttribute
|
||||
Inherits AuthorizationFilterAttribute
|
||||
@@ -3660,7 +3664,7 @@ Namespace Extensiones
|
||||
actionContext.Response = actionContext.Request.CreateResponse(HttpStatusCode.Unauthorized)
|
||||
actionContext.Response.Headers.Add("WWW-Authenticate", "Basic Scheme='Data' location = 'http://localhost:")
|
||||
End Sub
|
||||
End Class
|
||||
End Class
|
||||
#End Region
|
||||
|
||||
|
||||
End Namespace
|
||||
|
||||
@@ -303,10 +303,8 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
|
||||
Protected Sub BtnGeneraVentas_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim Total As Decimal = 0
|
||||
Dim Conta As New ClsContabilidad
|
||||
Conta.IniciaTransacSQL()
|
||||
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaV", 1, 0, 0, 1, TxtFecha.Text.ToDate, TxtConceptoVentas.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
Dim Total As Decimal = 0
|
||||
|
||||
Dim idCta As Integer = 0
|
||||
Dim CveCuenta As Integer = 0
|
||||
Dim CveCuentaPerdida, CveCuentaGanancia As Integer
|
||||
@@ -336,6 +334,15 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
TipoMovto = False
|
||||
End If
|
||||
|
||||
If Total = 0 Then
|
||||
Alert("El Importe tiene que ser diferente a cero", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim Conta As New ClsContabilidad
|
||||
Conta.IniciaTransacSQL()
|
||||
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaV", 1, 0, 0, 1, TxtFecha.Text.ToDate, TxtConceptoVentas.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Ventas", CveConceptoContable, "Fluctuación Ventas", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlsubProyectoVentas.SelectedValue.ToEntero) Then
|
||||
ErrorRegistrar = True
|
||||
End If
|
||||
|
||||
@@ -690,7 +690,7 @@ Partial Class Bancos_PopIEVentas
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(529) = "1" Then
|
||||
|
||||
|
||||
Dim Valida As New ClsValidaCFDi(dr("FolioFiscal").ToString(), dr("ClienteRFC").ToString, UsuarioActual.Empresa.RFC)
|
||||
Dim Valida As New ClsValidaCFDi(dr("FolioFiscal").ToString(), UsuarioActual.Empresa.RFC, dr("ClienteRFC").ToString, dr("Total").ToString.ToDecimal)
|
||||
|
||||
If Valida.EsValida > 0 Then
|
||||
If Valida.EsValida = 2 Then
|
||||
@@ -713,9 +713,9 @@ Partial Class Bancos_PopIEVentas
|
||||
Else
|
||||
Validada = True
|
||||
End If
|
||||
Else
|
||||
'no se pudo validar, pero ya tuvo la primera vuelta de validacion
|
||||
Validada = True
|
||||
Else
|
||||
'no se pudo validar, pero ya tuvo la primera vuelta de validacion
|
||||
Validada = False
|
||||
End If
|
||||
Valida.Dispose()
|
||||
Else
|
||||
|
||||
@@ -237,7 +237,7 @@
|
||||
<asp:Literal runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDevoluciones" runat="server" Text='<%# Eval("Devoluciones", "{0:N2}") %>'></asp:Literal>
|
||||
<asp:Literal ID="LtlDevoluciones" runat="server" Text='<%# Eval("Devoluciones", "{0:#,###.##}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
|
||||
@@ -221,7 +221,7 @@ public partial class CRM_CatEmpresasCRM : ClsPaginas
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert(String.Format("El Giro de Empresa '{0}'", Giro), ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
Alert(String.Format("El Giro de Empresa '{0}', No está especificado", Giro), ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
TieneError = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3217,6 +3217,12 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="align-items: center" id="divDevAuto" runat="server" visible="false">
|
||||
<label class="col-md-4">Devolución automática:</label>
|
||||
<div class="col-md-8">
|
||||
<asp:CheckBox Text="" runat="server" ID="CheckDevAuto" Visible="True" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnCancelarCompra2" OnClick="BtnCancelarCompra2_Click" runat="server" CssClass="btn btn-success" Text="Cancelar Compra" ValidationGroup="GrpCancelarCompra" />
|
||||
|
||||
@@ -1591,8 +1591,12 @@ Partial Class Compras_Compras
|
||||
|
||||
LtlTareaNueva.Text = String.Format("<a class=""caption-subject bold font-green"" onclick=""OpenModalNewTareaUserControl(1,-1,{{CveCompra:{0}}});""> <i class=""fa fa-plus""'></i> Tarea</a>", CveCompra)
|
||||
|
||||
End If
|
||||
'Valida si tienes permisos para devolucion automatica y si cumple con las condiciones para mostrarlo
|
||||
If UsuarioActual.TienePermisoProceso(315) And GvInvMov.Rows.Count > 0 Then
|
||||
divDevAuto.Visible = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
'SE OCUPAN AFUERA DEL POSTBACK ??
|
||||
cargaddlVinculacionServcios()
|
||||
@@ -5258,7 +5262,6 @@ Partial Class Compras_Compras
|
||||
'hay que restarle descuento
|
||||
importeconcepto = If(DdlMoneda.SelectedValue.ToEntero = 1, dr("pu").ToString.ToDecimal, dr("pu").ToString.ToDecimal * TipoCambioGuardar) - (If(DdlMoneda.SelectedValue.ToEntero = 1, dr("descuento").ToString.ToDecimal, dr("descuento").ToString.ToDecimal * TipoCambioGuardar) / dr("cantidad").ToString.ToDecimal)
|
||||
If Not ObjInventario.AddMovimientoDetalle(cvemovimientoentrada, dr("cantidad").ToString.ToDouble, dr("cveum").ToString.ToEntero, dr("cveps").ToString.ToEntero, importeconcepto, -1, PUTC:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, dr("pu").ToString.ToDecimal), CveCompraDetalle:=dr("CveCompraDetalle").ToString.ToEntero) Then
|
||||
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -7334,6 +7337,8 @@ Partial Class Compras_Compras
|
||||
|
||||
For Each Ant As Compras_Compras.Anticipos In ArrAnticipos
|
||||
|
||||
TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False)
|
||||
|
||||
Dim ConceptoContableAnticipo, ConceptoContableAnticipoComplementaria As Integer
|
||||
Dim CveCompraNC As Integer = CveCompra
|
||||
|
||||
@@ -7537,7 +7542,7 @@ Partial Class Compras_Compras
|
||||
|
||||
Dim usacomplementariaAnticipo As Boolean = False
|
||||
usacomplementariaAnticipo = If(Ant.TCCompra > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119), True, False)
|
||||
Dim TipoCambioAnt = Ant.TCCompra
|
||||
Dim TipoCambioAnt As Decimal = Ant.TCCompra
|
||||
|
||||
|
||||
Dim ImporteAnt As Decimal = importeMovimiento
|
||||
@@ -8877,6 +8882,7 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
|
||||
Dim TipoCambioDiferencia = If(ChkPagarConDolares.Checked, GlobalTipoCambio(TxtFecha.Text.ToDate), TipoCambioCompra).ToDecimal
|
||||
|
||||
If TipoCambioDiferencia <> TipoCambioAnt Then
|
||||
Dim importeFluctuacion = (ImporteAnt * TipoCambioDiferencia) - (ImporteAnt * TipoCambioAnt)
|
||||
|
||||
@@ -14751,7 +14757,7 @@ Partial Class Compras_Compras
|
||||
If UsuarioActual.TienePermisoProceso(140) Then
|
||||
If CveMovimientoAlmacen > 0 And EstatusAlmacen = 2 Then
|
||||
BtnCancelarCompra.Visible = True
|
||||
ElseIf CveMovimientoAlmacen = 0 Then
|
||||
Else
|
||||
BtnCancelarCompra.Visible = True
|
||||
End If
|
||||
End If
|
||||
@@ -14788,6 +14794,70 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
ObjComprasComprobacion.Dispose()
|
||||
|
||||
|
||||
'DEVOLUCIÓN AUTOMATICA
|
||||
If CheckDevAuto.Checked Then
|
||||
Dim ErrorMovInv As Boolean = False
|
||||
Dim cvemovimientoentrada As Integer
|
||||
Dim folio As Integer
|
||||
Dim fecha As Date = TxtFechaCancelacion.Text.ToDate
|
||||
Dim importeconcepto As Decimal
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
Dim ObjCompra As New ClsCompras
|
||||
Dim tbmovs As DataTable = Nothing
|
||||
Dim TmpDT As DataTable = Nothing
|
||||
Dim TipoCambioGuardar As Decimal = 1
|
||||
Dim tcvealmacen As Integer = 0
|
||||
|
||||
If ObjCompra.GetCompraDetalle(CveCompra) Then
|
||||
If ObjCompra.DtResultados.Rows.Count > 0 Then
|
||||
TmpDT = ObjCompra.DtResultados
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjInventario.GetInv_ComprasMov(CveCompra, UsuarioActual.CveEmpresa) Then
|
||||
If ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||
tbmovs = ObjInventario.DtResultados
|
||||
End If
|
||||
End If
|
||||
|
||||
If DdlMoneda.SelectedValue.ToEntero > 1 Then
|
||||
TipoCambioGuardar = If(DivTC.Visible, TxtTC.Text.ToDecimal, LblTC.Text.Substring(3).ToDecimal)
|
||||
End If
|
||||
TipoCambio = If(DivTC.Visible, TipoCambioGuardar, TipoCambio)
|
||||
|
||||
For Each dtMovs As DataRow In TmpDT.Rows
|
||||
If TmpDT.Rows.Count > 0 Then
|
||||
tcvealmacen = dtMovs("AlmacenRegistrado").ToString.ToEntero
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
folio = ObjInventario.GetFolioSiguiente(13, UsuarioActual.CveEmpresa)
|
||||
cvemovimientoentrada = ObjInventario.AddMovimiento(tcvealmacen, 13, 1, fecha, folio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, TipoCambio:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, TipoCambioGuardar), Modulo:="Devolucion Automatica")
|
||||
If cvemovimientoentrada <= 0 Then
|
||||
ErrorMovInv = True
|
||||
Else
|
||||
For Each dr As DataRow In tbmovs.Rows
|
||||
If dr("cvealmacen").ToString.ToEntero = tcvealmacen And dr("CveCompraDetalle").ToString.ToEntero <> -1 And dr("origen").ToString.ToEntero <> -1 And dr("Total").ToString.ToDecimal <> 0 Then
|
||||
'hay que restarle descuento
|
||||
importeconcepto = dr("Total").ToString.ToDecimal
|
||||
If Not ObjInventario.AddMovimientoDetalle(cvemovimientoentrada, dr("cantidad").ToString.ToDouble, dr("cveum").ToString.ToEntero, dr("cveps").ToString.ToEntero, importeconcepto, -1, CveCompraDetalle:=dr("CveCompraDetalle").ToString.ToEntero, Serie:=dr("Serie").ToString) Then
|
||||
ErrorMovInv = True
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
If ErrorMovInv = True Then
|
||||
ObjInventario.RollBack()
|
||||
End If
|
||||
ObjInventario.Dispose()
|
||||
ObjCompra.Dispose()
|
||||
End If
|
||||
|
||||
Dim ObjAC As ClsContPAQi = Nothing
|
||||
If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then
|
||||
ObjAC = New ClsContPAQi(UsuarioActual.Empresa)
|
||||
@@ -14805,7 +14875,7 @@ Partial Class Compras_Compras
|
||||
|
||||
|
||||
' MES ANTERIOR, MOVIMIENTOS CONTRARIOS (NEGATIVOS)
|
||||
If TxtFecha.Text.ToDate.Month < TxtFechaCancelacion.Text.ToDate.Month Or TxtFecha.Text.ToDate.Year < TxtFechaCancelacion.Text.ToDate.Year Or DdlTipoComprobante.SelectedValue.Contiene("NC") Then
|
||||
If True Then
|
||||
|
||||
'CREA POLIZA NEGATIVA
|
||||
If IdPoliza > 0 AndAlso ObjAC IsNot Nothing AndAlso UsuarioActual.Empresa.UsaAC Then
|
||||
@@ -14960,6 +15030,8 @@ Partial Class Compras_Compras
|
||||
ObjAC.Dispose()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub btnProrateo_Click(sender As Object, e As EventArgs) Handles btnProrateo.Click, btnProrateo2.Click
|
||||
|
||||
@@ -131,7 +131,15 @@
|
||||
<asp:GridView ID="GvT" runat="server" EmptyDataText="No se encontraron datos con los filtros seleccionados" OnRowDataBound="GvIVATrasladado_RowDataBound" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="99%" GridLines="None" AutoGenerateColumns="false">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Docto" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Fecha Documento" DataField="FechaDocumento" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
|
||||
|
||||
<asp:TemplateField HeaderText="Fecha Documento">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblFechaDocumento" runat="server" Text='<%# Eval("FechaDocumento", "{0:d}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:HyperLinkField DataTextField="SerieFolio" DataNavigateUrlFields="CveVenta" Target="_blank" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" HeaderText="Folio" ControlStyle-Width="85px" />
|
||||
<asp:BoundField HeaderText="SubTotal" DataField="SubTotal" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="IVA" DataField="IVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
@@ -141,9 +149,16 @@
|
||||
<asp:BoundField HeaderText="RetIVA Serv" DataField="RetIVAServicios" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="RetISR" DataField="RetISR" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="F.Venta" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Folio Fiscal" DataField="FolioFiscal" />
|
||||
|
||||
|
||||
<asp:TemplateField HeaderText="Fecha">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:BoundField HeaderText="Folio Fiscal" DataField="FolioFiscal" />
|
||||
<asp:HyperLinkField HeaderText="Cliente" DataNavigateUrlFields="CveCliente" DataNavigateUrlFormatString="/Ventas/Clientes.aspx?CveCliente={0}" DataTextField="Nombre" ControlStyle-CssClass="truncate2" />
|
||||
<asp:HyperLinkField HeaderText="Folio Bancario" DataNavigateUrlFields="CveIE" DataNavigateUrlFormatString="/Bancos/IE.aspx?CveIE={0}" DataTextField="FolioIE" Target="_blank" />
|
||||
|
||||
|
||||
@@ -133,6 +133,8 @@ public partial class Contabilidad_RepIVA : ClsPaginas
|
||||
if (e.Row.DBCampo("CveVenta").ToEntero() < 1)
|
||||
{
|
||||
e.Row.CssClass = "Totales";
|
||||
e.Row.FCLabel("LblFechaDocumento").Visible = false;
|
||||
e.Row.FCLabel("LblFecha").Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -144,6 +146,8 @@ public partial class Contabilidad_RepIVA : ClsPaginas
|
||||
if (e.Row.DBCampo("CveCompra").ToEntero() < 1)
|
||||
{
|
||||
e.Row.CssClass = "Totales";
|
||||
|
||||
|
||||
}
|
||||
if (e.Row.DBCampo("PorcentajeIVA").ToDecimal() > 0)
|
||||
{
|
||||
@@ -213,11 +217,14 @@ public partial class Contabilidad_RepIVA : ClsPaginas
|
||||
{
|
||||
para.Add(new CrystalParametro("LogoPath", ""));
|
||||
}
|
||||
|
||||
GvT.DataSource = DtIVATrasladado;
|
||||
GvT.DataBind();
|
||||
UpDatos.Update();
|
||||
DataTable Dt = TT.ActiveTabIndex == 0 ? DtIVATrasladado.Copy() : DtIVAAcreditable.Copy();
|
||||
string Formato = TT.ActiveTabIndex == 0 ? "RepIVA.rpt" : (Opcion == "EXCEL2" ? "RepIVAAcreditable2.rpt" : "RepIVAAcreditable.rpt");
|
||||
Opcion = (Opcion == "EXCEL2" ? "EXCEL" : Opcion);
|
||||
para.Add(new CrystalParametro("Excel", Formato));
|
||||
para.Add(new CrystalParametro("Formato", Opcion));
|
||||
System.IO.FileInfo Archivo = new System.IO.FileInfo(string.Format("{0}/Formatos/{1}", UsuarioActual.Empresa.Ruta, Formato));
|
||||
string Ruta;// = (Archivo.Exists ? string.Format("{0}/{1}", UsuarioActual.Empresa.Ruta, Formato ): ModExtensiones.DirectorioBaseEmpresas + $@"Empresas\Grales\Formatos\{Formato}");
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -870,7 +870,7 @@ public partial class General_PopUpPaqueteriasGuias : ClsPaginas
|
||||
{
|
||||
DataRow VentasDetalle = ObjVenta.DtResultados.Rows[0];
|
||||
double Total = VentasDetalle["Total"].ToString().ToDouble();
|
||||
bool Mostrar = (Total >= 100000.00);
|
||||
bool Mostrar = (Total >= 50000.00);
|
||||
tdLblPolizaSeguro.Visible = Mostrar;
|
||||
tdTxtPolizaSeguro.Visible = Mostrar;
|
||||
}
|
||||
|
||||
@@ -1398,7 +1398,7 @@ Partial Class General_SaldosIniciales
|
||||
|
||||
|
||||
'If Not CveCliente > 0 Then Alert(String.Format("No se encontró el cliente con el RFC: {0}", {RFC}), TipoMensaje.MsgError) : ErrorVentas = True : RFC.GuardaLog : Exit For
|
||||
TipoDocto = IIf(TipoDocto = "INGRESO", "Ing", IIf(TipoDocto = "EGRESO", "Egs", "Rem")).ToString
|
||||
TipoDocto = IIf(TipoDocto.Contiene("INGRESO", "INGRESOS"), "Ing", IIf(TipoDocto = "EGRESO", "Egs", "Rem")).ToString
|
||||
'PrePóliza
|
||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Venta/SaldoInicial", 1, Total, Total, 1, Fecha, String.Format("{0}-{1}", Serie, Folio), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
@@ -1410,9 +1410,9 @@ Partial Class General_SaldosIniciales
|
||||
End If
|
||||
|
||||
'Moneda
|
||||
If Moneda = "Pesos" Then
|
||||
If Moneda.ToUpper.Contiene("PESOS", "PESO", "MN") Then
|
||||
CveMoneda = 1
|
||||
ElseIf Moneda = "Dólares" Then
|
||||
ElseIf Moneda.ToUpper.Contiene("DÓLARES", "DOLARES", "USD") Then
|
||||
CveMoneda = 2
|
||||
End If
|
||||
|
||||
|
||||
@@ -1057,9 +1057,9 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Dim AplicaCaducidad = False
|
||||
If GlobalDTPS(UsuarioActual.CveEmpresa, ).FiltraParametros("").Rows(0) IsNot Nothing Then
|
||||
AplicaCaducidad = If(GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerie).FiltraParametros("").Rows(0)("AplicaCaducidad").ToString() = "True", True, False)
|
||||
End If
|
||||
|
||||
GvSerie.Columns(1).HeaderText = If(UsuarioActual.Empresa.Funcionalidad(147) = "Fecha Elaboración", "Fecha Elaboración", "Fecha Caducidad")
|
||||
End If
|
||||
|
||||
GvSerie.Columns(1).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
|
||||
|
||||
If AplicaCaducidad Then
|
||||
GvSerie.Columns(1).Visible = True
|
||||
@@ -1266,7 +1266,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Private Sub CargaLote(Optional CerrarCompletado As Boolean = False)
|
||||
|
||||
RegistraScript("$('#DivLote').modal('show')")
|
||||
GvLote.Columns(2).HeaderText = If(UsuarioActual.Empresa.Funcionalidad(147) = "Fecha Elaboración", "Fecha Elaboración", "Fecha Caducidad")
|
||||
GvLote.Columns(2).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
|
||||
GvLote.DataSource = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerie), "Consec DESC")
|
||||
GvLote.DataBind()
|
||||
|
||||
@@ -2884,7 +2884,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Dim CveCliente As Integer = ObjVentas.DtResultados(0)("CveCliente").ToString().ToEntero()
|
||||
Dim ClienteNombre As String = ObjVentas.DtResultados(0)("ClienteNombre").ToString()
|
||||
Dim Serie As String = ObjVentas.DtResultados(0)("SerieFolio").ToString()
|
||||
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL()
|
||||
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD()
|
||||
Dim TotalCostoAcumulado As Decimal = 0
|
||||
Dim cont As Integer = 1
|
||||
|
||||
@@ -2898,13 +2898,13 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
ValorMultiplicador = -1
|
||||
End If
|
||||
|
||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/RecepcionEntrega", 4, TotalCosto, TotalCosto, 1, Fecha, ClienteNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/EntregaAlmacen", 4, TotalCosto, TotalCosto, 1, Fecha, ClienteNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
'Se agrega movimiento separado por la cuenta de ventas (ER)
|
||||
|
||||
If CvePrePoliza > 0 Then
|
||||
|
||||
For Each RowInv As DataRow In tmpCostos.Rows
|
||||
ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundSQL()
|
||||
ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundAD()
|
||||
TotalCostoAcumulado += ValorInventario
|
||||
|
||||
'cuando es el último movimiento y hay diferencias en los importes
|
||||
|
||||
@@ -1871,7 +1871,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
End Sub
|
||||
Private Sub CargaLote(Tipo As Integer, Optional CerrarCompletado As Boolean = False)
|
||||
RegistraScript("$('#DivLote').modal();", "ModalLote")
|
||||
GvLote.Columns(2).HeaderText = If(UsuarioActual.Empresa.Funcionalidad(147) = "Fecha Elaboración", "Fecha Elaboración", "Fecha Caducidad")
|
||||
GvLote.Columns(2).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
|
||||
GvLote.DataSource = DtDatosLoteDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerie), "Consec DESC")
|
||||
GvLote.DataBind()
|
||||
|
||||
@@ -3520,9 +3520,9 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
If CveMovimiento > 0 AndAlso CveMovimientoSalidaTraspaso <= 0 Then
|
||||
Msg.AppendFormat("Movimiento Registrado: Folio: <b>{0}</b>", link)
|
||||
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimiento)))
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
If UsuarioActual.CveEmpresa.Contiene(1, 119) Then
|
||||
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Etiqueta Individual</a> ", Encripta(String.Format("OP=Etiqueta&CveMovimiento={0}&Modalidad={1}", CveMovimiento, "Individual")))
|
||||
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Etiqueta Por Caja</a> ", Encripta(String.Format("OP=Etiqueta&CveMovimiento={0}&Modalidad={1}", CveMovimiento, "Caja")))
|
||||
'Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Etiqueta Por Caja</a> ", Encripta(String.Format("OP=Etiqueta&CveMovimiento={0}&Modalidad={1}", CveMovimiento, "Caja")))
|
||||
|
||||
End If
|
||||
'SI GENERO UN TRASPASO AL ALMACEN DE DEVOLUCION
|
||||
@@ -4714,8 +4714,8 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
|
||||
End Class
|
||||
|
||||
Public Class MMovimientoAlmacen
|
||||
Public Property CveMovimiento As Integer
|
||||
Public Property Folio As Integer
|
||||
'Public Class MMovimientoAlmacen
|
||||
' Public Property CveMovimiento As Integer
|
||||
' Public Property Folio As Integer
|
||||
|
||||
End Class
|
||||
'End Class
|
||||
|
||||
101
LogIn.aspx.vb
101
LogIn.aspx.vb
@@ -199,71 +199,74 @@ Partial Class LogIn
|
||||
'Dim UsuarioAsignaciones As Usuario = Nothing
|
||||
|
||||
Dim isgps = Request.Url.Host.ToUpper().Contains("SIGNALSGPS".ToUpper())
|
||||
Usuario = ObjUsuario.ValidaUsuario(txtUsuario.Text, Encripta(TxtContraseña.Text.Trim), IMEI, CvePlataforma:=If(isgps, 3, 1))
|
||||
Usuario = ObjUsuario.ValidaUsuario(txtUsuario.Text, Encripta(TxtContraseña.Text.Trim), IMEI, CvePlataforma:=If(isgps, 3, -1))
|
||||
'UsuarioAsignaciones = ObjUsuario.ValidaUsuarioAsignacion(Usuario.CveUsuario, Usuario.CveEmpresa)
|
||||
If Not isgps AndAlso Usuario IsNot Nothing AndAlso Usuario.CvePlataforma = 3 Then ' SI ES de la plataforma 3(GPS), no debe de entar por liga normal
|
||||
Usuario = Nothing
|
||||
End If
|
||||
|
||||
ADSSessionConfig.sessionUser = Usuario
|
||||
ADSSessionConfig.sessionDpage = False
|
||||
ObjUsuario.Dispose()
|
||||
If Usuario IsNot Nothing Then
|
||||
If Not Usuario.AutorizadoxIP OrElse (HddAdsCodex.Text.Length > 0 AndAlso Usuario.CodigoAutorizado = HddAdsCodex.Text) Then
|
||||
ADSSessionConfig.sessionDpage = False
|
||||
ObjUsuario.Dispose()
|
||||
If Usuario IsNot Nothing Then
|
||||
If Not Usuario.AutorizadoxIP OrElse (HddAdsCodex.Text.Length > 0 AndAlso Usuario.CodigoAutorizado = HddAdsCodex.Text) Then
|
||||
|
||||
CreaObjetoEmpresa(Usuario)
|
||||
ADSSessionConfig.sessionUser.MultipleEmpresa = True
|
||||
CreaObjetoEmpresa(Usuario)
|
||||
ADSSessionConfig.sessionUser.MultipleEmpresa = True
|
||||
|
||||
Dim x As New ADSSessionObj(Usuario.CveUsuario, Usuario.CveEmpresa)
|
||||
Dim _sessionid = Encripta(String.Format("{0}|{1}", Usuario.CveUsuario, x.SessionID))
|
||||
x = ADSSessionConfig.SessionManager(OpcionSession.agregarSession, x)
|
||||
Dim x As New ADSSessionObj(Usuario.CveUsuario, Usuario.CveEmpresa)
|
||||
Dim _sessionid = Encripta(String.Format("{0}|{1}", Usuario.CveUsuario, x.SessionID))
|
||||
x = ADSSessionConfig.SessionManager(OpcionSession.agregarSession, x)
|
||||
|
||||
If Usuario.CvePlataforma = 6 And Usuario.CveRol = 10 Then
|
||||
'PLATAFORMA PORTAL CLIENTE
|
||||
'FormsAuthentication.RedirectFromLoginPage(_sessionid, False)
|
||||
'Response.Redirect("/PortalCliente/PortalCliente.aspx", True)
|
||||
If Usuario.CvePlataforma = 6 And Usuario.CveRol = 10 Then
|
||||
'PLATAFORMA PORTAL CLIENTE
|
||||
'FormsAuthentication.RedirectFromLoginPage(_sessionid, False)
|
||||
'Response.Redirect("/PortalCliente/PortalCliente.aspx", True)
|
||||
|
||||
ReturnUrl = "/PortalCliente/PortalCliente.aspx"
|
||||
ElseIf Usuario.CvePlataforma = 7 And Usuario.CveRol = 11 Then
|
||||
'PLATAFORMA PORTAL PROVEEDOR
|
||||
'FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario), False)
|
||||
'Response.Redirect("/PortalProveedor/PortalProveedor.aspx", True)
|
||||
ReturnUrl = "/PortalCliente/PortalCliente.aspx"
|
||||
ElseIf Usuario.CvePlataforma = 7 And Usuario.CveRol = 11 Then
|
||||
'PLATAFORMA PORTAL PROVEEDOR
|
||||
'FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario), False)
|
||||
'Response.Redirect("/PortalProveedor/PortalProveedor.aspx", True)
|
||||
|
||||
ReturnUrl = "/PortalProveedor/PortalProveedor.aspx"
|
||||
ElseIf Usuario.CveRol = 1200 And Usuario.Acceso > 0 Then
|
||||
'PLATAFORMA GPS
|
||||
Usuario.CvePlataforma = 3
|
||||
'FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario), False)
|
||||
'Response.Redirect("/PortalGPS/InicioGPS.aspx", True)
|
||||
ReturnUrl = "/PortalGPS/InicioGPS.aspx"
|
||||
Else
|
||||
'PLATAFORMA SIG
|
||||
CType(Session("UsuarioSIG"), Usuario).CvePlataforma = 1
|
||||
Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
|
||||
If dt IsNot Nothing Then
|
||||
If dt.Rows.Count >= 1 Then
|
||||
If dt.Rows.Count > 1 Then
|
||||
Usuario.MultipleEmpresa = True
|
||||
ReturnUrl = "/PortalProveedor/PortalProveedor.aspx"
|
||||
ElseIf Usuario.CveRol = 1200 And Usuario.Acceso > 0 Then
|
||||
'PLATAFORMA GPS
|
||||
Usuario.CvePlataforma = 3
|
||||
'FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario), False)
|
||||
'Response.Redirect("/PortalGPS/InicioGPS.aspx", True)
|
||||
ReturnUrl = "/PortalGPS/InicioGPS.aspx"
|
||||
Else
|
||||
'PLATAFORMA SIG
|
||||
CType(Session("UsuarioSIG"), Usuario).CvePlataforma = 1
|
||||
Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
|
||||
If dt IsNot Nothing Then
|
||||
If dt.Rows.Count >= 1 Then
|
||||
If dt.Rows.Count > 1 Then
|
||||
Usuario.MultipleEmpresa = True
|
||||
End If
|
||||
'FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario), False)
|
||||
End If
|
||||
'FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario), False)
|
||||
End If
|
||||
dt.Dispose()
|
||||
End If
|
||||
dt.Dispose()
|
||||
|
||||
Dim cookie = FormsAuthentication.GetAuthCookie(Usuario.CveUsuario, False)
|
||||
Response.Cookies.Add(cookie)
|
||||
RegistraScript(String.Format("opennewlocation('{0}','{1}')", ReturnUrl, ""))
|
||||
'Response.Redirect(ReturnUrl, True)
|
||||
Else
|
||||
Alert("El usuario no esta autorizado en este equipo, favor de contactar al administrador de usuarios.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
'If Usuario.Acceso > 0 Then
|
||||
|
||||
Dim cookie = FormsAuthentication.GetAuthCookie(Usuario.CveUsuario, False)
|
||||
Response.Cookies.Add(cookie)
|
||||
RegistraScript(String.Format("opennewlocation('{0}','{1}')", ReturnUrl, ""))
|
||||
'Response.Redirect(ReturnUrl, True)
|
||||
'Else
|
||||
' Alert("Usuario con acceso limitado.", TipoMensaje.MsgAdvertencia)
|
||||
'End If
|
||||
Else
|
||||
Alert("El usuario no esta autorizado en este equipo, favor de contactar al administrador de usuarios.", TipoMensaje.MsgAdvertencia)
|
||||
Alert("Usuario y/o Contraseña incorrectos.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
'If Usuario.Acceso > 0 Then
|
||||
|
||||
'Else
|
||||
' Alert("Usuario con acceso limitado.", TipoMensaje.MsgAdvertencia)
|
||||
'End If
|
||||
Else
|
||||
Alert("Usuario y/o Contraseña incorrectos.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<div style="">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="CveSubProyecto,SubProyecto,IdSegNeg,Estatus,Serie,IVA,Calle,NoExt,NoInt,Colonia,Localidad,Municipio,Estado,Pais,CP,CveProyecto,TipoSucursal,EsSucursal,
|
||||
CvePais,CveEstado,CveMunicipio,CveColonia,AplicaComercioExterior,CvePrecioLista,Correo,Telefono,UTCOffsetVerano,UTCOffsetInvierno"
|
||||
CvePais,CveEstado,CveMunicipio,CveColonia,AplicaComercioExterior,CvePrecioLista,Correo,Telefono,UTCOffsetVerano,UTCOffsetInvierno,NoVerificaAlmacen"
|
||||
EmptyDataText="No se encontraron SubProyectos" ShowHeader="true" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="SubProyecto" HeaderText="Centro de costo" />
|
||||
@@ -173,10 +173,21 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:CheckBox ID="ChkAplicaComercioExterior" AutoPostBack="true" OnCheckedChanged="ChkAplicaComercioExterior_CheckedChanged" runat="server" CssClass="form-control" Checked="false" />
|
||||
<label for="<%= ChkAplicaComercioExterior.ClientID.ToString()%>">¿Aplica Comercio Exterior?</label>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:CheckBox ID="ChkAplicaComercioExterior" AutoPostBack="true" OnCheckedChanged="ChkAplicaComercioExterior_CheckedChanged" runat="server" CssClass="form-control" Checked="false" />
|
||||
<label for="<%= ChkAplicaComercioExterior.ClientID.ToString()%>">¿Aplica Comercio Exterior?</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:CheckBox ID="ChkNoVerificaAlmacen" runat="server" CssClass="form-control" />
|
||||
<label for="<%= ChkNoVerificaAlmacen.ClientID.ToString()%>">¿No verifica almacén?</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
|
||||
@@ -296,6 +296,7 @@ Partial Class CatSubProyectos
|
||||
CargaColonia()
|
||||
DdlColonia.SelectedValueExist(GvRow.DataKey("CveColonia"))
|
||||
AplicaComercio()
|
||||
ChkNoVerificaAlmacen.Checked = If(GvRow.DataKey("NoVerificaAlmacen").ToString = "True", True, False)
|
||||
|
||||
BtnGuardar.Text = "Actualizar"
|
||||
CargaRequired()
|
||||
@@ -365,7 +366,7 @@ Partial Class CatSubProyectos
|
||||
If Not ObjSubproyectos.AddCentroCosto(TxtCentroCosto.Text.Trim, IdSeg, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero, Serie:=TxtSerie.Text.Trim, IVA:=TxtIVA.Text.ToDecimal, Calle:=TxtCalle.Text.Trim, NoExt:=TxtNoExt.Text.Trim,
|
||||
NoInt:=TxtNoInt.Text.Trim, Colonia:=TxtColonia.Text.Trim, Localidad:=TxtLocalidad.Text.Trim, Municipio:=TxtMunicipio.Text.Trim, Estado:=TxtEstado.Text.Trim, Pais:=TxtPais.Text.Trim, CP:=TxtCP.Text.Trim, TipoSucursal:=TipoSucursal, EsSucursal:=EsSucursal,
|
||||
CvePais:=DdlPais.SelectedValue.ToEntero, CveEstado:=DdlEstado.SelectedValue.ToEntero, CveMunicipio:=DdlMunicipio.SelectedValue.ToEntero, CveColonia:=DdlColonia.SelectedValue.ToEntero, AplicaComercioExterior:=ChkAplicaComercioExterior.Checked, Correo:=TxtCorreo.Text, CvePrecioLista:=DdlPrecioLista.SelectedValue.ToEntero,
|
||||
Telefono:=TxtTelefono.Text) Then
|
||||
Telefono:=TxtTelefono.Text, NoVerificaAlmacen:=ChkNoVerificaAlmacen.Checked) Then
|
||||
TieneError = True
|
||||
Else
|
||||
CveSubProyecto = ObjSubproyectos.CveSubProyecto
|
||||
@@ -375,7 +376,7 @@ Partial Class CatSubProyectos
|
||||
If Not ObjSubproyectos.UpdateCentroCosto(CveCentroCosto, TxtCentroCosto.Text.Trim, IdSeg, If(ChkEstatus.Checked = True, 1, 0), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero, Serie:=TxtSerie.Text.Trim, IVA:=TxtIVA.Text.ToDecimal, Calle:=TxtCalle.Text.Trim, NoExt:=TxtNoExt.Text.Trim,
|
||||
NoInt:=TxtNoInt.Text.Trim, Colonia:=TxtColonia.Text.Trim, Localidad:=TxtLocalidad.Text.Trim, Municipio:=TxtMunicipio.Text.Trim, Estado:=TxtEstado.Text.Trim, Pais:=TxtPais.Text.Trim, CP:=TxtCP.Text.Trim, TipoSucursal:=TipoSucursal, EsSucursal:=EsSucursal,
|
||||
CvePais:=DdlPais.SelectedValue.ToEntero, CveEstado:=DdlEstado.SelectedValue.ToEntero, CveMunicipio:=DdlMunicipio.SelectedValue.ToEntero, CveColonia:=DdlColonia.SelectedValue.ToEntero, AplicaComercioExterior:=ChkAplicaComercioExterior.Checked, Correo:=TxtCorreo.Text, CvePrecioLista:=DdlPrecioLista.SelectedValue.ToEntero,
|
||||
Telefono:=TxtTelefono.Text, HorarioVerano:=TxtHorarioVerano.Text.ToEntero, HorarioInvierno:=TxtHorarioInvierno.Text.ToEntero) Then
|
||||
Telefono:=TxtTelefono.Text, HorarioVerano:=TxtHorarioVerano.Text.ToEntero, HorarioInvierno:=TxtHorarioInvierno.Text.ToEntero, NoVerificaAlmacen:=ChkNoVerificaAlmacen.Checked) Then
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
|
||||
@@ -833,7 +833,7 @@
|
||||
|
||||
<asp:UpdatePanel ID="UpUniformesResguardo" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvUniformesResguardo" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" DataKeyNames="CveAlmacen,CodigoPS,PU,CveUM,CveMovimiento,CveMovimientoDetalle,CvePS,AplicaSeccion,AplicaSerie,CveSeccionAlmacen,Cantidad" ToolTip=""
|
||||
<asp:GridView ID="GvUniformesResguardo" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" DataKeyNames="CveAlmacen,CodigoPS,PU,CveUM,CveMovimiento,CveMovimientoDetalle,CvePS,AplicaSeccion,AplicaSerie,CveSeccionAlmacen,Cantidad,Serie" ToolTip=""
|
||||
CssClass="table table-hover table-advance Widthall" GridLines="None">
|
||||
<Columns>
|
||||
<asp:HyperLinkField DataNavigateUrlFields="CveMovimiento" Target="_blank" HeaderText="Folio" DataNavigateUrlFormatString="../Inventarios/EntradasSalidas.aspx?CveMovimiento={0}" DataTextField="Folio" />
|
||||
@@ -1302,7 +1302,7 @@
|
||||
<asp:Label runat="server" AssociatedControlID="DDlTipoSalario" Text="Tipo Salario:"></asp:Label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlRegimenContratacion" Width="100%" runat="server" AppendDataBoundItems="true" DataTextField="RegimenContratacion" CssClass="form-control input-sm select2me" DataValueField="CveSATRegimenContratacion" ValidationGroup="GrpGuardar">
|
||||
<asp:DropDownList ID="DdlRegimenContratacion" Width="100%" runat="server" AppendDataBoundItems="true" DataTextField="ClaveRegimenContratacion" CssClass="form-control input-sm select2me" DataValueField="CveSATRegimenContratacion" ValidationGroup="GrpGuardar">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:Label runat="server" AssociatedControlID="DdlRegimenContratacion" Text="Régimen Contratación:"></asp:Label>
|
||||
@@ -1311,7 +1311,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlRiesgoPuesto" runat="server" Width="100%" AppendDataBoundItems="true" DataTextField="RiesgoPuesto" CssClass="form-control input-sm select2me" DataValueField="CveSATRiesgoPuesto" ValidationGroup="GrpGuardar">
|
||||
<asp:DropDownList ID="DdlRiesgoPuesto" runat="server" Width="100%" AppendDataBoundItems="true" DataTextField="ClaveRiesgoPuesto" CssClass="form-control input-sm select2me" DataValueField="CveSATRiesgoPuesto" ValidationGroup="GrpGuardar">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:Label runat="server" AssociatedControlID="DdlRiesgoPuesto" Text="Riesgo Puesto:"></asp:Label>
|
||||
|
||||
@@ -5183,6 +5183,10 @@ Partial Class RH_Personal
|
||||
|
||||
If row.DataKey("AplicaSerie").ToString = "True" Then
|
||||
divSerie.Visible = True
|
||||
TxtLiberarSerie.Text = row.DataKey("Serie")
|
||||
TxtLiberarSerie.Enabled = False
|
||||
TxtCantidadResguardo.Enabled = False
|
||||
TxtCantidadResguardo.Text = "1"
|
||||
End If
|
||||
|
||||
|
||||
|
||||
@@ -533,6 +533,7 @@ Partial Class Sistemas_CatSesiones
|
||||
End If
|
||||
End If
|
||||
ObjGral.Dispose()
|
||||
Application("TipoCambioActual") = Nothing
|
||||
End Sub
|
||||
|
||||
Private Sub CargarEquivalencias()
|
||||
|
||||
@@ -119,9 +119,7 @@ Partial Class Ventas_ClientesClasificaciones
|
||||
|
||||
|
||||
Private Sub CargaGlobal()
|
||||
Dim ObjClientes As New ClsClientes
|
||||
If ObjClientes.GetClienteClasificacion(-1) Then Application("GlobalDTClienteClasificaciones") = ObjClientes.DtResultados Else Application("GlobalDTClienteClasificaciones") = Nothing
|
||||
ObjClientes.Dispose()
|
||||
GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa) = Nothing
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
@@ -1,171 +1,261 @@
|
||||
<%@ Page Title="Catálogo de metas para vendedores" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatMetasVendedores.aspx.vb" Inherits="CatMetasVendedores" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de metas para vendedores
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel runat="server" ID="UpAgregar">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkAgregar" runat="server"> Agregar Meta</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveMeta,CveVendedor,CveMarca,CveClasificacion,CveClasificacionSup,Vendedor,MesAño,Marca,Clasificacion,MetaCantidad,MetaImporte" EmptyDataText="No se encontraron metas registradas" ToolTip="Listado de Metas Vendedor" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;width:100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText ="Vendedor" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlVendedor" runat="server" Text='<%# Eval("Vendedor", " {0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtVendedor" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Vendedor") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVVendedor" runat="server" ControlToValidate="TxtVendedor" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Vendedor''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCVendedor" runat="server" HighlightCssClass="vco" TargetControlID="RFVVendedor" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText ="Clasificación superior">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlClasificacionSup" runat="server" Text='<%# Eval("ClasificacionSup", " {0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtClasificacionSup" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("ClasificacionSup") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVClasificacionSup" runat="server" ControlToValidate="TxtClasificacionSup" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificacion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCClasificacionSup" runat="server" HighlightCssClass="vco" TargetControlID="RFVClasificacionSup" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText ="Clasificacion">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlClasificacion" runat="server" Text='<%# Eval("Clasificacion", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtClasificacion" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Clasificacion") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVClasificacion" runat="server" ControlToValidate="TxtClasificacion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificacion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCClasificacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVClasificacion" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText ="Marca" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlMarca" runat="server" Text='<%# Eval("Marca", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtMarca" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Marca") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVMarca" runat="server" ControlToValidate="TxtMarca" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Marca''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCMarca" runat="server" HighlightCssClass="vco" TargetControlID="RFVMarca" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText ="MesAño">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlMesAño" runat="server" Text='<%# Eval("MesAño", "{0:mm/yyyy}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtMesAño" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("MesAño") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVMesAño" runat="server" ControlToValidate="TxtMesAño" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''MesAño''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCMesAño" runat="server" HighlightCssClass="vco" TargetControlID="RFVMesAño" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText ="Meta Cantidad">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlMetaCantidad" runat="server" Text='<%# Eval("MetaCantidad", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtMetaCantidad" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("MetaCantidad") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVMetaCantidad" runat="server" ControlToValidate="TxtMetaCantidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''MetaCantidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCMetaCantidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVMetaCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText ="Meta Importe">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlMetaImporte" runat="server" Text='<%# Eval("MetaImporte", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtMetaImporte" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("MetaImporte") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVMetaImporte" runat="server" ControlToValidate="TxtMetaImporte" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''MetaImporte''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCMetaImporte" runat="server" HighlightCssClass="vco" TargetControlID="RFVMetaImporte" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Comandos">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-xs green" OnClick="GvDatos_RowEditing" Text="<i class='fa fa-pencil'></i>" />
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" OnClick="Delete_Click" CausesValidation="False" CssClass="btn btn-circle btn-xs red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="DivAgregarTiposD" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 450px;">
|
||||
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalTiposD" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="LtlTituloModalTiposD" runat="server">Metas Vendedores</asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="DdlVendedores">Vendedor:</label>
|
||||
<asp:DropDownList ID="DdlVendedores" runat="server" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="MotivoTxt">Mes y Año:</label>
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 95px !important; padding: 0px;">
|
||||
<asp:TextBox Style="width: 110px !important;" ID="TxtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="ImgFechaI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFechaI" TargetControlID="TxtFechaI" PopupButtonID="ImgFechaI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="DdlMarcas">Clasificacion Superior:</label>
|
||||
<asp:DropDownList ID="DdlClasificacionSup" runat="server" DataTextField="Clasificacion" DataValueField="CveClasificacion" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="DdlMarcas">Clasificacion:</label>
|
||||
<asp:DropDownList ID="DdlClasificacion" runat="server" DataTextField="Clasificacion" DataValueField="CveClasificacion" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="DdlMarcas">Marca:</label>
|
||||
<asp:DropDownList ID="DdlMarcas" runat="server" DataTextField="Marca" DataValueField="CveMarca" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtMetaCantidad" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RfvTxtTiposD" runat="server" ControlToValidate="TxtMetaCantidad" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad meta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<label for="MotivoTxt">Cantidad meta:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtMetaImporte" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RfvTxtMetaImporte" runat="server" ControlToValidate="TxtMetaImporte" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe meta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<label for="MotivoTxt">Importe meta:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnAgregarMetaVendedor" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpTiposD" />
|
||||
<button id="Button3" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
<%@ Page Title="Catálogo de metas para vendedores" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatMetasVendedores.aspx.vb" Inherits="CatMetasVendedores" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de metas para vendedores
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel runat="server" ID="UpAgregar">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkAgregar" runat="server"> Agregar Meta</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<li>
|
||||
<asp:HyperLink ID="HlAgregarExcel" NavigateUrl="#" Visible="True" data-toggle="modal" data-target="#DivCargaExcel" runat="server"><i class='fa fa-server'></i> Importar Listado</asp:HyperLink>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" OnClick="BtnConsultar_Click" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row">
|
||||
<label class="col-md-1 truncate">Sucursal:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlSubProyecto" runat="server" Width="100%" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 truncate">Mes/Año:</label>
|
||||
<div class="col-md-1" style="min-width: 115px">
|
||||
<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="txtMesAnio" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEMesAnio" runat="server" TargetControlID="txtMesAnio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtMesAnio" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
</div>
|
||||
<label title="Vendedor" data-toggle="tooltip" class="col-md-1 truncate">Vendedor:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlVendedor" runat="server" Width="100%" DataTextField="Vendedor" DataValueField="CveVendedor" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label title="Marca" data-toggle="tooltip" class="col-md-1 truncate">Marca:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlMarca" runat="server" Width="100%" DataTextField="Marca" DataValueField="CveMarca" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none">
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveMeta,CveVendedor,CveMarca,CveClasificacion,CveClasificacionSup,Vendedor,MesAño,Marca,Clasificacion,MetaCantidad,MetaImporte" EmptyDataText="No se encontraron metas registradas" ToolTip="Listado de Metas Vendedor" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center; width: 100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Vendedor" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlVendedor" runat="server" Text='<%# Eval("Vendedor", " {0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtVendedor" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Vendedor") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVVendedor" runat="server" ControlToValidate="TxtVendedor" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Vendedor''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCVendedor" runat="server" HighlightCssClass="vco" TargetControlID="RFVVendedor" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Clasificación superior">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlClasificacionSup" runat="server" Text='<%# Eval("ClasificacionSup", " {0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtClasificacionSup" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("ClasificacionSup") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVClasificacionSup" runat="server" ControlToValidate="TxtClasificacionSup" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificacion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCClasificacionSup" runat="server" HighlightCssClass="vco" TargetControlID="RFVClasificacionSup" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Clasificacion">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlClasificacion" runat="server" Text='<%# Eval("Clasificacion", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtClasificacion" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Clasificacion") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVClasificacion" runat="server" ControlToValidate="TxtClasificacion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificacion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCClasificacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVClasificacion" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Marca" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlMarca" runat="server" Text='<%# Eval("Marca", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtMarca" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Marca") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVMarca" runat="server" ControlToValidate="TxtMarca" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Marca''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCMarca" runat="server" HighlightCssClass="vco" TargetControlID="RFVMarca" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Mes/Año">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlMesAño" runat="server" Text='<%# Eval("MesAño", "{0:MM/yyyy}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtMesAño" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("MesAño") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVMesAño" runat="server" ControlToValidate="TxtMesAño" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''MesAño''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCMesAño" runat="server" HighlightCssClass="vco" TargetControlID="RFVMesAño" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Meta Cantidad">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlMetaCantidad" runat="server" Text='<%# Eval("MetaCantidad", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtMetaCantidad" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("MetaCantidad") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVMetaCantidad" runat="server" ControlToValidate="TxtMetaCantidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''MetaCantidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCMetaCantidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVMetaCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Meta Importe">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlMetaImporte" runat="server" Text='<%# Eval("MetaImporte", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtMetaImporte" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("MetaImporte") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVMetaImporte" runat="server" ControlToValidate="TxtMetaImporte" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''MetaImporte''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCMetaImporte" runat="server" HighlightCssClass="vco" TargetControlID="RFVMetaImporte" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Comandos">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-xs green" OnClick="GvDatos_RowEditing" Text="<i class='fa fa-pencil'></i>" />
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" OnClick="Delete_Click" CausesValidation="False" CssClass="btn btn-circle btn-xs red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="DivAgregarTiposD" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 450px;">
|
||||
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalTiposD" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="LtlTituloModalTiposD" runat="server">Metas Vendedores</asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="DdlVendedores">Vendedor:</label>
|
||||
<asp:DropDownList ID="DdlVendedores" runat="server" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="MotivoTxt">Mes y Año:</label>
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 95px !important; padding: 0px;">
|
||||
<asp:TextBox Style="width: 110px !important;" ID="TxtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="ImgFechaI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFechaI" TargetControlID="TxtFechaI" PopupButtonID="ImgFechaI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="DdlMarcas">Clasificacion Superior:</label>
|
||||
<asp:DropDownList ID="DdlClasificacionSup" runat="server" DataTextField="Clasificacion" DataValueField="CveClasificacion" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="DdlMarcas">Clasificacion:</label>
|
||||
<asp:DropDownList ID="DdlClasificacion" runat="server" DataTextField="Clasificacion" DataValueField="CveClasificacion" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="DdlMarcas">Marca:</label>
|
||||
<asp:DropDownList ID="DdlMarcas" runat="server" DataTextField="Marca" DataValueField="CveMarca" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtMetaCantidad" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RfvTxtTiposD" runat="server" ControlToValidate="TxtMetaCantidad" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad meta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<label for="MotivoTxt">Cantidad meta:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtMetaImporte" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RfvTxtMetaImporte" runat="server" ControlToValidate="TxtMetaImporte" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe meta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<label for="MotivoTxt">Importe meta:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnAgregarMetaVendedor" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpTiposD" />
|
||||
<button id="Button3" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
<%--CARGA EXCEL--%>
|
||||
<div id="DivCargaExcel" class="modal ADS 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">Agregar Excel</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h3>Arraste o haga click para subir el archivo Excel</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-11" style="margin-left: 30px; margin-right: 30px;">
|
||||
<asp:TextBox ID="TxtExcel" CssClass="ADSdropzone hidden" Text="" data-maxFile="1" runat="server"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="row">
|
||||
<div class="col-md-2" style="text-align: left">
|
||||
<asp:UpdatePanel ID="UpDescargar" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnDescargarFormato" runat="server" CssClass="btn btn-warning" Text="Descargar Formato" />
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="BtnDescargarFormato" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="col-md-10" style="text-align: right">
|
||||
<asp:Button ID="BtnCargaExcel" runat="server" CssClass="btn btn-success" Text="Aceptar" ValidationGroup="GrpCargarExcel"></asp:Button>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
Imports GemBox.Spreadsheet
|
||||
|
||||
Partial Class CatMetasVendedores
|
||||
Inherits ClsPaginas
|
||||
Private Property CveMetaVendedor() As Integer 'Guardamos el ID de registro para saber cual registro Editar
|
||||
@@ -14,21 +14,50 @@ Partial Class CatMetasVendedores
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
CargaDatos()
|
||||
If Not IsPostBack Then
|
||||
CargaDatosModal()
|
||||
CargaCombos()
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Private Sub CargaDatos()
|
||||
Dim Mes As Integer = -1, Anio As Integer = -1
|
||||
If Not String.IsNullOrEmpty(txtMesAnio.Text) Then
|
||||
Dim FechaRef As DateTime = txtMesAnio.Text.ToDate()
|
||||
Mes = FechaRef.Month
|
||||
Anio = FechaRef.Year
|
||||
End If
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetMetasVendedores(UsuarioActual.CveEmpresa) Then
|
||||
If ObjVentas.GetMetasVendedores(UsuarioActual.CveEmpresa, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveMarca:=DdlMarca.SelectedValue.ToEntero(), Mes:=Mes, Anio:=Anio) Then
|
||||
GvDatos.DataSource = ObjVentas.DtResultados
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
GvDatos.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCombos()
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa)
|
||||
DdlSubProyecto.DataBind()
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||
|
||||
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
|
||||
DdlVendedor.DataBind()
|
||||
DdlVendedor.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then
|
||||
DdlMarca.DataSource = ObjPS.DtResultados
|
||||
End If
|
||||
ObjPS.Dispose()
|
||||
|
||||
DdlMarca.DataBind()
|
||||
DdlMarca.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatosModal()
|
||||
DdlVendedores.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
|
||||
DdlVendedores.DataBind()
|
||||
@@ -122,5 +151,238 @@ Partial Class CatMetasVendedores
|
||||
ObjVentas.Dispose()
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub BtnDescargarFormato_Click(sender As Object, e As EventArgs) Handles BtnDescargarFormato.Click
|
||||
|
||||
Dim DtExcel As New DataTable
|
||||
DtExcel.TableName = "Metas"
|
||||
DtExcel.Columns.Add(New DataColumn("Vendedor", GetType(String)))
|
||||
DtExcel.Columns.Add(New DataColumn("Clasificación Superior", GetType(String)))
|
||||
DtExcel.Columns.Add(New DataColumn("Clasificación", GetType(String)))
|
||||
DtExcel.Columns.Add(New DataColumn("Marca", GetType(String)))
|
||||
DtExcel.Columns.Add(New DataColumn("Mes", GetType(String)))
|
||||
DtExcel.Columns.Add(New DataColumn("Año", GetType(String)))
|
||||
DtExcel.Columns.Add(New DataColumn("Cantidad", GetType(Decimal)))
|
||||
DtExcel.Columns.Add(New DataColumn("Importe", GetType(Decimal)))
|
||||
|
||||
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||
|
||||
Dim FileExcel As New ExcelFile()
|
||||
|
||||
Dim worksheet = FileExcel.Worksheets.Add(DtExcel.TableName)
|
||||
worksheet.InsertDataTable(DtExcel, New InsertDataTableOptions() With
|
||||
{
|
||||
.ColumnHeaders = True,
|
||||
.StartRow = 0,
|
||||
.StartColumn = 0
|
||||
})
|
||||
worksheet.Rows(0).Style.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(75, 119, 190), SpreadsheetColor.FromArgb(255, 255, 255))
|
||||
worksheet.Rows(0).Style.Font.Color = SpreadsheetColor.FromArgb(255, 255, 255)
|
||||
|
||||
Dim columnCount = worksheet.CalculateMaxUsedColumns()
|
||||
For i = 0 To columnCount
|
||||
worksheet.Columns(i).AutoFit(1, worksheet.Rows(0), worksheet.Rows(worksheet.Rows.Count - 1))
|
||||
Next
|
||||
|
||||
worksheet.Cells.Style.Locked = False
|
||||
worksheet.Cells.Style.FormulaHidden = False
|
||||
|
||||
worksheet.Rows(0).Cells.Style.Locked = True
|
||||
|
||||
worksheet.Protected = True
|
||||
|
||||
Dim protectionSettings = worksheet.ProtectionSettings
|
||||
protectionSettings.AllowDeletingColumns = False
|
||||
protectionSettings.AllowDeletingRows = True
|
||||
protectionSettings.AllowEditingObjects = True
|
||||
protectionSettings.AllowEditingScenarios = True
|
||||
protectionSettings.AllowFormattingCells = True
|
||||
protectionSettings.AllowFormattingColumns = True
|
||||
protectionSettings.AllowFormattingRows = True
|
||||
protectionSettings.AllowInsertingColumns = False
|
||||
protectionSettings.AllowInsertingRows = True
|
||||
protectionSettings.AllowSelectingLockedCells = True
|
||||
protectionSettings.AllowSelectingUnlockedCells = True
|
||||
protectionSettings.AllowSelectingUnlockedCells = True
|
||||
protectionSettings.AllowSorting = True
|
||||
protectionSettings.AllowUsingAutoFilter = True
|
||||
protectionSettings.AllowUsingPivotTableReports = True
|
||||
protectionSettings.SetPassword(ModExtensiones.IMEI)
|
||||
|
||||
FileExcel.Save(Response, "Metas.xlsx", SaveOptions.XlsxDefault)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click
|
||||
If TxtExcel.getfiles().Archivos.Count > 0 Then
|
||||
Dim file As Archivo = TxtExcel.getfiles().Archivos(0)
|
||||
Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch
|
||||
CargarArchivo(Directorio, file.filename)
|
||||
Else
|
||||
Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError)
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargarArchivo(Ruta As String, FileName As String)
|
||||
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||
Dim Tipo As String = "EXCEL"
|
||||
Dim dt As DataTable = Nothing
|
||||
Dim ErrorArchivo = False
|
||||
|
||||
Try
|
||||
dt = ReadExcelFile(Ruta + FileName, True)
|
||||
Catch ex As Exception
|
||||
ErrorArchivo = True
|
||||
OnError("Ocurrio un error al leer el archivo <br/>" & ex.Message, ex)
|
||||
End Try
|
||||
If Not ErrorArchivo AndAlso dt IsNot Nothing Then
|
||||
|
||||
If Not dt.Columns(0).ColumnName = "Vendedor" Then
|
||||
Alert("El nombre de la primera columna debe ser 'Vendedor'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(1).ColumnName = "Clasificación Superior" Then
|
||||
Alert("El nombre de la segunda columna debe ser 'Clasificación Superior'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(2).ColumnName = "Clasificación" Then
|
||||
Alert("El nombre de la tercera columna debe ser 'Clasificación'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(3).ColumnName = "Marca" Then
|
||||
Alert("El nombre de la cuarta columna debe ser 'Marca'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(4).ColumnName = "Mes" Then
|
||||
Alert("El nombre de la quinta columna debe ser 'Marca'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(5).ColumnName = "Año" Then
|
||||
Alert("El nombre de la sexta columna debe ser 'Año'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(6).ColumnName = "Cantidad" Then
|
||||
Alert("El nombre de la sexta columna debe ser 'Cantidad'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(7).ColumnName = "Importe" Then
|
||||
Alert("El nombre de la septima columna debe ser 'Importe'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
Dim DtMarcas As DataTable = Nothing
|
||||
Dim ObjMarcas As New ClsProductosServicios
|
||||
If ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa) Then
|
||||
DtMarcas = ObjMarcas.DtResultados.Copy()
|
||||
End If
|
||||
ObjMarcas.Dispose()
|
||||
|
||||
dt.TableName = "Datos"
|
||||
Dim ProductosNoCargados As New StringBuilder()
|
||||
Dim RowsCargados As Integer = 0
|
||||
Dim RowsNoCargados As Integer = 0
|
||||
Dim ObjMetas As New ClsVentas
|
||||
'ObjPS.IniciaTransacSQL()
|
||||
Try
|
||||
Dim DtVendedores As DataTable = GlobalDTVendedores(UsuarioActual.CveEmpresa)
|
||||
Dim DtClasificaciones As DataTable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
|
||||
Dim DtClasificaciones2 As DataTable = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa)
|
||||
|
||||
For Each row As DataRow In dt.Rows
|
||||
Dim Correcto As Boolean = False
|
||||
Dim TieneError As Boolean = False
|
||||
Dim CveVendedor As Integer = DtVendedores.FiltroPrimeroValor("CveVendedor", String.Format("Vendedor LIKE '%{0}%'", row("Vendedor").ToString().TrimStart().TrimEnd())).ToEntero
|
||||
Dim CveClasificacion As Integer = DtClasificaciones.FiltroPrimeroValor("CveClasificacion", String.Format("Clasificacion='{0}'", row("Clasificación Superior").ToString().TrimStart().TrimEnd())).ToEntero
|
||||
Dim CveClasificacion2 As Integer = DtClasificaciones2.FiltroPrimeroValor("CveClasificacion", String.Format("Clasificacion='{0}'", row("Clasificación").ToString().TrimStart().TrimEnd())).ToEntero
|
||||
Dim CveMarca As Integer = DtMarcas.FiltroPrimeroValor("CveMarca", String.Format("Marca='{0}'", row("Marca").ToString().TrimStart().TrimEnd())).ToEntero
|
||||
|
||||
Dim Mes As Decimal = row("Mes").ToString().ToDecimal()
|
||||
Dim Anio As Decimal = row("Año").ToString().ToDecimal()
|
||||
Dim Cantidad As Decimal = row("Cantidad").ToString().ToDecimal()
|
||||
Dim Importe As Decimal = row("Importe").ToString().ToDecimal()
|
||||
|
||||
Dim FechaRef As New DateTime(Anio, Mes, 1)
|
||||
If CveVendedor > 0 AndAlso CveVendedor > 0 AndAlso CveClasificacion > 0 AndAlso CveClasificacion2 > 0 AndAlso CveMarca > 0 Then
|
||||
Correcto = ObjMetas.AddMetasVendedores(CveVendedor, FechaRef, CveMarca, Cantidad, Importe, CveClasificacion2, CveClasificacion)
|
||||
If Correcto Then
|
||||
RowsCargados += 1
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not Correcto Then
|
||||
RowsNoCargados += 1
|
||||
End If
|
||||
Next
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al cargar los precios.", ex)
|
||||
Finally
|
||||
ObjMarcas.Dispose()
|
||||
|
||||
Dim MensajeFinal As New StringBuilder()
|
||||
If RowsNoCargados = 0 AndAlso RowsCargados > 0 Then
|
||||
MensajeFinal.Append("Las metas se cargaron correctamente. <br/><br/>")
|
||||
End If
|
||||
If RowsCargados > 0 Then
|
||||
MensajeFinal.Append("Se cargaron <b>" & RowsCargados & "</b> metas correctamente.")
|
||||
End If
|
||||
If RowsNoCargados > 0 Then
|
||||
MensajeFinal.Append("No se pudieron actualizar <b>" & RowsNoCargados & "</b> metas. <br/>")
|
||||
End If
|
||||
|
||||
Alert(MensajeFinal.ToString())
|
||||
|
||||
End Try
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable
|
||||
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||
Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath)
|
||||
|
||||
Dim unnamed As Integer = 0
|
||||
Dim cols As Integer
|
||||
Dim columns As String()
|
||||
Dim curRow As Integer = 0
|
||||
Dim curCol As Integer = 0
|
||||
Dim dataTable As DataTable = New DataTable()
|
||||
Dim worksheet As ExcelWorksheet = excelFile.Worksheets(0)
|
||||
|
||||
For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1
|
||||
|
||||
If firstRowHasHeaders Then
|
||||
|
||||
If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then
|
||||
dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString())
|
||||
Else
|
||||
dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed)))
|
||||
End If
|
||||
|
||||
curRow = 1
|
||||
Else
|
||||
dataTable.Columns.Add("Column " & (cols + 1))
|
||||
End If
|
||||
Next
|
||||
|
||||
While curRow < worksheet.Rows.Count
|
||||
columns = New String(cols - 1) {}
|
||||
|
||||
For curCol = 0 To cols - 1
|
||||
|
||||
If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then
|
||||
columns(curCol) = ""
|
||||
Else
|
||||
columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString()
|
||||
End If
|
||||
Next
|
||||
|
||||
dataTable.Rows.Add(columns)
|
||||
curRow += 1
|
||||
End While
|
||||
|
||||
Return dataTable
|
||||
End Function
|
||||
End Class
|
||||
|
||||
@@ -79,24 +79,24 @@ Partial Class MetasVendedores
|
||||
e.Row.FCLabel("lblRealAcumuladoPorcentaje").Text = String.Format("{0}{1}", e.Row.FCLabel("lblRealAcumuladoPorcentaje").Text, "%")
|
||||
'e.Row.FCLabel("lblVarVSAAPerc").Text = String.Format("{0}{1}", e.Row.FCLabel("lblVarVSAAPerc").Text, "%")
|
||||
|
||||
Select Case e.Row.DataKey("Etiqueta")
|
||||
Case "GrupoSuperior"
|
||||
e.Row.CssClass = "GrupoSuperior"
|
||||
' e.Row.FCLabel("lblRealMes").Text = ""
|
||||
' e.Row.FCLabel("lblVtaMesAA").Text = ""
|
||||
' e.Row.FCLabel("lblObjMes").Text = ""
|
||||
' e.Row.FCLabel("lblRealAcumulado").Text = ""
|
||||
' e.Row.FCLabel("lblRealMesPorcentaje").Text = ""
|
||||
' e.Row.FCLabel("lblAAntAcumulado").Text = ""
|
||||
' e.Row.FCLabel("lblObjAcumulado").Text = ""
|
||||
' e.Row.FCLabel("lblVarVSAAPerc").Text = ""
|
||||
' e.Row.FCLabel("lblVarVSAA").Text = ""
|
||||
' e.Row.FCLabel("lblVarVSObjAcum").Text = ""
|
||||
Case "Categoria"
|
||||
Select Case e.Row.DBCampo("TipoFila")
|
||||
Case "1"
|
||||
e.Row.CssClass = "GrupoSuperior"
|
||||
' e.Row.FCLabel("lblRealMes").Text = ""
|
||||
' e.Row.FCLabel("lblVtaMesAA").Text = ""
|
||||
' e.Row.FCLabel("lblObjMes").Text = ""
|
||||
' e.Row.FCLabel("lblRealAcumulado").Text = ""
|
||||
' e.Row.FCLabel("lblRealMesPorcentaje").Text = ""
|
||||
' e.Row.FCLabel("lblAAntAcumulado").Text = ""
|
||||
' e.Row.FCLabel("lblObjAcumulado").Text = ""
|
||||
' e.Row.FCLabel("lblVarVSAAPerc").Text = ""
|
||||
' e.Row.FCLabel("lblVarVSAA").Text = ""
|
||||
' e.Row.FCLabel("lblVarVSObjAcum").Text = ""
|
||||
Case "2"
|
||||
e.Row.CssClass = "Totales"
|
||||
Case "Clasificacion"
|
||||
Case "3"
|
||||
e.Row.CssClass = "SubTotales2"
|
||||
Case "Clasificacion2"
|
||||
Case "4"
|
||||
e.Row.CssClass = "SubTotales"
|
||||
End Select
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 truncate">Fecha Inicio: </div>
|
||||
<div class="col-md-1 truncate">Fecha Aplicado Inicio: </div>
|
||||
<div class="col-md-1">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important;">
|
||||
<asp:TextBox Width="80px" ID="TxtFechaAplicadoI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
@@ -194,7 +194,7 @@
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFAplicadoI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaAplicadoI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFAplicadoI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaAplicadoI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">Fecha Fin: </div>
|
||||
<div class="col-md-1 truncate">Fecha Aplicado Fin: </div>
|
||||
<div class="col-md-1">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important;">
|
||||
<asp:TextBox Width="80px" ID="TxtFechaAplicadoF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
|
||||
@@ -158,11 +158,12 @@ Partial Class Ventas_RepRecuperacion
|
||||
Private Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
Dim Css As String = "Texto"
|
||||
Dim FechaI, FechaF As String
|
||||
Dim FechaI, FechaF, FechaAplicadoI, FechaAplicadoF As String
|
||||
Dim CveClienteSucursal As Integer = -1
|
||||
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1")
|
||||
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
|
||||
|
||||
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
|
||||
FechaAplicadoI = If(IsDate(TxtFechaAplicadoI.Text.Trim()), TxtFechaAplicadoI.Text.Trim(), MinFecha.ToShortDateString.ToString)
|
||||
FechaAplicadoF = If(IsDate(TxtFechaAplicadoF.Text.Trim()), TxtFechaAplicadoF.Text.Trim(), MaxFecha.ToShortDateString.ToString)
|
||||
If e.Row.DBCampo("Orden") = "" Then
|
||||
e.Row.CssClass = "Totales"
|
||||
End If
|
||||
@@ -174,15 +175,15 @@ Partial Class Ventas_RepRecuperacion
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim Liga4 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}&EsDistribuidor={19}",
|
||||
Dim Liga4 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}&EsDistribuidor={19}&FechaAplicadoI={20}&FechaAplicadoF={21}",
|
||||
DdlGrupo.SelectedValue, e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"),
|
||||
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 2, e.Row.DBCampo("EsDistribuidor"))
|
||||
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 2, e.Row.DBCampo("EsDistribuidor"), FechaAplicadoI, FechaAplicadoF)
|
||||
|
||||
e.Row.FCHyperLink("HplPagado").NavigateUrl = Liga4
|
||||
|
||||
Dim Liga5 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}&EsDistribuidor={19}",
|
||||
Dim Liga5 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}&EsDistribuidor={19}&FechaAplicadoI={20}&FechaAplicadoF={21}",
|
||||
DdlGrupo.SelectedValue, e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"),
|
||||
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 1, e.Row.DBCampo("EsDistribuidor"))
|
||||
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 1, e.Row.DBCampo("EsDistribuidor"), FechaAplicadoI, FechaAplicadoF)
|
||||
|
||||
e.Row.FCHyperLink("HplVendido").NavigateUrl = Liga5
|
||||
|
||||
|
||||
@@ -186,6 +186,36 @@
|
||||
<asp:ListItem Text="No" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">Fecha Aplicado Inicio: </div>
|
||||
<div class="col-md-1">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important;">
|
||||
<asp:TextBox Width="80px" ID="TxtFechaAplicadoI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioAplicadoI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaAplicadoI" runat="server" TargetControlID="TxtFechaAplicadoI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaAplicadoI" PopupButtonID="imgCalendarioAplicadoI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaAplicadoI" runat="server" ControlToValidate="TxtFechaAplicadoI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaAplicadoI" runat="server" ControlToValidate="TxtFechaAplicadoI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</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="vcoFfvFAplicadoI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaAplicadoI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFAplicadoI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaAplicadoI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">Fecha Aplicado Fin: </div>
|
||||
<div class="col-md-1">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important;">
|
||||
<asp:TextBox Width="80px" ID="TxtFechaAplicadoF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioAplicadoF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaAplicadoF" runat="server" TargetControlID="TxtFechaAplicadoF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender2" TargetControlID="TxtFechaAplicadoF" PopupButtonID="imgCalendarioAplicadoF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaAplicadoF" runat="server" ControlToValidate="TxtFechaAplicadoF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaAplicadoF" runat="server" ControlToValidate="TxtFechaAplicadoF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</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="vcoFfvFAplicadoF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaAplicadoF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFAplicadoF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaAplicadoF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -85,7 +85,7 @@ Partial Class Ventas_RepRecuperacionDetalle
|
||||
Private Sub CargaCombos()
|
||||
Dim CveCliente, CveVendedor, CveUsuario, CveSubProyecto,
|
||||
CveEstatus, CveResponsable, CveAgrupador, CveBanco, CveCuenta, CveClienteSucursal, CveMoneda, CveClienteClasificacion As Integer
|
||||
Dim FechaI, FechaF, TipoDocto, TipoCambio As String
|
||||
Dim FechaI, FechaF, TipoDocto, TipoCambio, FechaAplicadoI, FechaAplicadoF As String
|
||||
|
||||
'Carga Clientes
|
||||
If (UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1") Then
|
||||
@@ -144,7 +144,17 @@ Partial Class Ventas_RepRecuperacionDetalle
|
||||
End If
|
||||
If FechaI <> "-1" Then
|
||||
txtFechaI.Text = FechaI
|
||||
End If
|
||||
|
||||
FechaAplicadoI = If(Request("FechaAplicadoI") IsNot Nothing, Request("FechaAplicadoI").ToString, "-1").ToString
|
||||
FechaAplicadoF = If(Request("FechaAplicadoF") IsNot Nothing, Request("FechaAplicadoF").ToString, "-1").ToString
|
||||
If FechaAplicadoF <> "-1" Then
|
||||
TxtFechaAplicadoF.Text = FechaAplicadoF
|
||||
End If
|
||||
If FechaAplicadoI <> "-1" Then
|
||||
TxtFechaAplicadoI.Text = FechaAplicadoI
|
||||
End If
|
||||
|
||||
|
||||
TipoDocto = IfNull(Request("TipoDocto"), "-1").ToString
|
||||
CveClienteSucursal = IfNull(Request("CveClienteSucursal"), "-1").ToString.ToEntero
|
||||
@@ -229,7 +239,7 @@ Partial Class Ventas_RepRecuperacionDetalle
|
||||
Iva.ToString, DdlGrupo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlResponsable.SelectedValue.ToEntero,
|
||||
DdlTipoDocto.SelectedValue, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveBanco:=DdlBanco.SelectedValue.ToEntero, CveCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero, Grupo:=Grupo,
|
||||
TipoCambio:=RblTipoCambio.SelectedValue.ToEntero, TCEspecifico:=TCEspecifico, CveMoneda:=DdlMoneda.SelectedValue.ToEntero, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, Tipo:=Tipo,
|
||||
EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero()) Then
|
||||
EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero(), FechaAplicadoI:=TxtFechaAplicadoI.Text.ToDate, FechaAplicadoF:=TxtFechaAplicadoF.Text.ToDate) Then
|
||||
|
||||
GvDatos.DataSource = ObjMovtos.DtResultados
|
||||
DtDatos = ObjMovtos.DtResultados
|
||||
|
||||
@@ -5459,7 +5459,9 @@ Partial Class Ventas
|
||||
DdlMetodoPago33.Enabled = True
|
||||
End If
|
||||
|
||||
If CveVenta <= 0 Or EsCreaApartirDe Or NuevaFactura = 1 Then
|
||||
Dim CveCotizacion As Integer = IfNull(ViewState("CveCotizacion"), 0).ToString().ToEntero()
|
||||
|
||||
If (CveVenta <= 0 AndAlso CveCotizacion <= 0) Or EsCreaApartirDe Or NuevaFactura = 1 Then
|
||||
CveMetodoPagoCliente = ObjCliente.CveMetodoPago
|
||||
|
||||
|
||||
@@ -6241,7 +6243,9 @@ Partial Class Ventas
|
||||
ViewState("CliNoInt") = ObjCliente.NoInt
|
||||
PlazoCobranza = ObjCliente.PlazoCobranza
|
||||
|
||||
If CveVenta <= 0 Then
|
||||
Dim CveCotizacion As Integer = IfNull(ViewState("CveCotizacion"), 0).ToString().ToEntero()
|
||||
|
||||
If CveVenta <= 0 AndAlso CveCotizacion <= 0 Then
|
||||
CveMetodoPagoCliente = ObjCliente.CveMetodoPago
|
||||
|
||||
DdlMetodoPago33.SelectedValueExist(ObjCliente.CveMetodoPago33)
|
||||
@@ -21405,7 +21409,7 @@ Partial Class Ventas
|
||||
LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = ObjetoPDF, .NombreArchivo = $"AcuseCancelacion{Serie}-{Folio}.pdf"})
|
||||
If ObjMail.SendMail(EmpresaActual, Mail, Asunto, Cuerpo, MailCC, LSRutasMail, Displayname:=DisplayName) Then
|
||||
ResultadoMail = 1
|
||||
Alert("El acuse de cancelación ha sido envíado correctamente.")
|
||||
Alert("El acuse de cancelación ha sido envíado correctamente.", JSBtnAceptar:="BtnRefrescarPagina();")
|
||||
Else
|
||||
ResultadoMail = 0
|
||||
End If
|
||||
@@ -26497,6 +26501,12 @@ Partial Class Ventas
|
||||
|
||||
End Sub
|
||||
Private Sub BtnEditarCotizacion_Click(sender As Object, e As EventArgs) Handles BtnEditarCotizacion.Click
|
||||
Dim VaFacturarCotizacion As Boolean = False
|
||||
'SI CARGA UNA COTIZACION DEBE GUARDAR TAMBIEN
|
||||
If IfNull(ViewState("CveCotizacion"), 0).ToString().ToEntero() > 0 Then
|
||||
ViewState("CveVenta") = IfNull(ViewState("CveCotizacion"), 0).ToString().ToEntero()
|
||||
VaFacturarCotizacion = True
|
||||
End If
|
||||
|
||||
If Not TmpDT.Rows.Count > 0 Then
|
||||
Alert("Es necesario agregar al menos un producto o servicio a la factura.", TipoMensaje.MsgAdvertencia)
|
||||
@@ -26567,14 +26577,14 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjConta.ValidacionPrePolizaCuadre(-1, 2, CveVenta) Then
|
||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
If ObjConta.ValorPolizaDescuadre = 2 Then
|
||||
OcurrioError = True
|
||||
MensajeError = ObjConta.MensajePolizaDescuadre
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
'If ObjConta.ValidacionPrePolizaCuadre(-1, 2, CveVenta) Then
|
||||
' If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
' If ObjConta.ValorPolizaDescuadre = 2 Then
|
||||
' OcurrioError = True
|
||||
' MensajeError = ObjConta.MensajePolizaDescuadre
|
||||
' End If
|
||||
' End If
|
||||
'End If
|
||||
|
||||
If OcurrioError Then
|
||||
ObjVentas.RollBack()
|
||||
@@ -26590,7 +26600,12 @@ Partial Class Ventas
|
||||
'GENERA PDF NUEVO
|
||||
GeneraPDFCotizacion(ChkEnviarFactura.Checked)
|
||||
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Ventas/Ventas.aspx?CveVenta=" & CveVenta & "&&Tipo=Cot"";")
|
||||
If VaFacturarCotizacion Then
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Ventas/Ventas.aspx?CveCotizacion=" & CveVenta & """;")
|
||||
Else
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Ventas/Ventas.aspx?CveVenta=" & CveVenta & "&&Tipo=Cot"";")
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
@@ -26807,82 +26822,77 @@ Partial Class Ventas
|
||||
Private Function CalculaUsadosCotizacion(ByRef SbVentasDetalle As StringBuilder, ByVal DTSeleccionadas As DataTable, ByVal DtCotizaciones As DataTable) As List(Of MVentaDetalleCotizacion)
|
||||
Dim Retorno As New List(Of MVentaDetalleCotizacion)
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Cot", "Dev") Then
|
||||
Dim DTTamanios As DataTable = GlobalDTAcumTamaños()
|
||||
|
||||
Dim DTTamanios As DataTable = GlobalDTAcumTamaños()
|
||||
Dim DTCvePSCostos As DataTable = DTTamanios.FiltraParametros("", "", {"CvePSCargo"})
|
||||
|
||||
Dim DTCvePSCostos As DataTable = DTTamanios.FiltraParametros("", "", {"CvePSCargo"})
|
||||
For Each Dr As DataRow In DTSeleccionadas.Rows
|
||||
Dim tCantidad = If(ChkCotProductos.Checked, GvCotPS.Rows(IndiceGVCotDataKey(GvCotPS, Dr("CveVentaDetalle").ToString())).FCTextBox("TxtCantidadCot").Text.ToDecimal, Dr("Cantidad")).ToString().ToDecimal
|
||||
Dr("Cantidad") = tCantidad
|
||||
|
||||
Retorno.Add(New MVentaDetalleCotizacion() With {.CveVentaDetalle = Dr("CveVentaDetalle").ToString().ToEntero(), .Cantidad = tCantidad})
|
||||
|
||||
For Each Dr As DataRow In DTSeleccionadas.Rows
|
||||
Dim tCantidad = If(ChkCotProductos.Checked, GvCotPS.Rows(IndiceGVCotDataKey(GvCotPS, Dr("CveVentaDetalle").ToString())).FCTextBox("TxtCantidadCot").Text.ToDecimal, Dr("Cantidad")).ToString().ToDecimal
|
||||
Dr("Cantidad") = tCantidad
|
||||
Next
|
||||
|
||||
Retorno.Add(New MVentaDetalleCotizacion() With {.CveVentaDetalle = Dr("CveVentaDetalle").ToString().ToEntero(), .Cantidad = tCantidad})
|
||||
Dim TmpDTCalculo As DataRow() = DTSeleccionadas.Rows.Cast(Of DataRow).ToArray()
|
||||
|
||||
Next
|
||||
Dim DTPSTemp As New DataTable '= TmpDT.Clone
|
||||
|
||||
Dim TmpDTCalculo As DataRow() = DTSeleccionadas.Rows.Cast(Of DataRow).ToArray()
|
||||
DTPSTemp.Columns.Add("CveVenta", GetType(Integer))
|
||||
DTPSTemp.Columns.Add("Cantidad", GetType(Integer))
|
||||
DTPSTemp.Columns.Add("CvePS", GetType(Integer))
|
||||
DTPSTemp.Columns.Add("PU", GetType(Decimal))
|
||||
|
||||
Dim DTPSTemp As New DataTable '= TmpDT.Clone
|
||||
For Each DrowPartidas As DataRow In TmpDTCalculo
|
||||
Dim CveTamanioTemp As Integer = DrowPartidas("CveTamaño").ToString().ToEntero()
|
||||
Dim CveVenta As Integer = DrowPartidas("CveVenta").ToString().ToEntero()
|
||||
|
||||
DTPSTemp.Columns.Add("CveVenta", GetType(Integer))
|
||||
DTPSTemp.Columns.Add("Cantidad", GetType(Integer))
|
||||
DTPSTemp.Columns.Add("CvePS", GetType(Integer))
|
||||
DTPSTemp.Columns.Add("PU", GetType(Decimal))
|
||||
If CveTamanioTemp > 0 Then
|
||||
|
||||
For Each DrowPartidas As DataRow In TmpDTCalculo
|
||||
Dim CveTamanioTemp As Integer = DrowPartidas("CveTamaño").ToString().ToEntero()
|
||||
Dim CveVenta As Integer = DrowPartidas("CveVenta").ToString().ToEntero()
|
||||
Dim DTTamanioTemp As New DataTable
|
||||
Dim CvePsTemp As Integer = DTTamanios.FiltraParametros($"CveTamaño = { CveTamanioTemp } ").Rows(0)("CvePSCargo").ToString().ToEntero()
|
||||
|
||||
If CveTamanioTemp > 0 Then
|
||||
Dim Cargo As Decimal = DTTamanios.FiltroPrimeroValor("Cargo", $" CveTamaño = { CveTamanioTemp }").ToDecimal
|
||||
|
||||
Dim DTTamanioTemp As New DataTable
|
||||
Dim CvePsTemp As Integer = DTTamanios.FiltraParametros($"CveTamaño = { CveTamanioTemp } ").Rows(0)("CvePSCargo").ToString().ToEntero()
|
||||
If DTPSTemp.FiltraParametros($"CvePs = { CvePsTemp }").Rows.Count > 0 Then
|
||||
|
||||
Dim Cargo As Decimal = DTTamanios.FiltroPrimeroValor("Cargo", $" CveTamaño = { CveTamanioTemp }").ToDecimal
|
||||
For Each dRowUpdate As DataRow In DTPSTemp.Rows
|
||||
|
||||
If DTPSTemp.FiltraParametros($"CvePs = { CvePsTemp }").Rows.Count > 0 Then
|
||||
If (dRowUpdate("CvePS").ToString().ToEntero() = CvePsTemp) Then
|
||||
dRowUpdate("Cantidad") = dRowUpdate("Cantidad").ToString().ToDecimal + DrowPartidas("Cantidad").ToString().ToDecimal
|
||||
dRowUpdate("PU") = Cargo ' dRowUpdate("Total").ToString().ToDecimal + ImporteCargo
|
||||
dRowUpdate("CveVenta") = CveVenta
|
||||
End If
|
||||
Next
|
||||
|
||||
For Each dRowUpdate As DataRow In DTPSTemp.Rows
|
||||
DTPSTemp.AcceptChanges()
|
||||
|
||||
If (dRowUpdate("CvePS").ToString().ToEntero() = CvePsTemp) Then
|
||||
dRowUpdate("Cantidad") = dRowUpdate("Cantidad").ToString().ToDecimal + DrowPartidas("Cantidad").ToString().ToDecimal
|
||||
dRowUpdate("PU") = Cargo ' dRowUpdate("Total").ToString().ToDecimal + ImporteCargo
|
||||
dRowUpdate("CveVenta") = CveVenta
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
Dim dRowNuevo As DataRow = DTPSTemp.NewRow
|
||||
|
||||
DTPSTemp.AcceptChanges()
|
||||
|
||||
Else
|
||||
Dim dRowNuevo As DataRow = DTPSTemp.NewRow
|
||||
|
||||
dRowNuevo("CvePS") = CvePsTemp
|
||||
dRowNuevo("Cantidad") = DrowPartidas("Cantidad").ToString().ToDecimal
|
||||
dRowNuevo("PU") = Cargo
|
||||
dRowNuevo("CveVenta") = CveVenta
|
||||
|
||||
DTPSTemp.Rows.Add(dRowNuevo)
|
||||
DTPSTemp.AcceptChanges()
|
||||
End If
|
||||
dRowNuevo("CvePS") = CvePsTemp
|
||||
dRowNuevo("Cantidad") = DrowPartidas("Cantidad").ToString().ToDecimal
|
||||
dRowNuevo("PU") = Cargo
|
||||
dRowNuevo("CveVenta") = CveVenta
|
||||
|
||||
DTPSTemp.Rows.Add(dRowNuevo)
|
||||
DTPSTemp.AcceptChanges()
|
||||
End If
|
||||
Next
|
||||
|
||||
For Each drowPsTamaños As DataRow In DTPSTemp.Rows
|
||||
End If
|
||||
Next
|
||||
|
||||
If drowPsTamaños("PU").ToString().ToDecimal > 0 Then
|
||||
For Each drowPsTamaños As DataRow In DTPSTemp.Rows
|
||||
|
||||
Dim CveVentaDetalleUsado = DtCotizaciones.FiltroPrimeroValor("CveVentaDetalle", $"CveVenta = {drowPsTamaños("CveVenta")} AND CvePS = {drowPsTamaños("CvePS")}").ToEntero()
|
||||
SbVentasDetalle.AppendFormat("{0},", CveVentaDetalleUsado)
|
||||
If drowPsTamaños("PU").ToString().ToDecimal > 0 Then
|
||||
|
||||
Retorno.Add(New MVentaDetalleCotizacion() With {.CveVentaDetalle = CveVentaDetalleUsado, .Cantidad = drowPsTamaños("Cantidad").ToString().ToDecimal()})
|
||||
Dim CveVentaDetalleUsado = DtCotizaciones.FiltroPrimeroValor("CveVentaDetalle", $"CveVenta = {drowPsTamaños("CveVenta")} AND CvePS = {drowPsTamaños("CvePS")}").ToEntero()
|
||||
SbVentasDetalle.AppendFormat("{0},", CveVentaDetalleUsado)
|
||||
|
||||
End If
|
||||
Next
|
||||
Retorno.Add(New MVentaDetalleCotizacion() With {.CveVentaDetalle = CveVentaDetalleUsado, .Cantidad = drowPsTamaños("Cantidad").ToString().ToDecimal()})
|
||||
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Reference in New Issue
Block a user