This commit is contained in:
2024-10-23 10:49:09 -07:00
14 changed files with 158 additions and 107 deletions

View File

@@ -294,7 +294,9 @@ Partial Class AF_CatAF
GvDatos.DataSource = DtActivosFijos GvDatos.DataSource = DtActivosFijos
GvDatos.DataBind() GvDatos.DataBind()
LtlTotalRegistros.Text = DtActivosFijos.Rows.Count.ToString.FormatoNumero(0) If DtActivosFijos IsNot Nothing Then
LtlTotalRegistros.Text = DtActivosFijos.Rows.Count.ToString.FormatoNumero(0)
End If
UpGV.Update() UpGV.Update()
OrdenaDatos() OrdenaDatos()

View File

@@ -197,7 +197,12 @@ Public Class ClsContratos
#End Region #End Region
#Region " C O N T R A T O S " #Region " C O N T R A T O S "
Public Function GetContratosReporte(CveEmpresa As Integer, FechaInicial As DateTime, FechaFinal As DateTime, CveCliente As Integer, Optional CveEstatus As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional CveTipoAF As Integer = -1, Optional CveChofer As Integer = -1, Optional CveTipoContrato As Integer = -1) As Boolean Public Function GetContratosReporte(CveEmpresa As Integer, FechaInicial As DateTime, FechaFinal As DateTime, CveCliente As Integer,
Optional CveEstatus As Integer = -1, Optional CveSubProyecto As Integer = -1,
Optional CveTipoAF As Integer = -1, Optional CveChofer As Integer = -1,
Optional CveTipoContrato As Integer = -1,
Optional FechaInicioIngreso As DateTime = MinFecha,
Optional FechaFinIngreso As DateTime = MaxFecha) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Con_ContratosReporteGet") DataAdapter("PA_Con_ContratosReporteGet")
@@ -210,7 +215,9 @@ Public Class ClsContratos
.Add("@CveTipoAF", SqlDbType.Int).Value = CveTipoAF .Add("@CveTipoAF", SqlDbType.Int).Value = CveTipoAF
.Add("@CveChofer", SqlDbType.Int).Value = CveChofer .Add("@CveChofer", SqlDbType.Int).Value = CveChofer
.Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato .Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@FechaInicioIngreso", SqlDbType.DateTime).Value = FechaInicioIngreso
.Add("@FechaFinIngreso", SqlDbType.DateTime).Value = FechaFinIngreso
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -1352,7 +1352,11 @@ Public Class ClsInventarios
OnError(String.Format("El producto '{0}' con la serie: '{1}' ya fue ingresado previamente.", Ex1.Message.GetTagValue("codigops"), Serie), Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) OnError(String.Format("El producto '{0}' con la serie: '{1}' ya fue ingresado previamente.", Ex1.Message.GetTagValue("codigops"), Serie), Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End If End If
Else Else
Me.OnError("Ocurrió un error al guardar los detalles del movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) If Ex1.Message.Contains("50023") Then
Me.OnError(String.Format(" La Serie '{0}' ya se encuentra registrada.", Serie), Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Else
Me.OnError("Ocurrió un error al guardar los detalles del movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
End If End If
End If End If
Catch ex As Exception Catch ex As Exception

View File

@@ -755,6 +755,68 @@ Namespace Extensiones
End Try End Try
Return Retorno Return Retorno
End Function End Function
Public Function EnviarNotificacionWhatsApp2(NumeroTelefono As String, NombreUsuario As String, Mensaje As String) As Boolean
Dim RetornoObj As String = "{}"
Dim Retorno As Boolean = False
Try
Dim TokenAutorizacion As String = $"Bearer {WhatsAppToken}"
Using httpClient = New HttpClient()
Using request = New HttpRequestMessage(HttpMethod.Post, New Uri("https://graph.facebook.com/v20.0/425866980604901/messages"))
request.Headers.Add("Authorization", TokenAutorizacion)
Dim json = New Newtonsoft.Json.Linq.JObject()
json.Add(New Newtonsoft.Json.Linq.JProperty("messaging_product", "whatsapp"))
json.Add(New Newtonsoft.Json.Linq.JProperty("to", NumeroTelefono))
json.Add(New Newtonsoft.Json.Linq.JProperty("type", "template"))
Dim plantilla As New Newtonsoft.Json.Linq.JObject(
New Newtonsoft.Json.Linq.JProperty("name", "textolibre"),
New Newtonsoft.Json.Linq.JProperty("language",
New Newtonsoft.Json.Linq.JObject(
New Newtonsoft.Json.Linq.JProperty("code", "es_MX")
)
),
New Newtonsoft.Json.Linq.JProperty("components",
New Newtonsoft.Json.Linq.JArray(
New Newtonsoft.Json.Linq.JObject(
New Newtonsoft.Json.Linq.JProperty("type", "body"),
New Newtonsoft.Json.Linq.JProperty("parameters",
New Newtonsoft.Json.Linq.JArray(
New Newtonsoft.Json.Linq.JObject(
New Newtonsoft.Json.Linq.JProperty("type", "text"),
New Newtonsoft.Json.Linq.JProperty("text", Mensaje)
)
)
)
)
)
)
)
json.Add(New Newtonsoft.Json.Linq.JProperty("template", plantilla))
Using content = New StringContent(json.ToString, Encoding.UTF8, "application/json")
request.Content = content
Dim response = httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).Result
If response.StatusCode = Net.HttpStatusCode.OK Then
RetornoObj = response.Content.ReadAsStringAsync().Result
Retorno = True
End If
End Using
End Using
End Using
Catch ex As Exception
RetornoObj = New Newtonsoft.Json.Linq.JObject(New Newtonsoft.Json.Linq.JProperty("Error", ex.ToString())).ToString()
GuardaLog("Ocurrió un error al enviar la informacion por whatsapp" & ex.Message)
End Try
Return Retorno
End Function
#End Region #End Region

View File

@@ -1987,6 +1987,7 @@ Partial Class Compras_Compras
Next Next
If EmisorRegimenFiscal = "626" AndAlso Not RetISRResico Then If EmisorRegimenFiscal = "626" AndAlso Not RetISRResico Then
SbValRet.Append(" La factura no tiene especificado una retención de ISR, ya que el proveedor es Resico. <br/>") SbValRet.Append(" La factura no tiene especificado una retención de ISR, ya que el proveedor es Resico. <br/>")
BtnGuardar.Enabled = False
End If End If
If SbValRet.ToString.Trim.Length > 0 Then If SbValRet.ToString.Trim.Length > 0 Then

View File

@@ -90,6 +90,10 @@ Partial Class Inventarios_CatAlmacenes
DdlTipoAlmacenFiltro.DataBind() DdlTipoAlmacenFiltro.DataBind()
DdlTipoAlmacen.DataBind() DdlTipoAlmacen.DataBind()
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
DdlTipoAlmacen.SelectedValueExist("4") ' tipo consignación por default
End If
End Sub End Sub
Private Sub CargaUsuarios() Private Sub CargaUsuarios()

View File

@@ -550,12 +550,13 @@ Partial Class RepOC
params.Add(New ReportParameter("Titulo", "REPORTE DE ORDENES DE COMPRA POR ATENDER")) params.Add(New ReportParameter("Titulo", "REPORTE DE ORDENES DE COMPRA POR ATENDER"))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", ""))) params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
Dim NombreArchivoDescargar As String = $"RepOCPorAtender{If(DdlProyectos.SelectedValue <> "-1", "_" & DdlProyectos.SelectedItem.Text, "")}_{DateTime.Now.ToShortDateString}"
If Archivo.Exists Then If Archivo.Exists Then
ImprimirPDF($"{UsuarioActual.Empresa.Ruta}Formatos/RepOCPorAtender.rdlc", DtPorAtender, params, "RepOCPorAtender", Formato) ImprimirPDF($"{UsuarioActual.Empresa.Ruta}Formatos/RepOCPorAtender.rdlc", DtPorAtender, params, NombreArchivoDescargar, Formato)
'ImprimirbytesPDF(ImprimirPDFCrystal($"{UsuarioActual.Empresa.Ruta}Formatos/RepOCPorAtender.rpt", DtPorAtender, params, "RepOCPorAtender", Formato), "RepOCPorAtender", Formato) 'ImprimirbytesPDF(ImprimirPDFCrystal($"{UsuarioActual.Empresa.Ruta}Formatos/RepOCPorAtender.rpt", DtPorAtender, params, "RepOCPorAtender", Formato), "RepOCPorAtender", Formato)
Else Else
ImprimirPDF("Empresas/Grales/Formatos/RepOCPorAtender.rdlc", DtPorAtender, params, "RepOCPorAtender", Formato) ImprimirPDF("Empresas/Grales/Formatos/RepOCPorAtender.rdlc", DtPorAtender, params, NombreArchivoDescargar, Formato)
'ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath("~/Empresas/Grales/Formatos/RepOCPorAtender.rpt"), DtPorAtender, params, "RepOCPorAtender", Formato), "RepOCPorAtender", Formato) 'ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath("~/Empresas/Grales/Formatos/RepOCPorAtender.rpt"), DtPorAtender, params, "RepOCPorAtender", Formato), "RepOCPorAtender", Formato)
End If End If

View File

@@ -2650,10 +2650,21 @@
<tr> <tr>
<td>Enviar Mensaje:</td> <td>Enviar Mensaje:</td>
<td> <td>
<asp:TextBox ID="TxtNotifMensaje" TextMode="Phone" CssClass="form-control input-sm" runat="server"></asp:TextBox> <asp:TextBox ID="TxtNotifMensaje" CssClass="form-control input-sm" runat="server"></asp:TextBox>
</td>
<td colspan="2"> <asp:Button ID="BtnNotifEnviar" runat="server" Text="Enviar Texto" class="btn btn-primary green" OnClick="BtnNotifEnviar_Click" />
</td> </td>
<td colspan="2"> <asp:Button ID="BtnNotifEnviar" runat="server" Text="Enviar Mensaje" class="btn btn-primary green" OnClick="BtnNotifEnviar_Click" /></td>
</tr> </tr>
<tr>
<td>Enviar con Plant.:</td>
<td>
<asp:TextBox ID="TxtNotifPlantilla" CssClass="form-control input-sm" runat="server"></asp:TextBox>
</td>
<td colspan="2">
<asp:Button ID="BtnNotifEnviarPlantilla" runat="server" Text="Enviar Mensaje" class="btn btn-primary green" OnClick="BtnNotifEnviarPlantilla_Click" />
</td>
</tr>
</table> </table>
</div> </div>
</div> </div>

View File

@@ -5133,4 +5133,7 @@ Partial Class Sistemas_UsuarioDetalle
Protected Sub BtnNotifEnviar_Click(sender As Object, e As EventArgs) Protected Sub BtnNotifEnviar_Click(sender As Object, e As EventArgs)
EnviarNotificacionWhatsApp($"52{TxtTelefono.Text}", TxtNotifMensaje.Text) EnviarNotificacionWhatsApp($"52{TxtTelefono.Text}", TxtNotifMensaje.Text)
End Sub End Sub
Protected Sub BtnNotifEnviarPlantilla_Click(sender As Object, e As EventArgs)
EnviarNotificacionWhatsApp2($"52{TxtTelefono.Text}", "", TxtNotifPlantilla.Text)
End Sub
End Class End Class

View File

@@ -418,19 +418,19 @@ Partial Class RepContratoDetalle
ErrorProceso = True ErrorProceso = True
End If End If
If Not ErrorProceso Then If Not ErrorProceso Then
If CveVentaRemision > 0 AndAlso (CveSubProyectoOriginal <> DdlSubProyecto.SelectedValue.ToEntero OrElse
CveMonedaOriginal <> DdlMoneda.SelectedValue.ToEntero OrElse
ImporteOrigial <> TxtImporte.Text.ToDecimal OrElse
DescripcionOriginal <> TxtDescripcion.Text OrElse
TipoAFOriginal <> DdlTipoAF.SelectedItem.Text OrElse
FolioOriginal <> TxtFolio.Text.Trim) Then
If CveSubProyectoOriginal <> DdlSubProyecto.SelectedValue.ToEntero Or CveMonedaOriginal <> DdlMoneda.SelectedValue.ToEntero Or ImporteOrigial <> TxtImporte.Text.ToDecimal Or DescripcionOriginal <> TxtDescripcion.Text Or
TipoAFOriginal <> DdlTipoAF.SelectedItem.Text Or FolioOriginal <> TxtFolio.Text.Trim Then
Dim ObsRemisionPartida As String = $"{DdlTipoAF.SelectedItem.Text}-{ TxtDescripcion.Text}-{TxtFolio.Text}" Dim ObsRemisionPartida As String = $"{DdlTipoAF.SelectedItem.Text}-{ TxtDescripcion.Text}-{TxtFolio.Text}"
If Not UpdateRemision(ObjContratos.IniciaTransacSQL(), DdlSubProyecto.SelectedValue.ToEntero, DdlMoneda.SelectedValue.ToEntero, TxtImporte.Text.ToDecimal, ObsRemisionPartida) Then If Not UpdateRemision(ObjContratos.IniciaTransacSQL(), DdlSubProyecto.SelectedValue.ToEntero, DdlMoneda.SelectedValue.ToEntero, TxtImporte.Text.ToDecimal, ObsRemisionPartida) Then
ErrorProceso = True ErrorProceso = True
End If End If
End If End If
End If End If
If Not ErrorProceso Then If Not ErrorProceso Then
@@ -440,15 +440,11 @@ Partial Class RepContratoDetalle
AgregarABitacora($"Actualización del contrato {CveContrato}") AgregarABitacora($"Actualización del contrato {CveContrato}")
CargaDatos() CargaDatos()
Alert("Contrato actualizado correctamente") Alert("Contrato actualizado correctamente")
Else Else
Alert("Ocurrió un ocurrió un error al actualizar su boleto", TipoMensaje.MsgError) Alert("Ocurrió un ocurrió un error al actualizar su boleto", TipoMensaje.MsgError)
ObjContratos.RollBack() ObjContratos.RollBack()
End If End If
End Sub End Sub
Private Function UpdateRemision(ByRef transaccionSql As SqlTransaction, CveSubProyectoNew As Integer, CveMonedaNew As Integer, TotalNew As Decimal, DescripcionNew As String) As Boolean Private Function UpdateRemision(ByRef transaccionSql As SqlTransaction, CveSubProyectoNew As Integer, CveMonedaNew As Integer, TotalNew As Decimal, DescripcionNew As String) As Boolean

View File

@@ -24,7 +24,7 @@ Partial Class ListadoContratos
If Not IsPostBack Then If Not IsPostBack Then
txtFechaI.Text = DateTime.Now.AddMonths(-1).ToShortDateString txtFechaI.Text = DateTime.Now.AddMonths(-1).ToShortDateString
txtFechaF.Text = DateTime.Now.AddDays(7).ToShortDateString txtFechaF.Text = DateTime.Now.AddDays(1).ToShortDateString
InicializaCombos() InicializaCombos()
CargaDatos() CargaDatos()
End If End If
@@ -60,7 +60,8 @@ Partial Class ListadoContratos
Private Sub CargaDatos() Private Sub CargaDatos()
Dim ObjContratos As New ClsContratos Dim ObjContratos As New ClsContratos
If ObjContratos.GetContratosReporte(UsuarioActual.CveEmpresa, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlCliente.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, CveSubProyecto:=DdlCentroCostos.SelectedValue.ToEntero, CveTipoAF:=DdlTipoUnidad.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero) Then If ObjContratos.GetContratosReporte(UsuarioActual.CveEmpresa, MinFecha, MaxFecha, DdlCliente.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, CveSubProyecto:=DdlCentroCostos.SelectedValue.ToEntero, CveTipoAF:=DdlTipoUnidad.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero,
FechaInicioIngreso:=txtFechaI.Text.ToDate, FechaFinIngreso:=txtFechaF.Text.ToDate) Then
GvContratos.DataSource = ObjContratos.DtResultados GvContratos.DataSource = ObjContratos.DtResultados
End If End If
@@ -116,17 +117,15 @@ Partial Class ListadoContratos
Directory.CreateDirectory(folderContratosPath) Directory.CreateDirectory(folderContratosPath)
End If End If
If DdlClientes.SelectedValue = "" Then If DdlClientes.SelectedValue = "" Then
Alert("Debe seleccionar al cliente", TipoMensaje.MsgAdvertencia) Alert("Debe seleccionar al cliente", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
'Agregamos Contrato 'Agregamos Contrato
Dim ObjContratos As New ClsContratos Dim ObjContratos As New ClsContratos
ObjContratos.IniciaTransacSQL() Dim ObjFolios As New ClsGralFolios(ObjContratos.IniciaTransacSQL())
CveContrato = ObjContratos.AddContratos(LbFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDateTime, TxtFechaRegreso.Text.ToDateTime, TxtUbicacion.Text, "", CveContrato = ObjContratos.AddContratos(LbFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDateTime, TxtFechaRegreso.Text.ToDateTime, TxtUbicacion.Text, "",
DdlSubProyectoModal.SelectedValue.ToEntero, -1, -1, -1, -1, LbArchivo.Text, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, -1, TxtImporte.Text.ToDecimal, DdlSubProyectoModal.SelectedValue.ToEntero, -1, -1, -1, -1, LbArchivo.Text, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, -1, TxtImporte.Text.ToDecimal,
@@ -188,17 +187,13 @@ Partial Class ListadoContratos
ErrorProceso = True ErrorProceso = True
Alert("se presento un error al generar la remisión", TipoMensaje.MsgAdvertencia) Alert("se presento un error al generar la remisión", TipoMensaje.MsgAdvertencia)
End If End If
End If End If
Else Else
ErrorProceso = True ErrorProceso = True
End If End If
If Not ErrorProceso Then If Not ErrorProceso Then
'Aumentamos Folio 'Aumentamos Folio
Dim ObjFolios As New ClsGralFolios(ObjContratos.IniciaTransacSQL())
If Not ObjFolios.UpdateFolioActual(-1, "Con", True, UsuarioActual.CveEmpresa) Then If Not ObjFolios.UpdateFolioActual(-1, "Con", True, UsuarioActual.CveEmpresa) Then
ErrorProceso = True ErrorProceso = True
End If End If
@@ -214,9 +209,9 @@ Partial Class ListadoContratos
End If End If
ObjContratos.Dispose() ObjContratos.Dispose()
ObjFolios.Dispose()
ResetModal() ResetModal()
CargaDatos() CargaDatos()
RegistraScript("$('#ModalAgregar').modal('hide')", "hidemodal1") RegistraScript("$('#ModalAgregar').modal('hide')", "hidemodal1")
End Sub End Sub
@@ -264,7 +259,7 @@ Partial Class ListadoContratos
ObjContratos.Dispose() ObjContratos.Dispose()
End Sub End Sub
Protected Sub Consultar(sender As Object, e As EventArgs) Protected Sub Consultar(sender As Object, e As EventArgs)
CargaDatos()
End Sub End Sub
Protected Sub Personalizar(sender As Object, e As EventArgs) Protected Sub Personalizar(sender As Object, e As EventArgs)
GvContratos.Columns(6).Visible = ChkChofer.Checked GvContratos.Columns(6).Visible = ChkChofer.Checked

View File

@@ -662,7 +662,6 @@ Partial Class RepContratosCalendario
HidCveAF.Value = GvRow.DataKey("CveAF").ToString HidCveAF.Value = GvRow.DataKey("CveAF").ToString
HidCveAFDes.Value = DdlAF.SelectedItem.Text HidCveAFDes.Value = DdlAF.SelectedItem.Text
End If End If
TxtMotivoCambioUnidad.Text = "" TxtMotivoCambioUnidad.Text = ""
DVMotivoCambioAF.Visible = False DVMotivoCambioAF.Visible = False
@@ -676,8 +675,6 @@ Partial Class RepContratosCalendario
LblSaldo.Text = "" LblSaldo.Text = ""
End If End If
CveContrato = GvRow.DataKey("CveContrato").ToEntero CveContrato = GvRow.DataKey("CveContrato").ToEntero
OcultarMostrarSegundoChofer() OcultarMostrarSegundoChofer()
@@ -694,14 +691,12 @@ Partial Class RepContratosCalendario
TxtMotivoCambioUnidad.Text = "" TxtMotivoCambioUnidad.Text = ""
DVMotivoCambioAF.Visible = False DVMotivoCambioAF.Visible = False
DdlClientes.SelectedText = HidModClienteNombre.Value DdlClientes.SelectedText = HidModClienteNombre.Value
DdlClientes.SelectedValue = HidModCveCliente.Value DdlClientes.SelectedValue = HidModCveCliente.Value
DdlClientes.txtText.Value = HidModClienteNombre.Value DdlClientes.txtText.Value = HidModClienteNombre.Value
DdlClientes.txtValue.Value = HidModCveCliente.Value DdlClientes.txtValue.Value = HidModCveCliente.Value
chkSegundoChofer.Checked = If(HidNumChoferes.Value.ToEntero = 2, True, False) chkSegundoChofer.Checked = If(HidNumChoferes.Value.ToEntero = 2, True, False)
OcultarMostrarSegundoChofer() OcultarMostrarSegundoChofer()
HypRemision.Text = HidRemisionSerieFolio.Value HypRemision.Text = HidRemisionSerieFolio.Value
@@ -713,14 +708,15 @@ Partial Class RepContratosCalendario
End If End If
CargaAFDdl(HidCveTipoAF.Value.ToEntero) CargaAFDdl(HidCveTipoAF.Value.ToEntero)
DdlAF.SelectedValueExist(HidCveAF.Value) DdlAF.SelectedValueExist(HidCveAF.Value)
If HidCveAF.Value.ToEntero > 0 AndAlso DdlAF.SelectedValue <> HidCveAF.Value Then
DdlAF.Items.Insert(0, New ListItem(GlobalDTActivoFijos(UsuarioActual.CveEmpresa, CveActivoFijo:=HidCveAF.Value.ToEntero).FiltroPrimeroValor("CodigoDescripcion"), HidCveAF.Value))
DdlAF.SelectedValueExist(HidCveAF.Value)
End If
HidCveAFDes.Value = DdlAF.SelectedItem.Text HidCveAFDes.Value = DdlAF.SelectedItem.Text
UpModal.Update() UpModal.Update()
myModalLabel.InnerText = "Contrato: " & HdnNumContrato.Value myModalLabel.InnerText = "Contrato: " & HdnNumContrato.Value
RegistraScript("$('#ModalActualizar').modal('show');") RegistraScript("$('#ModalActualizar').modal('show');")
End Sub End Sub
@@ -784,11 +780,7 @@ Partial Class RepContratosCalendario
Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click
Dim SubProyecto As String = "" Dim SubProyecto As String = DdlSubProyectos.SelectedItem.Text
SubProyecto = DdlSubProyectos.SelectedItem.Text
Dim SbFiltros As New StringBuilder() Dim SbFiltros As New StringBuilder()
SbFiltros.AppendFormat($"Fecha Inicio: {txtFechaI.Text} Fecha Fin: {txtFechaF.Text}|") SbFiltros.AppendFormat($"Fecha Inicio: {txtFechaI.Text} Fecha Fin: {txtFechaF.Text}|")
@@ -837,8 +829,6 @@ Partial Class RepContratosCalendario
End Sub End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaDatos() CargaDatos()
End Sub End Sub
@@ -850,11 +840,9 @@ Partial Class RepContratosCalendario
End Sub End Sub
Protected Sub DdlTipoVista_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlTipoVista_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaDiagramadeGant(DdlTipoVista.SelectedValue.ToEntero) CargaDiagramadeGant(DdlTipoVista.SelectedValue.ToEntero)
End Sub End Sub
Protected Sub DdlAF_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlAF_SelectedIndexChanged(sender As Object, e As EventArgs)
DVMotivoCambioAF.Visible = False DVMotivoCambioAF.Visible = False
@@ -865,11 +853,8 @@ Partial Class RepContratosCalendario
UpModal.Update() UpModal.Update()
End Sub End Sub
Protected Sub DdlTipoVistaCalendario_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlTipoVistaCalendario_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaCronograma(DdlTipoVistaCalendario.SelectedValue.ToEntero) CargaCronograma(DdlTipoVistaCalendario.SelectedValue.ToEntero)
End Sub End Sub
End Class End Class

View File

@@ -148,25 +148,28 @@
</div> </div>
<div class="row" style="max-width: 900px"> <div class="row" style="max-width: 900px">
<div class="col-md-12" style="max-width: 900px"> <div class="col-md-12" >
<asp:GridView ID="GvIndicadores" runat="server" AutoGenerateColumns="False" <asp:GridView ID="GvIndicadores" runat="server" AutoGenerateColumns="False"
DataKeyNames="" data-sort="true" DataKeyNames="" data-sort="true"
EmptyDataText="No se encontraron registros" ToolTip="Listado de Medicos" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None"> EmptyDataText="No se encontraron registros" ToolTip="Listado de Medicos" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
<Columns> <Columns>
<asp:TemplateField HeaderText="Grupo" ItemStyle-HorizontalAlign="Left"> <asp:TemplateField HeaderText="Grupo" ItemStyle-HorizontalAlign="Left">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlGrupo" runat="server" Text='<%# Eval("Grupo") %>'></asp:Literal> <asp:Literal ID="LtlGrupo" runat="server" Text='<%# Eval("Grupo") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="70px"> <asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="90px">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlTotal" runat="server" Text='<%# Eval("Total", "{0:N2}") %>'></asp:Literal> <asp:Literal ID="LtlTotal" runat="server" Text='<%# Eval("Total", "{0:N2}") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Gasto" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="90px">
<ItemTemplate>
<asp:Literal ID="LtlGasto" runat="server" Text='<%# Eval("Gasto", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="70px"> <asp:TemplateField HeaderText="Cantidad" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="70px">
<ItemTemplate> <ItemTemplate>

View File

@@ -1017,7 +1017,6 @@ Partial Class Ventas
Get Get
Return ViewState("CvePSAmortizacion").ToString().ToEntero() Return ViewState("CvePSAmortizacion").ToString().ToEntero()
End Get End Get
Set(value As Integer) Set(value As Integer)
ViewState("CvePSAmortizacion") = value ViewState("CvePSAmortizacion") = value
End Set End Set
@@ -2337,8 +2336,6 @@ Partial Class Ventas
ViewState("ClienteEsDistribuidor") = value ViewState("ClienteEsDistribuidor") = value
End Set End Set
End Property End Property
#End Region #End Region
Public Property CveAlmacenAsignado As Integer Public Property CveAlmacenAsignado As Integer
@@ -2353,16 +2350,15 @@ Partial Class Ventas
End Set End Set
End Property End Property
Public Property CveAlmacenFiltroDdl As Integer
Public Property CveAlamcenFiltroDdl As Integer
Get Get
If ViewState("CveAlamcenFiltroDdl") Is Nothing Then If ViewState("CveAlmacenFiltroDdl") Is Nothing Then
ViewState("CveAlamcenFiltroDdl") = -1 ViewState("CveAlmacenFiltroDdl") = -1
End If End If
Return ViewState("CveAlamcenFiltroDdl").ToString.ToEntero Return ViewState("CveAlmacenFiltroDdl").ToString.ToEntero
End Get End Get
Set(value As Integer) Set(value As Integer)
ViewState("CveAlamcenFiltroDdl") = value ViewState("CveAlmacenFiltroDdl") = value
End Set End Set
End Property End Property
@@ -5428,7 +5424,6 @@ Partial Class Ventas
UPCondicionesPago.Update() UPCondicionesPago.Update()
End If End If
'ESCONDE ACCIONES 'ESCONDE ACCIONES
LnkRemisiones.Visible = False LnkRemisiones.Visible = False
LnkPedido2SinFacturar.Visible = False LnkPedido2SinFacturar.Visible = False
@@ -5541,7 +5536,6 @@ Partial Class Ventas
DdlUsoCFDI.SelectedValueExistInsert(DbRowVenta("CveUsoCFDI").ToString(), UsoCFDI) DdlUsoCFDI.SelectedValueExistInsert(DbRowVenta("CveUsoCFDI").ToString(), UsoCFDI)
End If End If
If UsuarioActual.CveEmpresa = 126 Then CargaOrdenProduccion(2, CveVenta) If UsuarioActual.CveEmpresa = 126 Then CargaOrdenProduccion(2, CveVenta)
If DbRowVenta("CveTipoRelacion").ToString().ToEntero() > 0 Then If DbRowVenta("CveTipoRelacion").ToString().ToEntero() > 0 Then
@@ -5573,7 +5567,6 @@ Partial Class Ventas
LiComplementoPago.Visible = True LiComplementoPago.Visible = True
ViewState("FolioFiscal") = DbRowVenta("FolioFiscal").ToString() ViewState("FolioFiscal") = DbRowVenta("FolioFiscal").ToString()
SerieVenta = DbRowVenta("Serie").ToString() SerieVenta = DbRowVenta("Serie").ToString()
@@ -5603,7 +5596,6 @@ Partial Class Ventas
Dim PorcentajeRetIVA As Decimal = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100) Dim PorcentajeRetIVA As Decimal = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100)
LblRetIVA.Text = PorcentajeRetIVA.FormatoNumero(2) LblRetIVA.Text = PorcentajeRetIVA.FormatoNumero(2)
End If End If
End If End If
TxtRetISR.Text = DbRowVenta("RetISR").ToString().FormatoNumero(2) TxtRetISR.Text = DbRowVenta("RetISR").ToString().FormatoNumero(2)
TxtIEPS.Text = DbRowVenta("IEPS").ToString().FormatoNumero(2) TxtIEPS.Text = DbRowVenta("IEPS").ToString().FormatoNumero(2)
@@ -5626,7 +5618,6 @@ Partial Class Ventas
TxtPedidoContrato.Enabled = False TxtPedidoContrato.Enabled = False
TxtKilometraje.Text = DbRowVenta("Kilometraje").ToString().PadLeft(6, "0"c) TxtKilometraje.Text = DbRowVenta("Kilometraje").ToString().PadLeft(6, "0"c)
VentaActual = New Venta(UsuarioActual) VentaActual = New Venta(UsuarioActual)
VentaActual.CveVenta = CveVenta VentaActual.CveVenta = CveVenta
VentaActual.Fecha = DbRowVenta("Fecha").ToString.ToDate VentaActual.Fecha = DbRowVenta("Fecha").ToString.ToDate
@@ -5657,12 +5648,6 @@ Partial Class Ventas
BtnEmitir.Visible = False BtnEmitir.Visible = False
End If End If
'HdnAmortizacion.Value = LblAmort.Text.ToDouble.ToString()
'HdnSubTotalDescuestos.Value = (TxtSubTotal.Text.Replace(",", "").ToDouble - LblDescuentos.Text.Replace(",", "").ToDouble - LblAmortizacion.Text.Trim.Replace(",", "").ToDouble - TxtRetISR.Text.Replace(",", "").ToDouble).FormatoNumero(2)
'DdlAmortizacionConceptos.SelectedValue = DbRowVenta("AnticipoPosicion").ToString()
'ChkAnticipoEnSubTotal.Checked = DbRowVenta("AnticipoEnSubTotal").ToString() = "True"
If DbRowVenta("CveTipoRelacion").ToString().ToEntero() > 0 Then If DbRowVenta("CveTipoRelacion").ToString().ToEntero() > 0 Then
TrTipoRelacion2.Visible = True TrTipoRelacion2.Visible = True
LblTipoRelacion.Text = DbRowVenta("TipoRelacion").ToString() LblTipoRelacion.Text = DbRowVenta("TipoRelacion").ToString()
@@ -5681,7 +5666,6 @@ Partial Class Ventas
HLSaldarVenta.Visible = True HLSaldarVenta.Visible = True
End If End If
If (UsuarioActual.TienePermisoProceso(166) Or UsuarioActual.CveRol = 1) AndAlso (LblFolioFiscal.Text = "" Or LblFolioFiscal.Text = "test") Then If (UsuarioActual.TienePermisoProceso(166) Or UsuarioActual.CveRol = 1) AndAlso (LblFolioFiscal.Text = "" Or LblFolioFiscal.Text = "test") Then
LkEliminarFactura.Visible = True LkEliminarFactura.Visible = True
End If End If
@@ -5853,14 +5837,6 @@ Partial Class Ventas
' BtnGenerarOS.OnClientClick = String.Format("/OS/OrdenesServicios.aspx?CveVenta={0}", CveVenta) ' BtnGenerarOS.OnClientClick = String.Format("/OS/OrdenesServicios.aspx?CveVenta={0}", CveVenta)
End If End If
'[IPP] COMENTADO 12/MARZO/2018 -SABRA QUE SE QUERIA ESCONDER
'If DbRowVenta("TipoDocto").ToString() = "Rem" Then
' GvPS.Columns(11).Visible = False
' GvPS.Columns(12).Visible = False
'End If
'Ocultamos los botones Clonar y Ordenar 'Ocultamos los botones Clonar y Ordenar
GvPS.Columns(19).Visible = False GvPS.Columns(19).Visible = False
GvPS.Columns(20).Visible = False GvPS.Columns(20).Visible = False
@@ -6259,7 +6235,8 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
CveTipoVenta = If(DbRowVenta("CveTipoVenta").ToString.ToEntero > 0, DbRowVenta("CveTipoVenta").ToString.ToEntero, -1) CveTipoVenta = If(DbRowVenta("CveTipoVenta").ToString.ToEntero > 0, DbRowVenta("CveTipoVenta").ToString.ToEntero, -1)
RBLTipoVenta.Items.Add(New ListItem("-", DbRowVenta("CveTipoVenta").ToString))
RBLTipoVenta.SelectedValuesIfExist(CveTipoVenta.ToString)
TrVentasMedicas3.Visible = True TrVentasMedicas3.Visible = True
If DbRowVenta("CveMedico").ToString.ToEntero > 0 AndAlso CveTipoVenta.Contiene(1, 2, 3, 5, 6) Then If DbRowVenta("CveMedico").ToString.ToEntero > 0 AndAlso CveTipoVenta.Contiene(1, 2, 3, 5, 6) Then
@@ -8514,9 +8491,9 @@ Partial Class Ventas
Objeto.ddlWS.Attributes.Add("data-AplicaparaVenta", "1") Objeto.ddlWS.Attributes.Add("data-AplicaparaVenta", "1")
End If End If
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
Objeto.Attributes.Add("data-CveAlmacen", $"{CveAlamcenFiltroDdl}") Objeto.Attributes.Add("data-CveAlmacen", $"{CveAlmacenFiltroDdl}")
Objeto.ddlWS.Attributes.Add("data-CveAlmacen", $"{CveAlamcenFiltroDdl}") Objeto.ddlWS.Attributes.Add("data-CveAlmacen", $"{CveAlmacenFiltroDdl}")
End If End If
End If End If
@@ -19352,7 +19329,7 @@ Partial Class Ventas
Using ObjInv2 As New ClsInventarios Using ObjInv2 As New ClsInventarios
If RBLTipoVenta.SelectedValue.ToEntero = 6 Then If RBLTipoVenta.SelectedValue.ToEntero = 6 Then
Existencia = ObjInv2.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, CveAlamcenFiltroDdl, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=-1, Existencia = ObjInv2.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, CveAlmacenFiltroDdl, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=-1,
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=0, PendientePorSurtir:=1, CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=0, PendientePorSurtir:=1,
RestringirAlmacenes:=1, ExcluyeApartados:=-1, BuscarEnTabla:=BuscarEnTabla) RestringirAlmacenes:=1, ExcluyeApartados:=-1, BuscarEnTabla:=BuscarEnTabla)
Else Else
@@ -23537,6 +23514,8 @@ Partial Class Ventas
TxtPaciente.Enabled = True TxtPaciente.Enabled = True
TxtEpisodio.Enabled = True TxtEpisodio.Enabled = True
TxtFolioRemision.Enabled = True TxtFolioRemision.Enabled = True
'carga los almacenes para la existencias
AsignaAlmacenWS()
End If End If
@@ -38822,18 +38801,18 @@ Partial Class Ventas
DdlTipoComprobante.SelectedValueExistInsert("Rem", "Remisión") DdlTipoComprobante.SelectedValueExistInsert("Rem", "Remisión")
End If End If
ElseIf RBLTipoVenta.SelectedValue.Contiene("3") Then ' A vista ElseIf RBLTipoVenta.SelectedValue.Contiene("3") Then ' A vista
DdlTipoComprobante.Items.Insert(DdlTipoComprobante.Items.Count, New ListItem("Pedido", "Ped")) DdlTipoComprobante.Items.Insert(DdlTipoComprobante.Items.Count, New ListItem("Pedido", "Ped"))
DdlTipoComprobante.SelectedValueExist("Ped") DdlTipoComprobante.SelectedValueExist("Ped")
TrVentasMedicas1.Visible = False TrVentasMedicas1.Visible = False
TrVentasMedicas2.Visible = False TrVentasMedicas2.Visible = False
ChkRequiereTecnico.Enabled = True ChkRequiereTecnico.Enabled = True
ElseIf RBLTipoVenta.SelectedValue.Contiene("4") Then ' consignacion ElseIf RBLTipoVenta.SelectedValue.Contiene("4") Then ' consignacion
DdlTipoComprobante.SelectedValueExist("Ing") DdlTipoComprobante.SelectedValueExist("Ing")
TrVentasMedicas1.Visible = False TrVentasMedicas1.Visible = False
TrVentasMedicas2.Visible = False TrVentasMedicas2.Visible = False
ChkRequiereTecnico.Enabled = True ChkRequiereTecnico.Enabled = True
Else Else
DdlTipoComprobante.Items.Insert(DdlTipoComprobante.Items.Count, New ListItem("Pedido", "Ped")) DdlTipoComprobante.Items.Insert(DdlTipoComprobante.Items.Count, New ListItem("Pedido", "Ped"))
DdlTipoComprobante.SelectedValueExist("Ped") DdlTipoComprobante.SelectedValueExist("Ped")
TrVentasMedicas1.Visible = True TrVentasMedicas1.Visible = True
TrVentasMedicas2.Visible = True TrVentasMedicas2.Visible = True
@@ -39069,12 +39048,11 @@ Partial Class Ventas
Private Sub AsignaAlmacenWS() Private Sub AsignaAlmacenWS()
CveAlamcenFiltroDdl = -1 CveAlmacenFiltroDdl = -1
Dim tCveAlmacenExistencia As Integer = -1 Dim tCveAlmacenExistencia As Integer = -1
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
If DdlSucursalCliente.SelectedValue.ToEntero > 0 Then If DdlSucursalCliente.SelectedValue.ToEntero > 0 Then
Dim drr As DataRow = GlobalDTClientesSucursales(UsuarioActual.CveEmpresa, CveCliente).FiltroPrimero($"CveClienteSucursal={DdlSucursalCliente.SelectedValue}") Dim drr As DataRow = GlobalDTClientesSucursales(UsuarioActual.CveEmpresa, CveCliente).FiltroPrimero($"CveClienteSucursal={DdlSucursalCliente.SelectedValue}")
If drr IsNot Nothing Then If drr IsNot Nothing Then
@@ -39098,13 +39076,12 @@ Partial Class Ventas
End If End If
End If End If
End If End If
CveAlamcenFiltroDdl = tCveAlmacenExistencia CveAlmacenFiltroDdl = tCveAlmacenExistencia
If Not CveAlamcenFiltroDdl > 0 Then If Not CveAlmacenFiltroDdl > 0 Then
CveAlamcenFiltroDdl = If(CveAlmacenAsignado > 0, CveAlmacenAsignado, -1) CveAlmacenFiltroDdl = If(CveAlmacenAsignado > 0, CveAlmacenAsignado, -1)
End If End If
DdlPS.ddlWS.Attributes.Remove("data-CveAlmacen") DdlPS.ddlWS.Attributes.Remove("data-CveAlmacen")
DdlPS.ddlWS.Attributes.Add("data-CveAlmacen", CveAlamcenFiltroDdl.ToString) DdlPS.ddlWS.Attributes.Add("data-CveAlmacen", CveAlmacenFiltroDdl.ToString)
End If End If
End Sub End Sub