This commit is contained in:
2024-01-16 21:41:21 -07:00
7 changed files with 185 additions and 36 deletions

View File

@@ -576,7 +576,7 @@ Public Class ClsVentas
Optional AtencionA As String = "", Optional PedidoContrato As String = "", Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1,
Optional CveCliente As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional OrdenCompra As String = "-1", Optional RetIVA As Decimal = -1,
Optional RetISR As Decimal = -1, Optional Kilometraje As Decimal = 0, Optional CveUsoCFDi As Integer = -1, Optional ServicioDomicilio As Boolean = False, Optional CveVendedor As Integer = -1,
Optional RequiereOS As Boolean = False, Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1) As Boolean
Optional RequiereOS As Boolean = False, Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional FechaParaSurtir As DateTime = MinFecha) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasUpdate")
@@ -612,6 +612,7 @@ Public Class ClsVentas
.Add("@RequiereOS", SqlDbType.Int).Value = RequiereOS
.Add("@CveMedico", SqlDbType.Int).Value = CveMedico
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
.Add("@FechaParaSurtir", SqlDbType.DateTime).Value = FechaParaSurtir
End With
Try
@@ -625,7 +626,8 @@ Public Class ClsVentas
End Function
Public Function UpdateObservacionesVenta(CveVenta As Integer, CveEmpresa As Integer, CveVendedor As Integer, Observaciones As String, FormaPaqueteria As Integer, CorreoNotificaciones As String, ObservacionesAlm As String,
Pedido As String, OrdenCompra As String, FechaPago As String, CveUsoCFDI As Integer, Optional DescripcionVenta As String = "-1", Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1) As Boolean
Pedido As String, OrdenCompra As String, FechaPago As String, CveUsoCFDI As Integer, Optional DescripcionVenta As String = "-1", Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1,
Optional FechaParaSurtir As DateTime = MinFecha) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasObservacionesUpdate")
With SqlAdapter.SelectCommand.Parameters
@@ -643,8 +645,42 @@ Public Class ClsVentas
.Add("@DescripcionVenta", SqlDbType.VarChar).Value = DescripcionVenta
.Add("@CveMedico", SqlDbType.Int).Value = CveMedico
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
.Add("@FechaParaSurtir", SqlDbType.DateTime).Value = FechaParaSurtir
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar las observaciones de la venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpdateEstatusOCRelacionada(CveVenta As Integer, CveEstatusOrdenServicio As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasOSEstatusUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@CveEstatusOrdenServicio", SqlDbType.Int).Value = CveEstatusOrdenServicio
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar las observaciones de la venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpdateFechaOSVenta(CveVenta As Integer, FechaCita As DateTime, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasOSFechaCitaUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@FechaCita", SqlDbType.DateTime).Value = FechaCita
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -6221,6 +6221,17 @@ Namespace Modelos
End If
End If
'CANCELAR ORDEN DE SERVICIO
If Not ErrorCancelar Then
If ObjFactura.CveMedico > 0 Then
Dim CveEstatusCancelacion As Integer = ClsPaginas.GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 5", "Orden ASC").ToString().ToEntero()
If Not ObjVentas.UpdateEstatusOCRelacionada(ObjFactura.CveVenta, CveEstatusCancelacion, ObjFactura.CveEmpresa) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al cancelar la orden de servicio"
End If
End If
End If
End If
'MARCA LA VENTA PARA REALIZAR LA DEVOLUCION POSTERIORMENTE

View File

@@ -724,7 +724,7 @@
<Width>8.06981in</Width>
<Page>
<PageHeader>
<Height>4.8037cm</Height>
<Height>5.67302cm</Height>
<PrintOnFirstPage>true</PrintOnFirstPage>
<PrintOnLastPage>true</PrintOnLastPage>
<ReportItems>
@@ -824,7 +824,7 @@ CIUDAD DE MEXICO</Value>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Microsoft.VisualBasic.Interaction.iif(Parameters!CveConcepto.Value = 8, "AVISO", "ENTRADA") &amp; " DE TRASLADO "</Value>
<Value>=Microsoft.VisualBasic.Interaction.iif(Parameters!CveConcepto.Value = 8, "PRE-REMISIÓN", "ENTRADA DE TRASLADO")</Value>
<Style>
<FontSize>12pt</FontSize>
</Style>
@@ -982,7 +982,7 @@ CIUDAD DE MEXICO</Value>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox12</rd:DefaultName>
<Top>2.21518cm</Top>
<Top>2.85018cm</Top>
<Left>16.09549cm</Left>
<Height>0.44478cm</Height>
<Width>4.32987cm</Width>
@@ -1187,7 +1187,7 @@ CIUDAD DE MEXICO</Value>
</Textbox>
</ReportItems>
<KeepTogether>true</KeepTogether>
<Top>2.70907cm</Top>
<Top>3.66157cm</Top>
<Height>2.01145cm</Height>
<Width>20.32792cm</Width>
<ZIndex>8</ZIndex>
@@ -1229,6 +1229,39 @@ CIUDAD DE MEXICO</Value>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox36">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Parameters!Observaciones.Value</Value>
<Style>
<FontSize>8pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox31</rd:DefaultName>
<Top>2.27107cm</Top>
<Left>0.13678cm</Left>
<Height>1.37286cm</Height>
<Width>13.15003cm</Width>
<ZIndex>10</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems>
<Style>
<Border>

View File

@@ -654,6 +654,10 @@ Partial Class Inventarios_EntregaAlmacen
TipoDocto = DtDatos.Rows(0)("TipoDocto").ToString()
TipoMovimiento = If(TipoDocto.Contiene({"Rem", "Ped", "Ing", "Ped", "PeC", "Ant"}) And (EsDevolucionVenta = 0 Or CveVentaAD > 0), 1, 2)
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 AndAlso TipoDocto.Contiene("Ped", "Ing") Then
TxtObservaciones.Text = $"Dr. {drE("Medico").ToString}{vbCrLf}Cx. {drE("Procedimiento").ToString}{vbCrLf}F. Cirugía {drE("FechaEjecucion").ToString.ToDateTime.ToString("dd/MM/yyyy HH:mm")}{vbCrLf}H. {drE("Sucursal").ToString}{vbCrLf}"
End If
LbCliente.Text = DtDatos.Rows(0)("Nombre").ToString()
HLFolio.Text = drE("SerieFolio").ToString()
If UsuarioActual.TienePermisoProceso(201) Then

View File

@@ -165,11 +165,23 @@
</div>
<asp:UpdatePanel ID="UpDatosGvVentas" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvVentas" ClientIDMode="Static" Width="100%" runat="server" GridLines="None" BorderWidth="0" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true" AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
<asp:GridView ID="GvVentas" ClientIDMode="Static" Width="100%" runat="server" GridLines="None" BorderWidth="0" CssClass="table table-striped table-hover Widthall ScrollAD" OnRowDataBound="GvVentas_RowDataBound"
data-sort="true" EmptyDataText="No se encontraron resultados." AutoGenerateColumns="False" >
<Columns>
<asp:BoundField HeaderText="Tipo Docto" DataField="TipoDocto" ItemStyle-Width="55px" />
<asp:HyperLinkField DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="~/Ventas/Ventas.aspx?CveVenta={0}" Target="_blank" ItemStyle-Width="80px" HeaderText="SerieFolio" ControlStyle-CssClass="Texto" DataTextField="SerieFolio" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Center" />
<%-- <asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Center" />--%>
<asp:TemplateField HeaderText="Fecha" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LtlFechaFactura" runat="server" ></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField DataNavigateUrlFields="CveCliente" DataNavigateUrlFormatString="~/Ventas/Clientes.aspx?CveCliente={0}" Target="_blank" HeaderText="Cliente" ControlStyle-CssClass="Texto" ItemStyle-HorizontalAlign="Left" DataTextField="Nombre" />
<asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:n2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Sucursal" DataField="SubProyecto" ItemStyle-Width="100px" />

View File

@@ -1,9 +1,10 @@
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class RepNotasSinAlmacen
Imports Microsoft.Reporting.WebForms
Imports Stimulsoft.Report.QuickButtons.StiWpfQuickButtonAttribute
Partial Class RepNotasSinAlmacen
Inherits ClsPaginas
#Region "propiedades"
Private Property dt As DataTable
@@ -57,10 +58,12 @@ Partial Class RepNotasSinAlmacen
End Get
Set(value As DataTable)
ViewState("DtNotasSinAlmacenCompras") = value
End Set
End Property
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
@@ -82,8 +85,10 @@ Partial Class RepNotasSinAlmacen
GvVentas.Columns(6).Visible = True
GvVentas.Columns(7).Visible = True
TxtFechaF.Text = NowADS.AddDays(3).ToShortDateString
CType(GvVentas.Columns(2), BoundField).DataFormatString = "{0:dd/MM/yyyy HH:mm}"
CType(GvVentas.Columns(2), BoundField).ItemStyle.Width = Unit.Pixel(120)
GvVentas.Columns(0).ItemStyle.Width = Unit.Pixel(120)
'CType(GvVentas.Columns(2), Literal).DataFormatString = "{0:dd/MM/yyyy HH:mm}"
'CType(GvVentas.Columns(2), Literal).ItemStyle.Width = Unit.Pixel(120)
End If
End Sub
@@ -194,16 +199,15 @@ Partial Class RepNotasSinAlmacen
End If
UpFiltros.Update()
End Sub
UpFiltros.Update()
End Sub
#Region " EXPORTAR - PDF - EXCEL "
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
ImprimirPDFExcel("Excel")
End Sub
ImprimirPDFExcel("Excel")
End Sub
#Region "P D F"
Private Sub LinkPDF_Click(sender As Object, e As EventArgs) Handles LinkPDF.Click
ImprimirPDFExcel()
@@ -276,8 +280,10 @@ Partial Class RepNotasSinAlmacen
e.Row.FCLinkButton("lnkAccion").Visible = False
If GvCompras.Columns(4).Visible Then
e.Row.Cells(4).Text = ""
End If
End If
End If
End If
End Sub
@@ -294,7 +300,7 @@ Partial Class RepNotasSinAlmacen
Dim ObjCompras As New ClsCompras
Dim ObjEventos As New ClsOIEventos
If ObjCompras.UpdateEstatusAlmacenDetalle(CveCompraDetalle, 1, Usuarioactual.CveUsuario) Then
If ObjCompras.UpdateEstatusAlmacenDetalle(CveCompraDetalle, 1, UsuarioActual.CveUsuario) Then
If ObjEventos.AddEventoBitacora(String.Format("El producto: {0} se marcó como no recibido", PS), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra:=CveCompra) Then
Alert("El producto se marcó como 'no recibido' correctamente.")
End If
@@ -308,4 +314,16 @@ Partial Class RepNotasSinAlmacen
End Sub
Protected Sub GvVentas_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then ' es empresa hospitalaria
e.Row.Cells(2).Text = $"<div style='display:none'>{e.Row.DBCampo("Fecha").ToDateTime.ToString("dd/MM/yyyy")}</div> {e.Row.DBCampo("Fecha").ToDateTime.ToString("dd/MM/yyyy HH:mm")}"
Else
e.Row.Cells(2).Text = $"{e.Row.DBCampo("Fecha").ToDateTime.ToString("dd/MM/yyyy")}"
End If
End If
End Sub
End Class

View File

@@ -2448,8 +2448,6 @@ Partial Class Ventas
CveAlmacenDevolucion = 0
Me.CveEstadoCancelacion = 0
TxtFechaOS.Text = NowADS().ToDateTime.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T")
txtFechaICot.Text = NowADS().AddMonths(-3).ToShortDateString
TxtFechaIRem.Text = NowADS().AddMonths(-3).ToShortDateString
TxtFechaIPed.Text = NowADS().AddMonths(-3).ToShortDateString
@@ -2831,6 +2829,8 @@ Partial Class Ventas
End If
Else
TxtFechaOS.Text = NowADS().ToDateTime.ToString("yyyy-MM-dd HH:mm").Replace(" ", "T")
If Request("CveOS") IsNot Nothing AndAlso IsNumeric(Request("CveOS")) AndAlso Request("CveOS").ToEntero() > 0 Then
ViewState("CveOS") = Request("CveOS")
CargaOS(CveOS)
@@ -5869,21 +5869,28 @@ Partial Class Ventas
CveTipoVenta = If(DbRowVenta("CveTipoVenta").ToString.ToEntero > 0, DbRowVenta("CveTipoVenta").ToString.ToEntero, -1)
If DbRowVenta("CveMedico").ToString.ToEntero > 0 AndAlso CveTipoVenta.Contiene(1, 3, 5) Then
If DbRowVenta("CveMedico").ToString.ToEntero > 0 AndAlso CveTipoVenta.Contiene(1, 2, 3, 5) Then
TrVentasMedicas1.Visible = True
DdlMedico.SelectedValueExist(DbRowVenta("CveMedico").ToString)
DdlProcedimiento.SelectedValueExist(DbRowVenta("CveProcedimiento").ToString)
DdlMedico.Enabled = False
DdlProcedimiento.Enabled = False
If DbRowVenta("FechaParaSurtir").ToString().ToDate() > DateTime.MinValue Then
TrVentasMedicas2.Visible = True
ChkRequiereTecnico.Enabled = False
TxtFechaOS.Enabled = False
TxtFechaOS.Text = DbRowVenta("FechaParaSurtir").ToString().ToDateTime().ToString("yyyy-MM-dd HH:mm").Replace(" ", "T")
End If
End If
End If
End If
Return Retorno
End Function
@@ -21649,6 +21656,12 @@ Partial Class Ventas
DdlMetodoPago33.Enabled = True
End If
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
If DdlMedico.SelectedValue.ToEntero() > 0 Then
TxtFechaOS.Enabled = True
End If
End If
UPPVentas.Update()
UpPS.Update()
UpCliente.Update()
@@ -21748,10 +21761,18 @@ Partial Class Ventas
PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(),
CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:=DdlTipoComprobante.SelectedValue, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal,
OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDecimal, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(),
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero) Then
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, FechaParaSurtir:=TxtFechaOS.Text.Replace(",", "").ToDateTime()) Then
OcurrioError = True
End If
If Not OcurrioError Then
If DdlMedico.SelectedValue.ToEntero() > 0 Then
If Not ObjVentas.UpdateFechaOSVenta(CveVenta, TxtFechaOS.Text.Replace(",", "").ToDateTime(), UsuarioActual.CveEmpresa) Then
OcurrioError = True
End If
End If
End If
'Cargo de nueva cuenta el detalle de Ventas (Conceptos)
If Not OcurrioError Then
Dim index As Integer = 0
@@ -33576,6 +33597,12 @@ Partial Class Ventas
TxtDescripcionVenta.Enabled = True
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
If DdlMedico.SelectedValue.ToEntero() > 0 Then
TxtFechaOS.Enabled = True
End If
End If
UpCliente.Update()
UpParametros.Update()
UPObservaciones.Update()
@@ -33599,10 +33626,18 @@ Partial Class Ventas
If Not ObjVentas.UpdateObservacionesVenta(Me.CveVenta, UsuarioActual.CveEmpresa, DdlVendedor.SelectedValue.ToEntero(), TxtObsFact.Text, RblPaqueteria.SelectedValue.ToEntero(), TxtCorreoNotificaciones.Text,
TxtObsAlmacen.Text, TxtPedidoContrato.Text, TxtOrdenCompra.Text, TxtFechaPago.Text, DdlUsoCFDI.SelectedValue.ToEntero, DescripcionVenta:=TxtDescripcionVenta.Text.Trim,
CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero) Then
CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, FechaParaSurtir:=TxtFechaOS.Text.Replace(",", "").ToDateTime()) Then
TieneError = True
End If
If Not TieneError Then
If DdlMedico.SelectedValue.ToEntero() > 0 Then
If Not ObjVentas.UpdateFechaOSVenta(CveVenta, TxtFechaOS.Text.Replace(",", "").ToDateTime(), UsuarioActual.CveEmpresa) Then
TieneError = True
End If
End If
End If
If Not TieneError AndAlso AplicaUpdateTC Then
If Not ObjVentas.UpdateVentaTC(Me.CveVenta, UsuarioActual.CveEmpresa, TxtTipoCambio.Text.ToDecimal()) Then
TieneError = True
@@ -36346,7 +36381,7 @@ Partial Class Ventas
Dim EstatusOrdenServicio As Integer = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 1").ToEntero
If ObjOrdenServicio.AddOrdenesServicios(CveCliente, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.Nombre, TxtFechaOS.Text.Replace(",", "").ToDateTime, $"Venta: {LblSerie.Text}-{TxtFolio.Text}", UsuarioActual.CveUsuario, EstatusOrdenServicio,
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveOSTipo, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero,
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVentaOS, -1, -1, CveOSTipo, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero,
Direccion:="", Telefono:="", CveModeloAuto:=-1, Año:="", CveMedico:=DdlMedico.SelectedValue.ToEntero,
CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=RBLTipoVenta.SelectedValue.ToEntero, FechaCita:=TxtFechaOS.Text.Replace(",", "").ToDateTime) Then
CveOSVentaMedica = ObjOrdenServicio.CveOS