Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -385,7 +385,8 @@
|
||||
<div class="row">
|
||||
<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" BorderColor="#D3D3D3" GridLines="None">
|
||||
<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,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%" />
|
||||
@@ -408,9 +409,13 @@
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnGenerarTxt" Text="Generar Archivo" CssClass="btn btn-primary" runat="server" OnClick="BtnGenerarTxt_Click" />
|
||||
<asp:Button ID="BtnExportarExcel" Text="Generar Excel" CssClass="btn btn-success" runat="server" OnClick="BtnExportarExcel_Click" />
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="BtnGenerarTxt" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -255,4 +255,54 @@ Partial Class Acumuladores_CatFoliosGarantia
|
||||
|
||||
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
|
||||
End Sub
|
||||
Protected Sub BtnGenerarTxt_Click(sender As Object, e As EventArgs)
|
||||
Dim SbTxt As New StringBuilder
|
||||
|
||||
For Each GvRow As GridViewRow In GvGarantiasDetalle.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
'1.- Consecutivo Partida-->1
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("Consecutivo"))
|
||||
'2.- Cliente-->100407
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoCliente"))
|
||||
'3. Codigo De Articulo --> 171402
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("Codigo"))
|
||||
'4. Tipo De Uso --> A
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoTipoUso"))
|
||||
'5. Defecto --> P
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoTipoDefecto"))
|
||||
'6. Codigo De Ensamble --> 1X
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoEnsamble"))
|
||||
'7. Codigo De Linea/Termico --> 9000
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoLinea"))
|
||||
'8. Codigo De Inspeccion --> J8K
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoInspeccion"))
|
||||
'9. Fecha De Venta --> 05/09/2009
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("FechaVenta").ToDateTime().ToString("dd/MM/yyyy"))
|
||||
'10. Fecha De Reclamacion --> 05/07/2010
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("FechaReclamacion").ToDateTime().ToString("dd/MM/yyyy"))
|
||||
'11. TipoComprobante --> 1
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("TipoComprobante"))
|
||||
'12. Comprobante --> N/A
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("Comprobante"))
|
||||
'13. Autorizo --> STAN7490
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("Autorizo"))
|
||||
'14. Comentarios --> Cliente 100407
|
||||
SbTxt.AppendFormat("{0}@", GvRow.DataKey("Comentarios"))
|
||||
'15. Clave De Autorizacion / Codigo Error --> P05TRBGX
|
||||
SbTxt.AppendFormat("{0}", GvRow.DataKey("ClaveAutorizacion"))
|
||||
|
||||
SbTxt.Append(vbCrLf)
|
||||
End If
|
||||
Next
|
||||
|
||||
Dim text As String = SbTxt.ToString
|
||||
Response.Clear()
|
||||
Response.ClearHeaders()
|
||||
Response.AddHeader("Content-Length", text.Length.ToString)
|
||||
Response.ContentType = "text/plain"
|
||||
Response.AppendHeader("content-disposition", $"attachment;filename=""{LblFolio.Text}.txt""")
|
||||
Response.Write(text)
|
||||
Response.End()
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -36,6 +36,8 @@ Public Class ClsPaginas
|
||||
|
||||
Public Shared Property EmpresaNotificaciones() As Empresa
|
||||
|
||||
Public Shared Property EmpresaNotificacionesGPS() As Empresa
|
||||
|
||||
|
||||
|
||||
Public ReadOnly Property EsProduccion As Boolean
|
||||
@@ -5274,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
|
||||
|
||||
@@ -221,7 +221,7 @@ Public Class ClsSisNotificaciones
|
||||
Try
|
||||
Dim ResultadoMail As Integer = 0
|
||||
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
|
||||
If ObjMail.SendMail(ClsPaginas.EmpresaNotificaciones, Mail, Asunto, Cuerpo, MailCC, LSRutasMail) Then
|
||||
If ObjMail.SendMail(ClsPaginas.EmpresaNotificacionesGPS, Mail, Asunto, Cuerpo, MailCC, LSRutasMail) Then
|
||||
ObjNotificacion.UpdateNotificacionesBitacoraNotifico(CveNotificacionBitacora, 1)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
|
||||
@@ -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/"
|
||||
|
||||
@@ -4202,13 +4202,14 @@ Public Class ClsVentas
|
||||
Return retorno
|
||||
End Function
|
||||
|
||||
Public Function TraspasaVentasAplicadasAnt(CveVentaNueva As Integer, CveVentaAnterior As Integer, CveEmpresa As Integer) As Boolean
|
||||
Public Function TraspasaVentasAplicadasAnt(CveVentaNueva As Integer, CveVentaAnterior As Integer, CveEmpresa As Integer, CvePrePoliza As Integer) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_TraspasaVentasAplicadasAnt", CommandType.StoredProcedure)
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveVentaNueva", SqlDbType.Int).Value = CveVentaNueva
|
||||
.Add("@CveVentaAnterior", SqlDbType.Int).Value = CveVentaAnterior
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
@@ -4506,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)
|
||||
|
||||
@@ -2652,7 +2652,7 @@ Namespace Modelos
|
||||
Case 11 'Anticipo
|
||||
|
||||
'[IPP] SI ES REFACTURACION LOS ANTICIPOS NO LOS DEBE APLICAR EN EL INGRESO REFACTURADO (VIEJO)
|
||||
If NuevaFactura = 1 And ObjFactura.CveVenta = CveDevolucion Then
|
||||
If CveEstatusRefacturacion > 0 Then
|
||||
Exit Select
|
||||
End If
|
||||
|
||||
@@ -4458,6 +4458,10 @@ Namespace Modelos
|
||||
|
||||
Dim CveEstatusRefacturacion As Integer = If(ObjFactura.CveEstatusRefacturacion <= 0, 0, ObjFactura.CveEstatusRefacturacion)
|
||||
|
||||
If Not EsRefacturacion Then
|
||||
CveEstatusRefacturacion = 0
|
||||
End If
|
||||
|
||||
Dim CancelacionFecha As Date
|
||||
Dim FolioFiscal As String = ObjFactura.FolioFiscal
|
||||
Dim CancelacionAcuse As String = ""
|
||||
@@ -4485,7 +4489,7 @@ Namespace Modelos
|
||||
|
||||
If CveEstatusFacturaAsignado <= 0 Then
|
||||
Try
|
||||
If ObjFactura.FolioFiscal <> "" Then
|
||||
If ObjFactura.FolioFiscal <> "" AndAlso UsuarioActual.Empresa.FacturaProduccion Then
|
||||
If ObjFactura.TipoDocto.Contiene("Ing", "Ant", "Dev", "Egs") Then
|
||||
|
||||
'VERIFICA SI DEBE VALIDAR ANTE EL SAT
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -231,6 +231,15 @@
|
||||
<asp:Literal ID="LtlTotalIngreso" runat="server" Text='<%# Eval("TotalIngresos", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
<asp:Label Text="Devoluciones" runat="server" CausesValidation="false"> </asp:Label>
|
||||
<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:#,###.##}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
<asp:Label Text="Total Caja" runat="server" CausesValidation="false"> </asp:Label>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -7085,11 +7085,11 @@ Partial Class Compras_Compras
|
||||
CveCuenta = CveCuentaProveedorExtranjera
|
||||
End If
|
||||
End If
|
||||
|
||||
If CveCompraRefacturacion > 0 Then
|
||||
importeMovimiento = 0
|
||||
importeMN = 0
|
||||
End If
|
||||
|
||||
'If CveCompraRefacturacion > 0 Then
|
||||
' importeMovimiento = 0
|
||||
' importeMN = 0
|
||||
' End If
|
||||
|
||||
|
||||
Case 59 'Documentos
|
||||
@@ -7337,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
|
||||
|
||||
@@ -7540,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
|
||||
@@ -8880,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)
|
||||
|
||||
|
||||
@@ -1327,7 +1327,7 @@ Partial Class PopUpVerFactura
|
||||
Dim CveTipoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {CveAlmacen}").ToString.ToEntero
|
||||
|
||||
'VERIFICA SI TIENE MOVIMIENTO VIRTUAL RELACIONADO
|
||||
If UsuarioActual.CveEmpresa = 140 AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then
|
||||
CveMovimientoRelacionado = ObjInventarios.DtResultados.Rows(0)("CveMtoRel").ToString().ToEntero()
|
||||
If CveConcepto.Contiene(2, 3, 26, 27) AndAlso ObjInventarios.DtResultados.FiltroPrimeroValor("CveMovimientoVirtual").ToEntero() > 0 Then
|
||||
FolioRelacionado = ObjInventarios.DtResultados.FiltroPrimeroValor("FolioVirtual")
|
||||
@@ -1361,7 +1361,7 @@ Partial Class PopUpVerFactura
|
||||
If ObjInventarios.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||
DtMovimientos = ObjInventarios.DtResultados.Copy()
|
||||
CantidadProductos = DtMovimientos.SUM("Cantidad").ToDecimal()
|
||||
If UsuarioActual.CveEmpresa = 140 AndAlso CveMovimientoRelacionado > 0 Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CveMovimientoRelacionado > 0 Then
|
||||
If ObjInventarios.GetMovimientos(CveMovimientoRelacionado, -1, -1, UsuarioActual.CveEmpresa) Then
|
||||
Dim CveAlmacenRelacionado As Integer = ObjInventarios.CveAlmacen
|
||||
Dim CveTipoAlmacenRelacionado As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {CveAlmacenRelacionado}").ToString.ToEntero
|
||||
@@ -1393,7 +1393,7 @@ Partial Class PopUpVerFactura
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveEmpresa = 140 AndAlso CveCompra > 0 Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CveCompra > 0 Then
|
||||
If ObjInventarios.RecepcionAlmacenGet(CveCompra, -1, UsuarioActual.CveEmpresa) AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then
|
||||
Dim DtFaltante As DataTable = ObjInventarios.DtResultados.FiltraParametros("CantidadF > 0")
|
||||
If DtFaltante.Rows.Count > 0 Then
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<link href="../Metronic/assets/global/plugins/jquery-minicolors/jquery.minicolors.css" rel="stylesheet" />
|
||||
<style>
|
||||
html, body {
|
||||
width: 100%;
|
||||
@@ -26,6 +27,138 @@
|
||||
.pac-container.pac-logo {
|
||||
z-index: 100000;
|
||||
}
|
||||
|
||||
#showdiv1 {
|
||||
left: 0 !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
#ShowDiv3:hover {
|
||||
line-height: 34px !important;
|
||||
-webkit-transition: line-height ease 1s;
|
||||
-moz-transition: line-height ease 1s;
|
||||
-o-transition: line-height ease 1s;
|
||||
transition: line-height ease 1s;
|
||||
}
|
||||
|
||||
.ADScroller-body {
|
||||
max-height: 400px;
|
||||
}
|
||||
|
||||
.pac-container.pac-logo {
|
||||
z-index: 100000;
|
||||
}
|
||||
|
||||
#iw-container {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#iw-container .iw-title {
|
||||
font-family: 'Open Sans Condensed', sans-serif;
|
||||
font-size: 22px;
|
||||
font-weight: 400;
|
||||
padding: 10px;
|
||||
background-color: #48b5e9;
|
||||
color: white;
|
||||
margin: 0;
|
||||
border-radius: 2px 2px 0 0;
|
||||
}
|
||||
|
||||
#iw-container .iw-content {
|
||||
font-size: 13px;
|
||||
line-height: 18px;
|
||||
font-weight: 400;
|
||||
margin-right: 1px;
|
||||
padding: 15px 5px 20px 15px;
|
||||
max-height: 140px;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.iw-content img {
|
||||
float: right;
|
||||
margin: 0 5px 5px 10px;
|
||||
}
|
||||
|
||||
.iw-subTitle {
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
.iw-bottom-gradient {
|
||||
position: absolute;
|
||||
width: 326px;
|
||||
height: 25px;
|
||||
bottom: 10px;
|
||||
right: 18px;
|
||||
background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
|
||||
background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
|
||||
background: -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
|
||||
background: -ms-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
|
||||
}
|
||||
|
||||
.modal.fade:not(.in).left .modal-dialog {
|
||||
-webkit-transform: translate3d(-25%, 0, 0);
|
||||
transform: translate3d(-25%, 0, 0);
|
||||
}
|
||||
|
||||
.modal.fade:not(.in).right .modal-dialog {
|
||||
-webkit-transform: translate3d(25%, 0, 0);
|
||||
transform: translate3d(25%, 0, 0);
|
||||
}
|
||||
|
||||
.modal.fade:not(.in).bottom .modal-dialog {
|
||||
-webkit-transform: translate3d(0, 25%, 0);
|
||||
transform: translate3d(0, 25%, 0);
|
||||
}
|
||||
|
||||
/* Alternative Angles */
|
||||
.modal.fade:not(.in).top-left .modal-dialog {
|
||||
-webkit-transform: translate3d(-25%, -25%, 0);
|
||||
transform: translate3d(-25%, -25%, 0);
|
||||
}
|
||||
|
||||
.modal.fade:not(.in).top-right .modal-dialog {
|
||||
-webkit-transform: translate3d(25%, -25%, 0);
|
||||
transform: translate3d(25%, -25%, 0);
|
||||
}
|
||||
|
||||
.modal.fade:not(.in).bottom-left .modal-dialog {
|
||||
-webkit-transform: translate3d(-25%, 25%, 0);
|
||||
transform: translate3d(-25%, 25%, 0);
|
||||
}
|
||||
|
||||
.modal.fade:not(.in).bottom-right .modal-dialog {
|
||||
-webkit-transform: translate3d(25%, 25%, 0);
|
||||
transform: translate3d(25%, 25%, 0);
|
||||
}
|
||||
|
||||
.minicolors {
|
||||
position: relative;
|
||||
MARGIN-TOP: 10PX;
|
||||
WIDTH: 20%;
|
||||
}
|
||||
|
||||
table.dataTable,
|
||||
table.dataTable th,
|
||||
table.dataTable td {
|
||||
-webkit-box-sizing: content-box;
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.dataTables_scrollBody > .dataTable > thead {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
tr td:nth-child(4) {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.form-horizontal .control-label {
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
|
||||
@@ -66,8 +199,11 @@
|
||||
<asp:GridView ID="GvPuntos" runat="server" GridLines="None" DataKeyNames="Punto,PuntoDeInteres,CvePuntoDeInteres" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-height="150" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%">
|
||||
<HeaderTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkSelectAll" CssClass="ChkAllClickGR" />
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkGR" />
|
||||
<asp:CheckBox runat="server" ID="chkGR" CssClass="ChkAllGR" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="PuntoDeInteres" ItemStyle-Width="45%" HeaderText="Punto De Interés" ItemStyle-HorizontalAlign="Left" />
|
||||
@@ -83,8 +219,11 @@
|
||||
<asp:GridView ID="GvDispositivos" runat="server" GridLines="None" DataKeyNames="CveDispositivo,SerieVehiculo,DevID,NoEconomico,NombreVehiculo" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-heighterror="800" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%">
|
||||
<HeaderTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkSelectAll" CssClass="ChkAllClickDisp" />
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkDis" />
|
||||
<asp:CheckBox runat="server" ID="chkDis" CssClass="ChkAllDisp" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="25%" HeaderText="Número Económico" ItemStyle-HorizontalAlign="Left" />
|
||||
@@ -148,6 +287,43 @@
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal fade bottom in" style="bottom: unset; z-index: 539" id="h">
|
||||
<div class="modal-dialog" style="position: fixed; bottom: 0; margin: 0px,0px,0px,0px; width: 100%; padding: 0px, 0px, 0px, 0px; border-style: solid; border-color: rgb(68, 77, 88); z-index: 539;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body" style="padding: 5px;">
|
||||
<asp:UpdatePanel runat="server" ID="UPGV" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div runat="server" id="rowImpresiones" class="row" style="margin: 0px 10px 10px 0px; text-align: right;">
|
||||
<a onclick="doScaledCLick('#C_btnImprimir');;" class="btn btn-circle btn-sm grey"><i class='fa fa-print' aria-hidden='true'></i></a>
|
||||
<a onclick="doScaledCLick('#C_BtnImprimirEX');" class="btn btn-circle btn-sm green"><i class='fa fa-file-excel-o' aria-hidden='true'></i></a>
|
||||
</div>
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
|
||||
<div style="margin-right: 15px">
|
||||
<input type="text" id="TxtBusquedaBarra" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaBarra','{0}')", GvBarra.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaBarra','{0}')", GvBarra.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<asp:GridView ID="GvBarra" runat="server" GridLines="None" PageSize="1000" AllowPaging="true" AllowCustomPaging="true" CssClass="table table-striped table-advance table-hover Widthall" data-sort="true" data-height="150px;" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Vehiculo" ItemStyle-Width="30%" HeaderText="Vehículo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="PuntoDeInteres" ItemStyle-Width="30%" HeaderText="Punto De Interes" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Visitas" ItemStyle-Width="20%" DataFormatString="{0} Visitas" HeaderText="Visitas" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="UltimaVisita" ItemStyle-Width="20%" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Ultima Visita" ItemStyle-HorizontalAlign="Center" />
|
||||
</Columns>
|
||||
<PagerSettings Mode="NextPrevious" Visible="true" Position="Top" />
|
||||
</asp:GridView>
|
||||
<asp:HiddenField ID="HdnIndexGvBarra" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<asp:HiddenField ID="HdnTextFilter" runat="server" ClientIDMode="Static" Value="" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div runat="server" class="row" style="margin: 0px 0px 10px 0px; display: none">
|
||||
<asp:Button runat="server" OnClick="btnImprimir_Click" ID="btnImprimir" CommandArgument="PDF" ToolTip="Imprimir en PDF" CssClass="btn btn-circle btn-sm grey" Text="<i class='fa fa-print' aria-hidden='true'></i>"></asp:Button>
|
||||
<asp:Button runat="server" OnClick="btnImprimir_Click" ID="BtnImprimirEX" CommandArgument="EXCEL" ToolTip="Imprimir en EXCEL" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-file-excel-o' aria-hidden='true'></i>"></asp:Button>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
@@ -158,18 +334,36 @@
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script>
|
||||
|
||||
function doScaledCLick(boton) {
|
||||
|
||||
setTimeout(function () {
|
||||
$(boton).click();
|
||||
}, 250);
|
||||
}
|
||||
|
||||
var markers = [];
|
||||
var lastOpenedInfoWindow;
|
||||
var geocoder;
|
||||
var map;
|
||||
var circles = [];
|
||||
|
||||
$('body').on('click', '.ChkAllClickGR input', function () { $(".ChkAllGR input").not(this).prop('checked', $('.ChkAllClickGR input').is(':checked')); });
|
||||
$('body').on('click', '.ChkAllClickDisp input', function () { $(".ChkAllDisp input").not(this).prop('checked', $('.ChkAllClickDisp input').is(':checked')); });
|
||||
|
||||
function initMap() {
|
||||
map = new google.maps.Map(document.getElementById('map'), {
|
||||
center: { lat: 19.4326, lng: -99.13329 },
|
||||
zoom: 8
|
||||
});
|
||||
|
||||
var ShowDiv1 = document.createElement('div');
|
||||
var ShowDivControl = new ShowDiv(ShowDiv1, map);
|
||||
|
||||
ShowDiv1.index = 1;
|
||||
ShowDiv1.id = "showdiv1"
|
||||
|
||||
map.controls[google.maps.ControlPosition.BOTTOM_CENTER].push(ShowDiv1);
|
||||
|
||||
if (navigator.geolocation) {
|
||||
navigator.geolocation.getCurrentPosition(function (position) {
|
||||
var pos = {
|
||||
@@ -201,6 +395,178 @@
|
||||
//service = new google.maps.DistanceMatrixService;
|
||||
// map.addListener('click', addLatLng);
|
||||
}
|
||||
|
||||
//$(document).ready(function () {
|
||||
// GvBarraPaginator();
|
||||
// initMap();
|
||||
// Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
|
||||
// function EndRequestHandler(sender, args) {
|
||||
// $("#C_GvBarra_filter > div > input").on("keypress", function (e) {
|
||||
// HdnTextFilter.value = $(this).val() + String.fromCharCode(e.which);
|
||||
// });
|
||||
// }
|
||||
//});
|
||||
|
||||
function GvBarraPaginator() {
|
||||
$('.table.PaginarGV').each(function () {
|
||||
var Tthis = $(this);
|
||||
if (!$.fn.DataTable.isDataTable(Tthis) && Tthis.find("th").length > 0) {
|
||||
Tthis.prepend(("<thead></thead>"));
|
||||
Tthis.find('thead').append($("#C_GvBarra").find("tr:first"));
|
||||
var table = Tthis.DataTable({
|
||||
//data: datasource,
|
||||
//columns: [
|
||||
// { title: "Vehiculo" },
|
||||
// { title: "Fecha" },
|
||||
// { title: "TiempoDetenido" },
|
||||
// { title: "Extn." },
|
||||
// { title: "Start date" },
|
||||
// { title: "Salary" }
|
||||
//],
|
||||
deferRender: true,
|
||||
deferLoading: 100,
|
||||
scrollY: 130,
|
||||
scrollCollapse: true,
|
||||
scroller: {
|
||||
displayBuffer: 20
|
||||
},
|
||||
ordering: true
|
||||
});
|
||||
var tkeys = new $.fn.dataTable.KeyTable(table, {
|
||||
// options
|
||||
});
|
||||
var parent = Tthis.parent().parent().parent();
|
||||
$('.dataTables_scrollHeadInner > .table.ADScrollPaginator2').find('th').addClass('importantth');
|
||||
parent.find(".dataTables_paginate").css("display", "none");
|
||||
parent.find(".dataTables_length").css("display", "none");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function ShowDiv(controlDiv, map) {
|
||||
// Set CSS for the control border.
|
||||
var controlUI = document.createElement('div');
|
||||
controlUI.style.backgroundColor = '#444d58';
|
||||
controlUI.style.border = '2px solid #444d58';
|
||||
controlUI.style.borderRadius = '3px';
|
||||
controlUI.style.width = '100%'
|
||||
controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';
|
||||
controlUI.style.cursor = 'pointer';
|
||||
controlUI.style.marginRight = '5px';
|
||||
controlUI.style.marginTop = '5px';
|
||||
controlUI.style.marginBottom = '0px';
|
||||
controlUI.style.textAlign = 'center';
|
||||
// controlUI.title = 'Click para borrar el último punto dibujado';
|
||||
controlDiv.appendChild(controlUI);
|
||||
|
||||
// Set CSS for the control interior.
|
||||
var controlText = document.createElement('div');
|
||||
controlText.style.color = '#ebebeb';
|
||||
controlText.id = "ShowDiv3"
|
||||
controlText.style.fontFamily = ' "Open Sans", sans-serif; ';
|
||||
controlText.style.fontSize = '14px';
|
||||
controlText.style.lineHeight = '20px';
|
||||
controlText.style.paddingLeft = '5px';
|
||||
controlText.style.paddingRight = '5px';
|
||||
controlText.innerHTML = '<i class="fa fa-angle-up" aria-hidden="true"></i>';
|
||||
controlUI.appendChild(controlText);
|
||||
|
||||
// Setup the click event listeners: simply set the map to Chicago.
|
||||
controlUI.addEventListener('click', function () {
|
||||
FNShowDiv();
|
||||
});
|
||||
}
|
||||
|
||||
function FNShowDiv() {
|
||||
if (open === false) {
|
||||
//$("#ChkSeguimiento").appendTo("#DivSeguimiento");
|
||||
//$("#ChkSeguimiento").appendTo("#DivSeguimiento");
|
||||
$("#h").modal()
|
||||
$("#ShowDiv3").css("line-height", "34px")
|
||||
open = true
|
||||
$("#ShowDiv3").html('<i class="fa fa-angle-down" aria-hidden="true"></i>')
|
||||
setTimeout(function () {
|
||||
$('.table.ADScrollPaginator2').DataTable().draw();
|
||||
}, 150);
|
||||
if ($("#HdnOpcion").val() === 'All' || $("#HdnOpcion").val() === 'Idle' || $("#HdnOpcion").val() === 'Ralenti') {
|
||||
$('#btnPlay').css('display', '');
|
||||
$('#btnPrintExcel').css('display', '');
|
||||
$('#btnPrintPDF').css('display', '');
|
||||
$("#btnPlay").click(function () {
|
||||
pause = !pause;
|
||||
if (pause) {
|
||||
stopTimeout();
|
||||
} else {
|
||||
if (startPlay) {
|
||||
startPlay = false;
|
||||
Play();
|
||||
} else {
|
||||
Play();
|
||||
}
|
||||
}
|
||||
if ($('#btnPlay > i').hasClass("fa-pause")) {
|
||||
$('#btnPlay > i').removeClass("fa-pause").addClass("fa-play");
|
||||
} else if ($('#btnPlay > i').hasClass("fa-play")) {
|
||||
$('#btnPlay > i').removeClass("fa-play").addClass("fa-pause");
|
||||
}
|
||||
|
||||
});
|
||||
$("#btnPrintExcel").click(function () {
|
||||
var s;
|
||||
for (var i = 0; i < $("#C_GvBarra").DataTable().rows().nodes().length; i++) {
|
||||
s = s + $("#C_GvBarra").DataTable().row(i).node().cells[2].title.trim() + ';';
|
||||
}
|
||||
$("#HdnDirecciones").val(s);
|
||||
doScaledCLick("#C_BtnImprimirEX")
|
||||
});
|
||||
$("#btnPrintPDF").click(function () {
|
||||
var s = "";
|
||||
for (var i = 0; i < $("#C_GvBarra").DataTable().rows().nodes().length; i++) {
|
||||
s = s + $("#C_GvBarra").DataTable().row(i).node().cells[2].title.trim() + ';';
|
||||
}
|
||||
$("#HdnDirecciones").val(s);
|
||||
doScaledCLick("#C_btnImprimir")
|
||||
});
|
||||
} else if ($("#HdnOpcion").val() === 'Speed') {
|
||||
|
||||
$('#btnPrintExcel').css('display', '');
|
||||
$('#btnPrintPDF').css('display', '');
|
||||
|
||||
$("#btnPrintExcel").click(function () {
|
||||
var s;
|
||||
for (var i = 0; i < $("#C_GvBarra").DataTable().rows().nodes().length; i++) {
|
||||
s = s + $("#C_GvBarra").DataTable().row(i).node().cells[2].title.trim() + ';';
|
||||
}
|
||||
$("#HdnDirecciones").val(s);
|
||||
doScaledCLick("#C_BtnImprimirEX")
|
||||
});
|
||||
$("#btnPrintPDF").click(function () {
|
||||
var s = "";
|
||||
for (var i = 0; i < $("#C_GvBarra").DataTable().rows().nodes().length; i++) {
|
||||
s = s + $("#C_GvBarra").DataTable().row(i).node().cells[2].title.trim() + ';';
|
||||
}
|
||||
$("#HdnDirecciones").val(s);
|
||||
doScaledCLick("#C_btnImprimir")
|
||||
});
|
||||
} else if ($("#HdnOpcion").val() === 'Last') {
|
||||
$('#btnPrintExcel').css('display', '');
|
||||
$("#btnPrintExcel").click(function () {
|
||||
var s;
|
||||
for (var i = 0; i < $("#C_GvBarra").DataTable().rows().nodes().length; i++) {
|
||||
s = s + $("#C_GvBarra").DataTable().row(i).node().cells[2].title.trim() + ';';
|
||||
}
|
||||
$("#HdnDirecciones").val(s);
|
||||
doScaledCLick("#C_BtnImprimirEX");
|
||||
});
|
||||
}
|
||||
} else {
|
||||
$("#h").modal('hide')
|
||||
$("#ShowDiv3").css("line-height", "20px")
|
||||
open = false
|
||||
$("#ShowDiv3").html('<i class="fa fa-angle-up" aria-hidden="true"></i>')
|
||||
}
|
||||
}
|
||||
|
||||
function CargaDivs(Tipo) {
|
||||
if (Tipo === "PointGroup") {
|
||||
$("#C_TxtNombre").val("")
|
||||
@@ -356,6 +722,8 @@
|
||||
}
|
||||
|
||||
</script>
|
||||
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places&callback=initMap", Extensiones.GOOGLE_MAPS_API_KEY) %>"</script>
|
||||
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places&callback=initMap", "AIzaSyDsZ4ATb_hVSEpRbBSlS46ZHEOn-0bNIFI") %>"></script>
|
||||
<script src="../Metronic/assets/global/plugins/jquery-minicolors/jquery.minicolors.min.js"></script>
|
||||
<script src="../Metronic/assets/global/plugins/jquery-minicolors/components-color-pickers.min.js"></script>
|
||||
</asp:Content>
|
||||
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class GPS_RepPuntosDeInteres
|
||||
Inherits ClsPaginas
|
||||
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "P R O P I E D A D E S "
|
||||
Private Property DispositivosLista As List(Of String)
|
||||
Get
|
||||
@@ -13,29 +15,34 @@ Partial Class GPS_RepPuntosDeInteres
|
||||
Set(value As List(Of String))
|
||||
ViewState("DispositivosLista") = value
|
||||
End Set
|
||||
End Property
|
||||
End Property
|
||||
Private Property DtDatosReporte As DataTable
|
||||
Get
|
||||
Return If(IsNothing(ViewState("DtDatosReporte")), Nothing, CType(ViewState("DtDatosReporte"), DataTable))
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtDatosReporte") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaDatos()
|
||||
txtFechaF.Text = Now.ToString("dd/MM/yyyy")
|
||||
txtFechaI.Text = Now.AddDays(-7).ToString("dd/MM/yyyy")
|
||||
|
||||
CargaDispositivos()
|
||||
Dim gps As New ClsGPS
|
||||
'If gps.PuntoDeInteresGrupoGet(-1, 1) Then
|
||||
' GvGrupos.DataSource = gps.DtResultados
|
||||
'Else
|
||||
' GvGrupos.DataSource = Nothing
|
||||
'End If
|
||||
If gps.PuntoDeInteresGet(-1, UsuarioActual.CveCliente, 1, -1) Then
|
||||
GvPuntos.DataSource = gps.DtResultados
|
||||
Dim ObjGPS As New ClsGPS
|
||||
If ObjGPS.PuntoDeInteresGet(-1, UsuarioActual.CveCliente, 1, -1) Then
|
||||
GvPuntos.DataSource = ObjGPS.DtResultados
|
||||
Else
|
||||
GvPuntos.DataSource = Nothing
|
||||
End If
|
||||
gps.Dispose()
|
||||
'GvGrupos.DataBind()
|
||||
ObjGPS.Dispose()
|
||||
GvPuntos.DataBind()
|
||||
End Sub
|
||||
|
||||
@@ -58,8 +65,8 @@ Partial Class GPS_RepPuntosDeInteres
|
||||
RegistraScript("$('#dvConsulta').modal('hide');", "00")
|
||||
End Sub
|
||||
|
||||
Private Sub ReportePuntos(Dispositivos As String)
|
||||
Dim GPS As New ClsGPS
|
||||
Private Sub ReportePuntos(Dispositivos As String)
|
||||
|
||||
Dim FechaI, FechaF As Date
|
||||
Dim SBBody As New StringBuilder
|
||||
Dim CoordsPoligono = ""
|
||||
@@ -70,35 +77,48 @@ Partial Class GPS_RepPuntosDeInteres
|
||||
Dim GeoCercas = ""
|
||||
Dim Color = ""
|
||||
FechaI = If(txtFechaI.Text.Trim = "", MinFecha, txtFechaI.Text.Trim.ToDate)
|
||||
FechaF = If(txtFechaF.Text.Trim = "", MaxFecha, txtFechaF.Text.Trim.ToDate)
|
||||
For Each row As GridViewRow In GvPuntos.Rows
|
||||
SBBody.Clear()
|
||||
If row.FCCheckBox("chkGR").Checked Then
|
||||
If GPS.RepPuntosGet(row.DataKey("CvePuntoDeInteres").ToEntero, Dispositivos, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime, UsuarioActual.CveCliente) Then
|
||||
Coords = SQLToGmaps(row.DataKey("Punto").ToString, "POINT")
|
||||
SBBody.Append($"<div>")
|
||||
SBBody.Append($"<div><h5><b> Punto: {row.DataKey("PuntoDeInteres")}</b></h5></div>")
|
||||
FechaF = If(txtFechaF.Text.Trim = "", MaxFecha, txtFechaF.Text.Trim.ToDate)
|
||||
|
||||
Dim ObjGPS As New ClsGPS
|
||||
Try
|
||||
For Each row As GridViewRow In GvPuntos.Rows
|
||||
SBBody.Clear()
|
||||
If row.FCCheckBox("chkGR").Checked Then
|
||||
If ObjGPS.RepPuntosGet(row.DataKey("CvePuntoDeInteres").ToEntero, Dispositivos, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime, UsuarioActual.CveCliente) Then
|
||||
|
||||
DtDatosReporte = ObjGPS.DtResultados.Copy()
|
||||
GvBarra.DataSource = DtDatosReporte
|
||||
|
||||
Coords = SQLToGmaps(row.DataKey("Punto").ToString, "POINT")
|
||||
SBBody.Append($"<div>")
|
||||
SBBody.Append($"<div><h5><b> Punto: {row.DataKey("PuntoDeInteres")}</b></h5></div>")
|
||||
|
||||
If ObjGPS.DtResultados.Rows.Count > 0 Then
|
||||
Color = "#26C281"
|
||||
SBBody.Append($"<div><table>")
|
||||
For Each Cve As String In DispositivosLista
|
||||
If ObjGPS.DtResultados.FiltraParametros($"CveDispositivo = {Cve} ").Rows.Count > 0 Then
|
||||
SBBody.Append($"<tr><td><b>{ObjGPS.DtResultados.FiltroPrimeroValor("Vehiculo", $"CveDispositivo = {Cve}")}:</b> <a onclick=""CargaGV({Cve}, {row.DataKey("CvePuntoDeInteres")} )"">{ObjGPS.DtResultados.FiltroPrimeroValor("Visitas", $"CveDispositivo = {Cve}")} visitas<a></td></tr>")
|
||||
SBBody.Append($"<tr><td>Última Visita: {ObjGPS.DtResultados.FiltroPrimeroValor("UltimaVisita", $"CveDispositivo = {Cve}")}</td></tr>")
|
||||
End If
|
||||
Next
|
||||
SBBody.Append($"</table></div>")
|
||||
Else
|
||||
Color = "#e82929"
|
||||
SBBody.Append($"<tr><td><b>Este punto de interés no fue visitado en las fechas seleccionadas.</b></td></tr>")
|
||||
End If
|
||||
SBBody.Append($"</div>")
|
||||
RegistraScript($"CreaCirculo({Coords},'{Color}');CreaMarcador({Coords},'{row.DataKey("PuntoDeInteres")}','{SBBody.ToString}');", row.DataKey("CvePuntoDeInteres"))
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al consultar los puntos de interes", ex)
|
||||
End Try
|
||||
|
||||
If GPS.DtResultados.Rows.Count > 0 Then
|
||||
Color = "#26C281"
|
||||
SBBody.Append($"<div><table>")
|
||||
For Each Cve As String In DispositivosLista
|
||||
If GPS.DtResultados.FiltraParametros($"CveDispositivo = {Cve} ").Rows.Count > 0 Then
|
||||
SBBody.Append($"<tr><td><b>{GPS.DtResultados.FiltroPrimeroValor("Vehiculo", $"CveDispositivo = {Cve}")}:</b> <a onclick=""CargaGV({Cve}, {row.DataKey("CvePuntoDeInteres")} )"">{GPS.DtResultados.FiltroPrimeroValor("Visitas", $"CveDispositivo = {Cve}")} visitas<a></td></tr>")
|
||||
SBBody.Append($"<tr><td>Última Visita: {GPS.DtResultados.FiltroPrimeroValor("UltimaVisita", $"CveDispositivo = {Cve}")}</td></tr>")
|
||||
End If
|
||||
Next
|
||||
SBBody.Append($"</table></div>")
|
||||
Else
|
||||
Color = "#e82929"
|
||||
SBBody.Append($"<tr><td><b>Este punto de interés no fue visitado en las fechas seleccionadas.</b></td></tr>")
|
||||
End If
|
||||
SBBody.Append($"</div>")
|
||||
RegistraScript($"CreaCirculo({Coords},'{Color}');CreaMarcador({Coords},'{row.DataKey("PuntoDeInteres")}','{SBBody.ToString}');", row.DataKey("CvePuntoDeInteres"))
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
GPS.Dispose()
|
||||
ObjGPS.Dispose()
|
||||
GvBarra.DataBind()
|
||||
UPGV.Update()
|
||||
End Sub
|
||||
|
||||
'If GPS.GeoReferenciasEntradasSalidas(GVRow.DataKey("CveDispositivo").ToString.ToEntero, row.DataKey("CveGeoReferencia").ToString.ToEntero, FechaI, FechaF) Then
|
||||
@@ -152,5 +172,41 @@ Partial Class GPS_RepPuntosDeInteres
|
||||
GVHistorico.DataBind()
|
||||
UpdatePanel3.Update()
|
||||
RegistraScript("$('#dvHistorico').modal()")
|
||||
End Sub
|
||||
|
||||
'Protected Sub GvBarra_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvBarra.RowDataBound
|
||||
' If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
' Dim RowID As String = $"row{e.Row.RowIndex}"
|
||||
' e.Row.Attributes("id") = RowID
|
||||
' Dim IndexGvBarra As Integer = If(String.IsNullOrEmpty(HdnIndexGvBarra.Value), -1, HdnIndexGvBarra.Value.ToEntero)
|
||||
|
||||
' RegistraScript($"GetDireccionesGV({e.Row.DBCampo("Posicion").ToString}, {e.Row.RowIndex}, 1);", $"{RowID}")
|
||||
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
Protected Sub btnImprimir_Click(sender As Object, e As EventArgs)
|
||||
Dim Btn As Button = CType(sender, Button)
|
||||
Dim Format = Btn.CommandArgument
|
||||
EnviarReporteProgramado(Format)
|
||||
|
||||
End Sub
|
||||
Public Sub EnviarReporteProgramado(Format As String)
|
||||
Dim RutaReporte = "Empresas/Grales/ReportesProgramados/RPTPuntosInteres.rdlc"
|
||||
Dim NombreReporte = "ReportePuntosInteres"
|
||||
|
||||
Try
|
||||
Dim RptParametro As New List(Of ReportParameter)
|
||||
RptParametro.Add(New ReportParameter("FechaInicio", txtFechaI.Text))
|
||||
RptParametro.Add(New ReportParameter("FechaFin", txtFechaF.Text))
|
||||
RptParametro.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
|
||||
RptParametro.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString))
|
||||
|
||||
Dim retorno = StreamPDF(RutaReporte, DtDatosReporte, RptParametro, $"{NombreReporte}{Date.Now.ToShortDateString}", Format, MR:=Nothing, RDSName:="DsOC")
|
||||
|
||||
ImprimirbytesPDF(retorno, $"{NombreReporte}{Date.Now.ToShortDateString}", Format)
|
||||
Catch ex As Exception
|
||||
GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
|
||||
End Try
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -620,6 +620,9 @@
|
||||
Dim EmpresaNotificaciones As New Empresa With {.SendMail = "signotificaciones@adssistemas.mx", .SendMailPassword = "sig123987", .SendMailServer = "mail.adssistemas.mx", .SendMailPuerto = 587}
|
||||
ClsPaginas.EmpresaNotificaciones = EmpresaNotificaciones
|
||||
|
||||
Dim EmpresaNotificacionesGPS As New Empresa With {.SendMail = "ALERTAS@SIGNALSGPS.com", .SendMailPassword = "STJ180705IV42021ad", .SendMailServer = "mail.signalsgps.com", .SendMailPuerto = 587}
|
||||
ClsPaginas.EmpresaNotificacionesGPS = EmpresaNotificacionesGPS
|
||||
|
||||
|
||||
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
'I M P U E S T O S L O C A L E S
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -934,7 +934,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
If Not ErrorMovInv Then
|
||||
|
||||
'VIRTUAL ENTRADA
|
||||
If RealizarMovimientoVirtual Then
|
||||
If RealizarMovimientoVirtual AndAlso CveAlmacenVirtualEntrada > 0 Then
|
||||
|
||||
Dim dtvirtual As DataTable = Nothing
|
||||
|
||||
@@ -963,6 +963,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim Concepto As String = TxtObservaciones.Text
|
||||
If Concepto = "" Then Concepto = "Traspaso"
|
||||
'AGREGAMOS PREPOLIZAS TRASPASO DIRECTO:
|
||||
@@ -1743,7 +1744,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
|
||||
CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=ImporteDecimal) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un erro al cancelar el traspaso"
|
||||
TextoError = "Ocurrió un error al cancelar el traspaso"
|
||||
End If
|
||||
|
||||
'If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
|
||||
@@ -1925,10 +1926,10 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=importe, Contabilizable:=False) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
@@ -2857,7 +2858,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
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 excelFile As ExcelFile = excelFile.Load(flatFilePath)
|
||||
|
||||
Dim unnamed As Integer = 0
|
||||
Dim cols As Integer
|
||||
@@ -2967,7 +2968,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Else
|
||||
Str = String.Format(" AND CveSubProyecto = {0} ", DrAlmO("CveSubProyecto"))
|
||||
End If
|
||||
DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros(String.Format(" CveTipoAlmacen NOT IN (3,4,9,10,11,24,28) AND Estatus = 'Activo' {0} ", Str))
|
||||
DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros(String.Format(" CveTipoAlmacen NOT IN (3,4,9,10,11,24,25,28) AND Estatus = 'Activo' {0} ", Str))
|
||||
DdlAlmacenDestino.DataBind()
|
||||
DdlAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
|
||||
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()
|
||||
|
||||
@@ -22,7 +22,8 @@ Partial Class PopUpSeleccionarEmpresa
|
||||
If Dt IsNot Nothing Then
|
||||
If Dt.Rows.Count > 0 Then
|
||||
Dim NumRegistros As Integer = 0
|
||||
GvEmpresas.DataSource = Dt.FiltraParametros("(CvePlataforma = 1 OR (CvePlataforma = 3 AND CveCliente IS NULL)) AND CvePlataformaUsuario NOT IN (6,7)", "Empresa")
|
||||
GvEmpresas.DataSource = Dt.FiltraParametros("(CvePlataforma = 1 OR (CvePlataforma = 3 AND CveCliente IS NULL)) AND CvePlataformaUsuario NOT IN (6,7)", "Empresa", {"CveEmpresa", "Empresa", "CveUsuario", "Contraseña", "Usuario"})
|
||||
'GvEmpresas.DataSource = Dt.FiltraParametros("(CvePlataforma = 1 OR (CvePlataforma = 3 AND CveCliente IS NULL)) AND CvePlataformaUsuario NOT IN (6,7)", "Empresa")
|
||||
NumRegistros += DirectCast(GvEmpresas.DataSource, System.Data.DataTable).Rows.Count
|
||||
|
||||
GvPortalRastreo.DataSource = Dt.FiltraParametros("CvePlataforma = 3 AND CveCliente IS NOT NULL", "Empresa")
|
||||
|
||||
@@ -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 Motivo de Baja Registrados" 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()
|
||||
@@ -42,13 +71,14 @@ Partial Class CatMetasVendedores
|
||||
DdlMarcas.DataBind()
|
||||
DdlMarcas.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
|
||||
DdlClasificacionSup.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
|
||||
DdlClasificacionSup.DataBind()
|
||||
DdlClasificacionSup.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa)
|
||||
DdlClasificacion.DataBind()
|
||||
DdlClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
DdlClasificacionSup.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
|
||||
DdlClasificacionSup.DataBind()
|
||||
DdlClasificacionSup.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkAgregar_Click() Handles LnkAgregar.Click
|
||||
@@ -100,8 +130,10 @@ Partial Class CatMetasVendedores
|
||||
CveMetaVendedor = GvRow.DataKey("CveMeta").ToEntero
|
||||
DdlVendedores.SelectedValue = GvRow.DataKey("CveVendedor")
|
||||
TxtFechaI.Text = GvRow.DataKey("MesAño")
|
||||
DdlClasificacionSup.SelectedValue = GvRow.DataKey("CveClasificacionSup")
|
||||
DdlClasificacion.SelectedValue = GvRow.DataKey("CveClasificacion")
|
||||
|
||||
DdlClasificacionSup.SelectedValueExist(GvRow.DataKey("CveClasificacionSup"))
|
||||
DdlClasificacion.SelectedValueExist(GvRow.DataKey("CveClasificacion"))
|
||||
|
||||
DdlMarcas.SelectedValue = GvRow.DataKey("CveMarca")
|
||||
TxtMetaCantidad.Text = GvRow.DataKey("MetaCantidad")
|
||||
TxtMetaImporte.Text = GvRow.DataKey("MetaImporte")
|
||||
@@ -119,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
|
||||
|
||||
@@ -154,6 +154,11 @@
|
||||
<asp:Label ID="lblRealMes" runat="server" Target="_blank" Text='<%# Eval("RealMes").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Real Mes %" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblRealMesPorcentaje" runat="server" Target="_blank" Text='<%# Eval("RealMesPorcentaje").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Venta Mes Año Anterior" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblVtaMesAA" runat="server" Target="_blank" Text='<%# Eval("VtaMesAA").ToString() %>'> </asp:Label>
|
||||
@@ -164,14 +169,24 @@
|
||||
<asp:Label ID="lblObjMes" runat="server" Target="_blank" Text='<%# Eval("ObjMes").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Var Mes A.A" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblVarMesAA" runat="server" Target="_blank" Text='<%# Eval("VarMesAA").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Var Mes Obj" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblVarMesObj" runat="server" Target="_blank" Text='<%# Eval("VarMesObj").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Real Acumulado" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblRealAcumulado" runat="server" Target="_blank" Text='<%# Eval("RealAcumulado").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Real Mes Porcentaje" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="Real Acumulado %" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblRealMesPorcentaje" runat="server" Target="_blank" Text='<%# Eval("RealMesPorcentaje").ToString() %>'> </asp:Label>
|
||||
<asp:Label ID="lblRealAcumuladoPorcentaje" runat="server" Target="_blank" Text='<%# Eval("RealAcumuladoPorcentaje").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="A. Ant. Acumulado" ItemStyle-HorizontalAlign="Center">
|
||||
@@ -184,11 +199,11 @@
|
||||
<asp:Label ID="lblObjAcumulado" runat="server" Target="_blank" Text='<%# Eval("ObjAcumulado").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="%Var vs AA" ItemStyle-HorizontalAlign="Center">
|
||||
<%-- <asp:TemplateField HeaderText="%Var vs AA" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblVarVSAAPerc" runat="server" Target="_blank" Text='<%# Eval("VarVSAAPerc").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</asp:TemplateField>--%>
|
||||
<asp:TemplateField HeaderText="Var vs AA" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblVarVSAA" runat="server" Target="_blank" Text='<%# Eval("VarVSAA").ToString() %>'> </asp:Label>
|
||||
|
||||
@@ -47,7 +47,7 @@ Partial Class MetasVendedores
|
||||
DdlClasificaciones.DataBind()
|
||||
DdlClasificaciones.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
DdlClasificacion2.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
|
||||
DdlClasificacion2.DataSource = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa)
|
||||
DdlClasificacion2.DataBind()
|
||||
DdlClasificacion2.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
@@ -75,26 +75,28 @@ Partial Class MetasVendedores
|
||||
|
||||
Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.FCLabel("lblRealMesPorcentaje").Text = String.Format("{0}{1}", e.Row.FCLabel("lblRealMesPorcentaje").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"
|
||||
e.Row.FCLabel("lblRealMesPorcentaje").Text = String.Format("{0}{1}", e.Row.FCLabel("lblRealMesPorcentaje").Text, "%")
|
||||
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.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
|
||||
|
||||
|
||||
@@ -3493,9 +3493,8 @@
|
||||
</tr>
|
||||
<tr align="left" id="TrKilometraje" runat="server" visible="false">
|
||||
<td>Kilometraje
|
||||
<asp:TextBox ID="TxtKilometraje" runat="server" Width="250px" CssClass="form-control input-sm" MaxLength="7" ></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="ftkm" runat="server" TargetControlID="TxtKilometraje" FilterType="Custom, Numbers" ValidChars="+-.," />
|
||||
|
||||
<asp:TextBox ID="TxtKilometraje" runat="server" Width="250px" CssClass="form-control input-sm" MaxLength="6" CausesValidation="true" Text="000000"></asp:TextBox>
|
||||
<ajax:MaskedEditExtender ID="MEEKilometraje" runat="server" TargetControlID="TxtKilometraje" ClearMaskOnLostFocus="false" MaskType="Number" Mask="999999" MessageValidatorTip="true" InputDirection="LeftToRight" ErrorTooltipEnabled="True"></ajax:MaskedEditExtender>
|
||||
</td>
|
||||
</tr>
|
||||
<tr align="left" id="trCorreoNotif1" runat="server" visible="false">
|
||||
|
||||
@@ -1290,6 +1290,15 @@ Partial Class Ventas
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveVentaUsadoDevolucionEfectivo As Integer
|
||||
Get
|
||||
Return If(IsNothing(ViewState("CveVentaUsadoDevolucionEfectivo")), 0, CType(ViewState("CveVentaUsadoDevolucionEfectivo"), Integer))
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveVentaUsadoDevolucionEfectivo") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "Propiedades PuntoVenta"
|
||||
@@ -5450,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
|
||||
|
||||
|
||||
@@ -6232,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)
|
||||
@@ -7236,6 +7249,13 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(558).ToEntero() = 1 AndAlso TrKilometraje.Visible Then
|
||||
If TxtKilometraje.Text.Length < 6 Then
|
||||
Alert("El kilometraje debe tener 6 digitos.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
'CUANDO ES COTIZACION Y SE VA A FACTURAR SE HACE INGRESO
|
||||
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso BtnEmitirImprimir.Text = "Facturar" Then
|
||||
DdlTipoComprobante.SelectedValue = "Ing"
|
||||
@@ -10774,6 +10794,13 @@ Partial Class Ventas
|
||||
Me.AplicaRelacionManual = False
|
||||
End If
|
||||
|
||||
'SI SE SELECCIONO UNA FACTURA PARA DEVOLUCION DE EFECTIVO DEBE ASOCIARLA A LA NOTA DE CREDITO
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso factura.TipoDocto = "Egs" AndAlso Me.CveVentaUsadoDevolucionEfectivo > 0 Then
|
||||
If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, CveVentaUsadoDevolucionEfectivo) Then
|
||||
ErrorList.Add("Ocurrió un error al relacionar la venta de devolución de efectivo entre si.")
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(280) = "1" And RblPaqueteria.SelectedValue = "1" And Not factura.TipoDocto.Contiene("Rem", "Ped") Then
|
||||
NotificarPaqueteria()
|
||||
End If
|
||||
@@ -12728,7 +12755,7 @@ Partial Class Ventas
|
||||
|
||||
'EN CASO DE SER REFACTURACION DE ANTICIPO SE ACTUALIZAN LAS VENTAS APLICADAS HACIA EL NUEVO
|
||||
If NuevaFactura = 1 AndAlso CveDevolucion > 0 AndAlso ObjFactura.TipoDocto.Contiene("Ant") Then
|
||||
If Not ObjVentas.TraspasaVentasAplicadasAnt(ObjFactura.CveVenta, CveDevolucion, UsuarioActual.CveEmpresa) Then
|
||||
If Not ObjVentas.TraspasaVentasAplicadasAnt(ObjFactura.CveVenta, CveDevolucion, UsuarioActual.CveEmpresa, ObjFactura.CvePrePoliza) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
@@ -19123,7 +19150,7 @@ Partial Class Ventas
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Dev", "Egs") Then
|
||||
Dim sb As New StringBuilder()
|
||||
|
||||
If Not String.IsNullOrEmpty(FolioFiscal) Then
|
||||
If Not String.IsNullOrEmpty(FolioFiscal) AndAlso Not (UsuarioActual.Empresa.Funcionalidad(529) = "1") Then
|
||||
sb.Append("La factura se encuentra en el siguiente estatus del SAT:<br/>")
|
||||
|
||||
Dim TotalT As Decimal = TxtTotal.Text.ToDecimal
|
||||
@@ -21382,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
|
||||
@@ -24675,9 +24702,14 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
'SOLO APLICA SI NO HAY DOCUMENTOS QUE SELECCIONAR
|
||||
If UsuarioActual.CveEmpresa = 140 Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
If GvCxC.Rows.Count = 0 OrElse GvCxC.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("ChkCxC").Checked) = 0 Then
|
||||
Alert("No se ha seleccionado ninguna factura, en caso de no seleccionar ninguna se creará una nueva nota de crédito. ¿Está seguro de realizar esta acción?", TipoMensaje.MsgConfirmacion, JSBtnAceptar:="BtnAplicaNuevaNC();", TextoConfirmacion:=" Si ", TextoCancelacion:=" No ")
|
||||
If ClienteEsDistribuidor AndAlso TxtImportesRemisionesNC.Text.ToDecimal() > 0 Then
|
||||
Alert("No se puede generar una nota de crédito para devolución de efectivo si el cliente es distribuidor.", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
Alert("No se ha seleccionado ninguna factura, en caso de no seleccionar ninguna se creará una nueva nota de crédito. ¿Está seguro de realizar esta acción?", TipoMensaje.MsgConfirmacion, JSBtnAceptar:="BtnAplicaNuevaNC();", TextoConfirmacion:=" Si ", TextoCancelacion:=" No ")
|
||||
End If
|
||||
|
||||
Else
|
||||
AplicarNotaCreditoDesdeVenta()
|
||||
End If
|
||||
@@ -24694,6 +24726,8 @@ Partial Class Ventas
|
||||
Private Sub AplicarNotaCreditoDesdeVenta(Optional AplicaNuevoDocumento As Boolean = False)
|
||||
RegistraScript("$('#ModalAplicarNC').modal('hide');", "EscondeModalNC")
|
||||
|
||||
CveVentaUsadoDevolucionEfectivo = -1
|
||||
|
||||
DdlTipoComprobante.SelectedValue = "Egs"
|
||||
Dim AplicaImpuestosLocales As Boolean = False
|
||||
|
||||
@@ -24722,6 +24756,11 @@ Partial Class Ventas
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
'SI SE SELECCIONO UNA FACTURA PARA DEVOLUCION DE EFECTIVO DEBE ASOCIARLA A LA NOTA DE CREDITO
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso AplicaNuevoDocumento AndAlso DdlVentaUsado.SelectedValue.ToEntero() > 0 AndAlso TxtImportesRemisionesNC.Text.ToDecimal() > 0 Then
|
||||
CveVentaUsadoDevolucionEfectivo = DdlVentaUsado.SelectedValue.ToEntero()
|
||||
End If
|
||||
|
||||
AplicarNC(DdlNCPS.SelectedValue.ToEntero(), EsNCAmortizacion:=ChkAplicaNCAnticipo.Checked, AplicaImpuestosLocales:=AplicaImpuestosLocales, AplicaNuevoDocumento:=AplicaNuevoDocumento, AplicoNCFacturaActual:=True)
|
||||
|
||||
End Sub
|
||||
@@ -26462,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)
|
||||
@@ -26532,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()
|
||||
@@ -26555,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()
|
||||
@@ -26625,6 +26675,7 @@ Partial Class Ventas
|
||||
If Not DtCotizaciones.Columns.Contains("Aplicado") Then
|
||||
DtCotizaciones.Columns.Add("Aplicado", Type.GetType("System.Boolean"))
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
GvCotPS.DataSource = DtCotizaciones.FiltraParametros("Cantidad > 0 AND EsAcumulador = False")
|
||||
Else
|
||||
@@ -26687,6 +26738,9 @@ Partial Class Ventas
|
||||
Dim Cves As New StringBuilder
|
||||
Dim CveMetodoPago As Integer = -1
|
||||
Dim MetodoPagoDif As Boolean = False
|
||||
|
||||
Dim ListaVentaDetalleCotizacion As List(Of MVentaDetalleCotizacion) = Nothing
|
||||
|
||||
If ChkCotProductos.Checked Then
|
||||
For Each row As DataRow In DTSeleccionadas.Rows
|
||||
If CveMetodoPago <> -1 And row("CveMetodoPago33").ToString().ToEntero() <> CveMetodoPago Then
|
||||
@@ -26699,8 +26753,9 @@ Partial Class Ventas
|
||||
CotizacionesLista.Add(row("CveVenta").ToString().ToEntero())
|
||||
Next
|
||||
|
||||
'CARGA LOS USADOS RELACIONADOS A LOS PRODUCTOS SELECCIONADOS DE LA COTIZACION
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
CalculaUsadosCotizacion(Cves, DTSeleccionadas, DtCotizaciones)
|
||||
ListaVentaDetalleCotizacion = CalculaUsadosCotizacion(Cves, DTSeleccionadas, DtCotizaciones)
|
||||
End If
|
||||
|
||||
Else
|
||||
@@ -26726,6 +26781,18 @@ Partial Class Ventas
|
||||
ObjClientes.Dispose()
|
||||
Cves.Clear()
|
||||
|
||||
'SI SE CALCULARON USADOS LA CANTIDAD DEBE ASIGNARSE A PARTIR DEL CALCULO
|
||||
If ListaVentaDetalleCotizacion IsNot Nothing AndAlso ListaVentaDetalleCotizacion.Count > 0 Then
|
||||
|
||||
For Each Dr As DataRow In DtCotizacionesPS.Rows
|
||||
Dim VentaDetalle = ListaVentaDetalleCotizacion.FirstOrDefault(Function(cot) cot.CveVentaDetalle = Dr("CveVentaDetalle").ToString().ToEntero())
|
||||
If VentaDetalle IsNot Nothing Then
|
||||
Dr("Cantidad") = VentaDetalle.Cantidad
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
If Not AgregaPSCotizacion() Then
|
||||
Alert("Ocurrió un error validar las partidas de las cotizaciones seleccionadas. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
@@ -26747,74 +26814,88 @@ Partial Class Ventas
|
||||
UpPS.Update()
|
||||
UpParametros.Update()
|
||||
End Sub
|
||||
Private Class MVentaDetalleCotizacion
|
||||
Public Property CveVentaDetalle As Integer
|
||||
Public Property Cantidad As Decimal
|
||||
End Class
|
||||
|
||||
Private Sub CalculaUsadosCotizacion(ByRef SbVentasDetalle As StringBuilder, ByVal DTSeleccionadas As DataTable, ByVal DtCotizaciones As DataTable)
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Cot", "Dev") Then
|
||||
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)
|
||||
|
||||
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"})
|
||||
|
||||
Dim TmpDTCalculo As DataRow() = DTSeleccionadas.Rows.Cast(Of DataRow).ToArray()
|
||||
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
|
||||
|
||||
Dim DTPSTemp As New DataTable '= TmpDT.Clone
|
||||
Retorno.Add(New MVentaDetalleCotizacion() With {.CveVentaDetalle = Dr("CveVentaDetalle").ToString().ToEntero(), .Cantidad = tCantidad})
|
||||
|
||||
DTPSTemp.Columns.Add("CveVenta", GetType(Integer))
|
||||
DTPSTemp.Columns.Add("Cantidad", GetType(Integer))
|
||||
DTPSTemp.Columns.Add("CvePS", GetType(Integer))
|
||||
DTPSTemp.Columns.Add("PU", GetType(Decimal))
|
||||
Next
|
||||
|
||||
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 TmpDTCalculo As DataRow() = DTSeleccionadas.Rows.Cast(Of DataRow).ToArray()
|
||||
|
||||
If CveTamanioTemp > 0 Then
|
||||
Dim DTPSTemp As New DataTable '= TmpDT.Clone
|
||||
|
||||
Dim DTTamanioTemp As New DataTable
|
||||
Dim CvePsTemp As Integer = DTTamanios.FiltraParametros($"CveTamaño = { CveTamanioTemp } ").Rows(0)("CvePSCargo").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))
|
||||
|
||||
Dim Cargo As Decimal = DTTamanios.FiltroPrimeroValor("Cargo", $" CveTamaño = { CveTamanioTemp }").ToDecimal
|
||||
For Each DrowPartidas As DataRow In TmpDTCalculo
|
||||
Dim CveTamanioTemp As Integer = DrowPartidas("CveTamaño").ToString().ToEntero()
|
||||
Dim CveVenta As Integer = DrowPartidas("CveVenta").ToString().ToEntero()
|
||||
|
||||
If DTPSTemp.FiltraParametros($"CvePs = { CvePsTemp }").Rows.Count > 0 Then
|
||||
If CveTamanioTemp > 0 Then
|
||||
|
||||
For Each dRowUpdate As DataRow In DTPSTemp.Rows
|
||||
Dim DTTamanioTemp As New DataTable
|
||||
Dim CvePsTemp As Integer = DTTamanios.FiltraParametros($"CveTamaño = { CveTamanioTemp } ").Rows(0)("CvePSCargo").ToString().ToEntero()
|
||||
|
||||
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
|
||||
Dim Cargo As Decimal = DTTamanios.FiltroPrimeroValor("Cargo", $" CveTamaño = { CveTamanioTemp }").ToDecimal
|
||||
|
||||
DTPSTemp.AcceptChanges()
|
||||
If DTPSTemp.FiltraParametros($"CvePs = { CvePsTemp }").Rows.Count > 0 Then
|
||||
|
||||
Else
|
||||
Dim dRowNuevo As DataRow = DTPSTemp.NewRow
|
||||
For Each dRowUpdate As DataRow In DTPSTemp.Rows
|
||||
|
||||
dRowNuevo("CvePS") = CvePsTemp
|
||||
dRowNuevo("Cantidad") = DrowPartidas("Cantidad").ToString().ToDecimal
|
||||
dRowNuevo("PU") = Cargo
|
||||
dRowNuevo("CveVenta") = CveVenta
|
||||
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
|
||||
|
||||
DTPSTemp.Rows.Add(dRowNuevo)
|
||||
DTPSTemp.AcceptChanges()
|
||||
End If
|
||||
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
|
||||
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
|
||||
|
||||
End If
|
||||
Next
|
||||
Dim CveVentaDetalleUsado = DtCotizaciones.FiltroPrimeroValor("CveVentaDetalle", $"CveVenta = {drowPsTamaños("CveVenta")} AND CvePS = {drowPsTamaños("CvePS")}").ToEntero()
|
||||
SbVentasDetalle.AppendFormat("{0},", CveVentaDetalleUsado)
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Retorno.Add(New MVentaDetalleCotizacion() With {.CveVentaDetalle = CveVentaDetalleUsado, .Cantidad = drowPsTamaños("Cantidad").ToString().ToDecimal()})
|
||||
|
||||
End If
|
||||
Next
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Private Sub VerificaCotizaciones(ByRef dt As DataTable)
|
||||
If ChkCotProductos.Checked Then
|
||||
For Each Gvr As GridViewRow In GvCotPS.Rows
|
||||
@@ -26860,7 +26941,12 @@ Partial Class Ventas
|
||||
If DtCotizacionesPS IsNot Nothing Then
|
||||
Dim tCantidad As Decimal = 0
|
||||
For Each Dr As DataRow In DtCotizacionesPS.Select()
|
||||
tCantidad = If(ChkCotProductos.Checked, GvCotPS.Rows(IndiceGVCotDataKey(GvCotPS, Dr("CveVentaDetalle").ToString())).FCTextBox("TxtCantidadCot").Text.ToDecimal, Dr("Cantidad")).ToString().ToDecimal
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
tCantidad = Dr("Cantidad").ToString().ToDecimal()
|
||||
Else
|
||||
tCantidad = If(ChkCotProductos.Checked, GvCotPS.Rows(IndiceGVCotDataKey(GvCotPS, Dr("CveVentaDetalle").ToString())).FCTextBox("TxtCantidadCot").Text.ToDecimal, Dr("Cantidad")).ToString().ToDecimal
|
||||
End If
|
||||
|
||||
AgregarProductoServicio(tCantidad, Dr("CveUM").ToString().ToEntero(), Dr("UM").ToString(), Dr("CveClasificacion").ToString().ToEntero(), Dr("Clasificacion").ToString(),
|
||||
Dr("CvePS").ToString().ToEntero(), Dr("PS").ToString(), Dr("Obs").ToString(), Dr("PU").ToString().ToDecimal, Dr("Descuento").ToString().ToDecimal,
|
||||
Dr("CveProyecto").ToString().ToEntero(), Dr("Proyecto").ToString(), Dr("CveSubProyecto").ToString().ToEntero(), Dr("SubProyecto").ToString(),
|
||||
|
||||
Reference in New Issue
Block a user