This commit is contained in:
2024-01-06 12:58:05 -07:00
7 changed files with 220 additions and 140 deletions

View File

@@ -937,6 +937,24 @@ Public Class ClsClientes
End Try End Try
Return Retorno Return Retorno
End Function End Function
Public Function GetClienteSucursales(CveCliente As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ClienteSucursalesGet")
SqlAdapter.SelectCommand.Parameters.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
SqlAdapter.SelectCommand.Parameters.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener el las Sucursales del Cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetSucursales(CveCliente As Integer, Optional CveClienteSucursal As Integer = -1) As Boolean Public Function GetSucursales(CveCliente As Integer, Optional CveClienteSucursal As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False

View File

@@ -5885,7 +5885,7 @@ Public Class ClsPaginas
params.Add(New ReportParameter("Documentacion", Vta.Cliente.Documentacion)) params.Add(New ReportParameter("Documentacion", Vta.Cliente.Documentacion))
params.Add(New ReportParameter("Medico", Vta.Medico)) params.Add(New ReportParameter("Medico", Vta.Medico))
params.Add(New ReportParameter("Procedimiento", Vta.Procedimiento)) params.Add(New ReportParameter("Procedimiento", Vta.Procedimiento))
params.Add(New ReportParameter("FechaCirugia", Vta.Alfa1.ToDateTime.ToString("dd/MM/yyyy hh:mm"))) params.Add(New ReportParameter("FechaCirugia", Vta.FechaEjecucion.ToString("dd/MM/yyyy hh:mm")))
End If End If
RutaFormato = String.Format("{0}Formatos\{1}.rdlc", UsuarioActual.Empresa.Ruta, NombreArchivo) RutaFormato = String.Format("{0}Formatos\{1}.rdlc", UsuarioActual.Empresa.Ruta, NombreArchivo)

View File

@@ -406,7 +406,7 @@ Public Class ClsVentas
End Function End Function
Public Function AddVenta(TipoDocto As String, FolioFact As Integer, CveCliente As Integer, CveClienteSucursal As Integer, SubTotal As Double, Descuento As Double, Amortizacion As Double, IVA As Double, RetIVA As Double, RetISR As Double, Total As Double, Public Function AddVenta(TipoDocto As String, FolioFact As Integer, CveCliente As Integer, CveClienteSucursal As Integer, SubTotal As Double, Descuento As Double, Amortizacion As Double, IVA As Double, RetIVA As Double, RetISR As Double, Total As Double,
CveMoneda As Integer, TipoCambio As Double, CveMetodoPago As Integer, CondicionesPago As Integer, FormaPago As Integer, FechaVencimiento As DateTime, Fecha As DateTime, MotivoDescuento As String, Observaciones As String, FechaEjecucion As Date, CveMoneda As Integer, TipoCambio As Double, CveMetodoPago As Integer, CondicionesPago As Integer, FormaPago As Integer, FechaVencimiento As DateTime, Fecha As DateTime, MotivoDescuento As String, Observaciones As String, FechaEjecucion As DateTime,
CveVendedor As Integer, Alfa1 As String, Alfa2 As String, Alfa3 As String, Num1 As Double, Num2 As Double, Num3 As Double, CveVendedor As Integer, Alfa1 As String, Alfa2 As String, Alfa3 As String, Num1 As Double, Num2 As Double, Num3 As Double,
Fech1 As Date, Fech2 As Date, Fech3 As Date, CveCorte As Integer, NumeroPersonas As Integer, CvePrePoliza As Integer, CveUsuario As Integer, CveEmpresa As Integer, Fech1 As Date, Fech2 As Date, Fech3 As Date, CveCorte As Integer, NumeroPersonas As Integer, CvePrePoliza As Integer, CveUsuario As Integer, CveEmpresa As Integer,
Optional Propina As Double = -1, Optional CveVentaTerminal As Integer = -1, Optional AtencionA As String = "-1", Optional CveContrato As Integer = -1, Optional Propina As Double = -1, Optional CveVentaTerminal As Integer = -1, Optional AtencionA As String = "-1", Optional CveContrato As Integer = -1,
@@ -448,7 +448,7 @@ Public Class ClsVentas
.Add("@Fecha", SqlDbType.DateTime).Value = Fecha .Add("@Fecha", SqlDbType.DateTime).Value = Fecha
.Add("@MotivoDescuento", SqlDbType.VarChar).Value = MotivoDescuento .Add("@MotivoDescuento", SqlDbType.VarChar).Value = MotivoDescuento
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@FechaEjecucion", SqlDbType.Date).Value = FechaEjecucion .Add("@FechaEjecucion", SqlDbType.DateTime).Value = FechaEjecucion
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@Alfa1", SqlDbType.VarChar).Value = Alfa1 .Add("@Alfa1", SqlDbType.VarChar).Value = Alfa1
.Add("@Alfa2", SqlDbType.VarChar).Value = Alfa2 .Add("@Alfa2", SqlDbType.VarChar).Value = Alfa2

View File

@@ -3087,6 +3087,7 @@ Partial Class PopUpVerFactura
Vta.Medico = dtVentas(0)("Medico").ToString Vta.Medico = dtVentas(0)("Medico").ToString
Vta.Procedimiento = dtVentas(0)("Procedimiento").ToString Vta.Procedimiento = dtVentas(0)("Procedimiento").ToString
Vta.Alfa1 = dtVentas(0)("Alfa1").ToString Vta.Alfa1 = dtVentas(0)("Alfa1").ToString
Vta.FechaEjecucion = dtVentas(0)("FechaEjecucion").ToString.ToDateTime
Vta.RefDocto = dtVentas(0)("Ref").ToString Vta.RefDocto = dtVentas(0)("Ref").ToString
Vta.CveVenta = dtVentas(0)("CveVenta").ToString.ToEntero Vta.CveVenta = dtVentas(0)("CveVenta").ToString.ToEntero

View File

@@ -171,7 +171,7 @@
<%--1--%> <%--1--%>
<asp:BoundField DataField="FechaCita" HeaderText="Fecha Cirugía" ItemStyle-Width="100px" DataFormatString="{0:dd/MM/yyyy HH:mm}" HtmlEncode="False" /> <asp:BoundField DataField="FechaCita" HeaderText="Fecha Cirugía" ItemStyle-Width="100px" DataFormatString="{0:dd/MM/yyyy HH:mm}" HtmlEncode="False" />
<%--2--%> <%--2--%>
<asp:BoundField HeaderText="Cliente" DataField="Nombre" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Hospital" DataField="Nombre" ItemStyle-HorizontalAlign="Left" />
<%--3--%> <%--3--%>
<asp:BoundField HeaderText="Médico" DataField="Medico" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Médico" DataField="Medico" ItemStyle-HorizontalAlign="Left" />
<%--4--%> <%--4--%>
@@ -196,10 +196,4 @@
</asp:Content> </asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content> </asp:Content>

View File

@@ -8415,19 +8415,35 @@
</div> </div>
<%--Cliente--%> <%--Cliente Sucursales --%>
<div runat="server" visible="False" id="DvModalTipoVentaPasoCliente"> <div runat="server" visible="False" id="DvModalTipoVentaPasoCliente">
<div class="row">
<div class="form-group col-md-12 form-md-line-input input-iconright ">
<asp:DropDownList ID="DdlClienteSucursal" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="Clave" CausesValidation="true"
AutoPostBack="true" OnSelectedIndexChanged="DdlClienteSucursal_SelectedIndexChanged">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlClienteSucursal" runat="server" CssClass="" Display="None" InitialValue="-1"
ControlToValidate="DdlClienteSucursal" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Hospital''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModalVentaMedica"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceRfvDdlClienteSucursal" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlClienteSucursal" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlClienteSucursal">Hospital:</asp:Label>
</div>
</div>
</div>
<%--Cliente--%>
<%-- <div runat="server" visible="False" id="DvModalTipoVentaPasoClienteEliminar">
<div class="row"> <div class="row">
<div class="form-group col-md-12 form-md-line-input input-iconright "> <div class="form-group col-md-12 form-md-line-input input-iconright ">
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlClientesWS">Hospital:</asp:Label> <asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlClientesWS">Hospital:</asp:Label>
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientesWS" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;" Onselectedindexchange="DdlClientesWS_selectedindexchange"></ADS:Dropdownlost> <ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientesWS" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;" Onselectedindexchange="DdlClientesWS_selectedindexchange"></ADS:Dropdownlost>
</div> </div>
</div> </div>
</div> </div>--%>
<%--Sucursales--%> <%--Sucursales--%>
<div runat="server" visible="False" id="DvModalClientesucursal"> <%-- <div runat="server" visible="False" id="DvModalClientesucursal">
<div class="row"> <div class="row">
<div class="form-group col-md-12 form-md-line-input input-iconright "> <div class="form-group col-md-12 form-md-line-input input-iconright ">
@@ -8437,8 +8453,7 @@
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlSucursalClienteModal">Sucursal:</asp:Label> <asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlSucursalClienteModal">Sucursal:</asp:Label>
</div> </div>
</div> </div>
</div>--%>
</div>
<%--Medico Procedimiento--%> <%--Medico Procedimiento--%>
@@ -8511,11 +8526,6 @@
</div> </div>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<asp:LinkButton ID="LnkDvModalTipoVentaAceptar" ClientIDMode="Static" runat="server" CssClass="btn btn-primary" OnClick="LnkDvModalTipoVentaAceptar_Click" Text="Aceptar" Visible="false" ValidationGroup="GrpModalVentaMedica" /> <asp:LinkButton ID="LnkDvModalTipoVentaAceptar" ClientIDMode="Static" runat="server" CssClass="btn btn-primary" OnClick="LnkDvModalTipoVentaAceptar_Click" Text="Aceptar" Visible="false" ValidationGroup="GrpModalVentaMedica" />

View File

@@ -2553,8 +2553,7 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
CargaMedicos() CargaMedicos()
CargaProcedimientos() CargaProcedimientos()
CargaDdlClientesSucursal()
CargaDdlClientes()
End If End If
@@ -3394,9 +3393,7 @@ Partial Class Ventas
CargaTiposVenta() CargaTiposVenta()
If CveCliente > 0 Then If CveCliente > 0 Then
DdlClientesWS.txtValue.Value = CveCliente.ToString SeleccionarClienteSucursal(CveCliente:=CveCliente)
DdlClientesWS.txtText.Value = NombreCliente
DdlClientesWS.SelectedValue = CveCliente.ToString
End If End If
End If End If
@@ -3425,6 +3422,8 @@ Partial Class Ventas
End Sub End Sub
Private Sub CargaListasPrecios() Private Sub CargaListasPrecios()
DivPrecioLista.Visible = True DivPrecioLista.Visible = True
@@ -7745,88 +7744,7 @@ Partial Class Ventas
DdlClasificacion.DataBind() DdlClasificacion.DataBind()
End Sub End Sub
Private Sub CargaTiposVenta()
RBLTipoVenta.DataSource = GlobalDTTipoVenta().FiltraParametros("Estatus = 'True' ")
RBLTipoVenta.DataBind()
RBLTipoVenta.Items.Add(New ListItem("Otros", "5"))
TrVentasMedicas1.Visible = True
TrVentasMedicas2.Visible = True
For Each item As ListItem In RBLTipoVenta.Items
item.Text = $"&nbsp {item.Text}"
Next
RegistraScript("$('#DvModalTipoVenta').modal({ backdrop: 'static', keyboard: false });")
End Sub
Private Sub CargaProcedimientos()
DdlProcedimiento.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
DdlProcedimiento.DataBind()
DdlProcedimientoModal.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
DdlProcedimientoModal.DataBind()
DdlProcedimientoObservaciones.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa)
DdlProcedimientoObservaciones.DataBind()
End Sub
Private Sub CargaMedicos()
DdlMedico.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
DdlMedico.DataBind()
DdlMedicoModal.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
DdlMedicoModal.DataBind()
DdlMedicoObservaciones.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa)
DdlMedicoObservaciones.DataBind()
End Sub
Private Sub CargaSucursalesModal(CveClienteSeleccionado As Integer)
DdlSucursalClienteModal.Items.Clear()
DdlSucursalClienteModal.ClearSelection()
DdlSucursalClienteModal.SelectedValue = Nothing
Dim ObjCliente As New ClsClientes
If ObjCliente.GetSucursales(CveClienteSeleccionado) Then
DdlSucursalClienteModal.DataSource = ObjCliente.DtResultados
If ObjCliente.DtResultados.Rows.Count > 0 Then
DvModalClientesucursal.Visible = True
Else
DvModalClientesucursal.Visible = False
End If
Else
DvModalClientesucursal.Visible = False
DdlSucursalClienteModal.DataSource = Nothing
End If
ObjCliente.Dispose()
DdlSucursalClienteModal.DataBind()
DdlSucursalClienteModal.Items.Insert(0, New ListItem("Matriz", "-1"))
UpDvModalTipoVenta.FindDataSourceControl
End Sub
Private Sub CargaDdlClientes()
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
DdlClientesWS.setEsWebService(True)
Else
DdlClientesWS.setEsWebService(False)
If Not UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
DdlClientesWS.ddl.Items.Clear()
DdlClientesWS.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
DdlClientesWS.DataBind()
DdlClientesWS.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
End If
End If
End Sub
Private Sub CargaPS(CveClasificacion As Integer, Objeto As ADServerControl.Dropdownlost, Optional AplicaParaVenta As Boolean = True) Private Sub CargaPS(CveClasificacion As Integer, Objeto As ADServerControl.Dropdownlost, Optional AplicaParaVenta As Boolean = True)
@@ -10771,11 +10689,7 @@ Partial Class Ventas
ObjFacturaDevolucion.Fech2 = TxtFech2.Text.Trim.ToDate ObjFacturaDevolucion.Fech2 = TxtFech2.Text.Trim.ToDate
ObjFacturaDevolucion.Fech3 = TxtFech3.Text.Trim.ToDate ObjFacturaDevolucion.Fech3 = TxtFech3.Text.Trim.ToDate
If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso DvModalRequiereOSFecha.Visible Then
ObjFacturaDevolucion.Alfa1 = TxtFechaOS.Text.Trim
Else
ObjFacturaDevolucion.Alfa1 = TxtAlfa1.Text.Trim
End If
ObjFacturaDevolucion.Alfa2 = TxtAlfa2.Text.Trim ObjFacturaDevolucion.Alfa2 = TxtAlfa2.Text.Trim
ObjFacturaDevolucion.Alfa3 = TxtAlfa3.Text.Trim ObjFacturaDevolucion.Alfa3 = TxtAlfa3.Text.Trim
@@ -10803,6 +10717,13 @@ Partial Class Ventas
ObjFacturaDevolucion.CveSucursalEjecucion = DdlSucursalEjecucion.SelectedValue.ToEntero() ObjFacturaDevolucion.CveSucursalEjecucion = DdlSucursalEjecucion.SelectedValue.ToEntero()
ObjFacturaDevolucion.CveSucursalCobranza = DdlSucursalCobranza.SelectedValue.ToEntero() ObjFacturaDevolucion.CveSucursalCobranza = DdlSucursalCobranza.SelectedValue.ToEntero()
If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso DvModalRequiereOSFecha.Visible Then
ObjFacturaDevolucion.Alfa1 = TxtFechaOS.Text.Trim
ObjFacturaDevolucion.FechaEjecucion = TxtFechaOS.Text.Trim.ToDateTime
Else
ObjFacturaDevolucion.Alfa1 = TxtAlfa1.Text.Trim
End If
ObjFacturaDevolucion.AtencionA = If(ObjFacturaDevolucion.TipoDocto = "Cot" Or (ObjFacturaDevolucion.TipoDocto.Contiene("Ing", "Rem") AndAlso LblRFC.Text = "XAXX010101000"), TxtAtencionA.Text, "-1") ObjFacturaDevolucion.AtencionA = If(ObjFacturaDevolucion.TipoDocto = "Cot" Or (ObjFacturaDevolucion.TipoDocto.Contiene("Ing", "Rem") AndAlso LblRFC.Text = "XAXX010101000"), TxtAtencionA.Text, "-1")
ObjFacturaDevolucion.MotivoDescuento = TxtMotivoDescuento.Text.Trim ObjFacturaDevolucion.MotivoDescuento = TxtMotivoDescuento.Text.Trim
ObjFacturaDevolucion.Observaciones = TxtObsFact.Text.Trim ObjFacturaDevolucion.Observaciones = TxtObsFact.Text.Trim
@@ -11053,12 +10974,6 @@ Partial Class Ventas
ObjFacturaBonificacion.Fech2 = TxtFech2.Text.Trim.ToDate ObjFacturaBonificacion.Fech2 = TxtFech2.Text.Trim.ToDate
ObjFacturaBonificacion.Fech3 = TxtFech3.Text.Trim.ToDate ObjFacturaBonificacion.Fech3 = TxtFech3.Text.Trim.ToDate
If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso DvModalRequiereOSFecha.Visible Then
ObjFacturaBonificacion.Alfa1 = TxtFechaOS.Text.Trim
Else
ObjFacturaBonificacion.Alfa1 = TxtAlfa1.Text.Trim
End If
ObjFacturaBonificacion.Alfa2 = TxtAlfa2.Text.Trim ObjFacturaBonificacion.Alfa2 = TxtAlfa2.Text.Trim
ObjFacturaBonificacion.Alfa3 = TxtAlfa3.Text.Trim ObjFacturaBonificacion.Alfa3 = TxtAlfa3.Text.Trim
ObjFacturaBonificacion.Num1 = TxtNum1.Text.Trim.ToDouble ObjFacturaBonificacion.Num1 = TxtNum1.Text.Trim.ToDouble
@@ -11085,6 +11000,13 @@ Partial Class Ventas
ObjFacturaBonificacion.CveSucursalEjecucion = DdlSucursalEjecucion.SelectedValue.ToEntero() ObjFacturaBonificacion.CveSucursalEjecucion = DdlSucursalEjecucion.SelectedValue.ToEntero()
ObjFacturaBonificacion.CveSucursalCobranza = DdlSucursalCobranza.SelectedValue.ToEntero() ObjFacturaBonificacion.CveSucursalCobranza = DdlSucursalCobranza.SelectedValue.ToEntero()
If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso DvModalRequiereOSFecha.Visible Then
ObjFacturaBonificacion.Alfa1 = TxtFechaOS.Text.Trim
ObjFacturaBonificacion.FechaEjecucion = TxtFechaOS.Text.Trim.ToDateTime
Else
ObjFacturaBonificacion.Alfa1 = TxtAlfa1.Text.Trim
End If
ObjFacturaBonificacion.AtencionA = If(ObjFacturaBonificacion.TipoDocto = "Cot" Or (ObjFacturaBonificacion.TipoDocto.Contiene("Ing", "Rem") AndAlso LblRFC.Text = "XAXX010101000"), TxtAtencionA.Text, "-1") ObjFacturaBonificacion.AtencionA = If(ObjFacturaBonificacion.TipoDocto = "Cot" Or (ObjFacturaBonificacion.TipoDocto.Contiene("Ing", "Rem") AndAlso LblRFC.Text = "XAXX010101000"), TxtAtencionA.Text, "-1")
ObjFacturaBonificacion.MotivoDescuento = TxtMotivoDescuento.Text.Trim ObjFacturaBonificacion.MotivoDescuento = TxtMotivoDescuento.Text.Trim
ObjFacturaBonificacion.Observaciones = TxtObsFact.Text.Trim ObjFacturaBonificacion.Observaciones = TxtObsFact.Text.Trim
@@ -11541,11 +11463,7 @@ Partial Class Ventas
ObjFactura.Fech2 = TxtFech2.Text.Trim.ToDate ObjFactura.Fech2 = TxtFech2.Text.Trim.ToDate
ObjFactura.Fech3 = TxtFech3.Text.Trim.ToDate ObjFactura.Fech3 = TxtFech3.Text.Trim.ToDate
If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso DvModalRequiereOSFecha.Visible Then
ObjFactura.Alfa1 = TxtFechaOS.Text.Trim
Else
ObjFactura.Alfa1 = TxtAlfa1.Text.Trim
End If
ObjFactura.Alfa2 = TxtAlfa2.Text.Trim ObjFactura.Alfa2 = TxtAlfa2.Text.Trim
ObjFactura.Alfa3 = TxtAlfa3.Text.Trim ObjFactura.Alfa3 = TxtAlfa3.Text.Trim
@@ -11609,6 +11527,13 @@ Partial Class Ventas
ObjFactura.Det_ContraRecibo = TxtDet_ContraRecibo.Text.Trim ObjFactura.Det_ContraRecibo = TxtDet_ContraRecibo.Text.Trim
ObjFactura.MonedaAbreviatura = "" ObjFactura.MonedaAbreviatura = ""
If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso DvModalRequiereOSFecha.Visible Then
ObjFactura.Alfa1 = TxtFechaOS.Text.Trim
ObjFactura.FechaEjecucion = TxtFechaOS.Text.Trim.ToDateTime
Else
ObjFactura.Alfa1 = TxtAlfa1.Text.Trim
End If
'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS 'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS
If (ObjFactura.CveMoneda = 2 AndAlso ObjFactura.ConvertirPesos = True AndAlso ObjFactura.TipodeComprobante = "Ingresos" AndAlso RemisionesLista.Count > 0) Then If (ObjFactura.CveMoneda = 2 AndAlso ObjFactura.ConvertirPesos = True AndAlso ObjFactura.TipodeComprobante = "Ingresos" AndAlso RemisionesLista.Count > 0) Then
Dim TotalCalculableImpuestos, TotalCalculableImpuestosIVA As Decimal Dim TotalCalculableImpuestos, TotalCalculableImpuestosIVA As Decimal
@@ -12205,11 +12130,7 @@ Partial Class Ventas
ObjFacturaDevolucion.Fech3 = TxtFech3.Text.Trim.ToDate ObjFacturaDevolucion.Fech3 = TxtFech3.Text.Trim.ToDate
If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso DvModalRequiereOSFecha.Visible Then
ObjFacturaDevolucion.Alfa1 = TxtFechaOS.Text.Trim
Else
ObjFacturaDevolucion.Alfa1 = TxtAlfa1.Text.Trim
End If
ObjFacturaDevolucion.Alfa2 = TxtAlfa2.Text.Trim ObjFacturaDevolucion.Alfa2 = TxtAlfa2.Text.Trim
ObjFacturaDevolucion.Alfa3 = TxtAlfa3.Text.Trim ObjFacturaDevolucion.Alfa3 = TxtAlfa3.Text.Trim
@@ -12247,6 +12168,13 @@ Partial Class Ventas
ObjFacturaDevolucion.Det_FechaOrdenCompra = TxtDet_FechaOrdenCompra.Text.Trim ObjFacturaDevolucion.Det_FechaOrdenCompra = TxtDet_FechaOrdenCompra.Text.Trim
ObjFacturaDevolucion.MonedaAbreviatura = "" ObjFacturaDevolucion.MonedaAbreviatura = ""
If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso DvModalRequiereOSFecha.Visible Then
ObjFacturaDevolucion.Alfa1 = TxtFechaOS.Text.Trim
ObjFacturaDevolucion.FechaEjecucion = TxtFechaOS.Text.Trim.ToDateTime
Else
ObjFacturaDevolucion.Alfa1 = TxtAlfa1.Text.Trim
End If
'Totales, Y se llena TmpDTImpuestos 'Totales, Y se llena TmpDTImpuestos
ObjFacturaDevolucion.SubTotal = TxtSubTotal.Text.ToDecimal ObjFacturaDevolucion.SubTotal = TxtSubTotal.Text.ToDecimal
ObjFacturaDevolucion.Descuento = LblDescuentos.Text.Trim.ToDecimal ObjFacturaDevolucion.Descuento = LblDescuentos.Text.Trim.ToDecimal
@@ -36018,6 +35946,93 @@ Partial Class Ventas
#Region "VENTAS MEDICAS" #Region "VENTAS MEDICAS"
Private Sub CargaTiposVenta()
RBLTipoVenta.DataSource = GlobalDTTipoVenta().FiltraParametros("Estatus = 'True' ")
RBLTipoVenta.DataBind()
RBLTipoVenta.Items.Add(New ListItem("Otros", "5"))
TrVentasMedicas1.Visible = True
TrVentasMedicas2.Visible = True
For Each item As ListItem In RBLTipoVenta.Items
item.Text = $"&nbsp {item.Text}"
Next
RegistraScript("$('#DvModalTipoVenta').modal({ backdrop: 'static', keyboard: false });")
End Sub
Private Sub CargaProcedimientos()
DdlProcedimiento.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
DdlProcedimiento.DataBind()
DdlProcedimientoModal.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
DdlProcedimientoModal.DataBind()
DdlProcedimientoObservaciones.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa)
DdlProcedimientoObservaciones.DataBind()
End Sub
Private Sub CargaMedicos()
DdlMedico.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
DdlMedico.DataBind()
DdlMedicoModal.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
DdlMedicoModal.DataBind()
DdlMedicoObservaciones.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa)
DdlMedicoObservaciones.DataBind()
End Sub
'Private Sub CargaSucursalesModal(CveClienteSeleccionado As Integer)
' DdlSucursalClienteModal.Items.Clear()
' DdlSucursalClienteModal.ClearSelection()
' DdlSucursalClienteModal.SelectedValue = Nothing
' Dim ObjCliente As New ClsClientes
' If ObjCliente.GetSucursales(CveClienteSeleccionado) Then
' DdlSucursalClienteModal.DataSource = ObjCliente.DtResultados
' If ObjCliente.DtResultados.Rows.Count > 0 Then
' DvModalClientesucursal.Visible = True
' Else
' DvModalClientesucursal.Visible = False
' End If
' Else
' DvModalClientesucursal.Visible = False
' DdlSucursalClienteModal.DataSource = Nothing
' End If
' ObjCliente.Dispose()
' DdlSucursalClienteModal.DataBind()
' DdlSucursalClienteModal.Items.Insert(0, New ListItem("Matriz", "-1"))
' UpDvModalTipoVenta.FindDataSourceControl
'End Sub
Private Sub CargaDdlClientesSucursal()
Dim objcliente As New ClsClientes
If objcliente.GetClienteSucursales(-1, UsuarioActual.CveEmpresa) Then
DdlClienteSucursal.DataSource = objcliente.DtResultados
Else
DdlClienteSucursal.DataSource = Nothing
End If
objcliente.Dispose()
DdlClienteSucursal.DataBind()
DdlClienteSucursal.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
End Sub
Protected Sub ChkRequiereTecnico_CheckedChanged(sender As Object, e As EventArgs) Protected Sub ChkRequiereTecnico_CheckedChanged(sender As Object, e As EventArgs)
TdFechaOS2.Visible = ChkRequiereTecnicoModal.Checked TdFechaOS2.Visible = ChkRequiereTecnicoModal.Checked
UpCliente.Update() UpCliente.Update()
@@ -36036,9 +36051,9 @@ Partial Class Ventas
ChkRequiereTecnicoModal.Enabled = True ChkRequiereTecnicoModal.Enabled = True
DvModalRequiereOSFecha.Visible = True DvModalRequiereOSFecha.Visible = True
If CveCliente > 0 Then 'If CveCliente > 0 Then
CargaSucursalesModal(CveCliente) ' CargaSucursalesModal(CveCliente)
End If 'End If
TxtFechaModal.Text = NowADS.AddHours(1).ToString("yyyy-MM-dd HH").Replace(" ", "T") + ":00" ' ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T") TxtFechaModal.Text = NowADS.AddHours(1).ToString("yyyy-MM-dd HH").Replace(" ", "T") + ":00" ' ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T")
@@ -36076,13 +36091,51 @@ Partial Class Ventas
UpDvModalTipoVenta.Update() UpDvModalTipoVenta.Update()
End Sub End Sub
Protected Sub DdlClientesWS_selectedindexchange(sender As Object, e As EventArgs) 'Protected Sub DdlClientesWS_selectedindexchange(sender As Object, e As EventArgs)
CargaPSProcedimiento(DdlProcedimiento.SelectedValue.ToEntero, DdlClientesWS.SelectedValue.ToEntero, DdlSubProyectoDatos.SelectedValue.ToEntero)
CargaSucursalesModal(DdlClientesWS.SelectedValue.ToEntero) ' CargaPSProcedimiento(DdlProcedimiento.SelectedValue.ToEntero, DdlClientesWS.SelectedValue.ToEntero, DdlSubProyectoDatos.SelectedValue.ToEntero)
' 'CargaSucursalesModal(DdlClientesWS.SelectedValue.ToEntero)
'End Sub
Protected Sub DdlClienteSucursal_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim CveClienteSplit As Integer = -1
CargaPSProcedimiento(DdlProcedimiento.SelectedValue.ToEntero, DdlClienteSucursalCliente, DdlSubProyectoDatos.SelectedValue.ToEntero)
End Sub End Sub
Private Function DdlClienteSucursalCliente() As Integer
If DdlClienteSucursal.SelectedValue = "-1" Then
Return -1
Else
Dim array As String() = DdlClienteSucursal.SelectedValue.Split("|"c)
Return If(array(0).ToEntero > 0, array(0).ToEntero, -1)
End If
End Function
Private Function DdlClienteSucursalSucursal() As Integer
If DdlClienteSucursal.SelectedValue = "-1" Then
Return -1
Else
Dim array As String() = DdlClienteSucursal.SelectedValue.Split("|"c)
Return If(array(1).ToEntero > 0, array(1).ToEntero, -1)
End If
End Function
Private Sub SeleccionarClienteSucursal(CveCliente As Integer)
Dim IndexSeleccion As Integer = 0
For Each item As ListItem In DdlClienteSucursal.Items
Dim array As String() = item.Value.Split("|"c)
If CveCliente = array(0).ToEntero Then
DdlClienteSucursal.SelectedIndex = IndexSeleccion
Exit For
End If
IndexSeleccion = IndexSeleccion + 1
Next
End Sub
Protected Sub ModalValidaMedicoProcedimiento() Protected Sub ModalValidaMedicoProcedimiento()
@@ -36107,9 +36160,10 @@ Partial Class Ventas
ChkRequiereTecnicoModal.Enabled = True ChkRequiereTecnicoModal.Enabled = True
DdlClientesWS.txtText.Value = "" 'DdlClientesWS.txtText.Value = ""
DdlClientesWS.txtValue.Value = "" 'DdlClientesWS.txtValue.Value = ""
DdlClientesWS.ddl.SelectedValueExist(-1) 'DdlClientesWS.ddl.SelectedValueExist(-1)
DdlClienteSucursal.SelectedValueExist(-1)
DvModalRequiereOSFecha.Visible = False DvModalRequiereOSFecha.Visible = False
ChkRequiereTecnicoModal.Checked = False ChkRequiereTecnicoModal.Checked = False
@@ -36130,8 +36184,8 @@ Partial Class Ventas
Protected Sub LnkDvModalTipoVentaAceptar_Click(sender As Object, e As EventArgs) Protected Sub LnkDvModalTipoVentaAceptar_Click(sender As Object, e As EventArgs)
If DdlClientesWS.SelectedValue.ToEntero > 0 Then If DdlClienteSucursalCliente() > 0 Then
ViewState("CveCliente") = DdlClientesWS.SelectedValue.ToEntero ViewState("CveCliente") = DdlClienteSucursalCliente()
Else Else
Alert("Debe de seleccionar un cliente.", TipoMensaje.MsgAdvertencia) Alert("Debe de seleccionar un cliente.", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
@@ -36177,7 +36231,7 @@ Partial Class Ventas
CargaCliente(CveCliente) CargaCliente(CveCliente)
DdlSucursalCliente.SelectedValueExist(DdlSucursalClienteModal.SelectedValue) DdlSucursalCliente.SelectedValueExist(DdlClienteSucursalSucursal)
DdlTipoComprobante_SelectedIndexChanged(sender, Nothing) DdlTipoComprobante_SelectedIndexChanged(sender, Nothing)
@@ -36234,7 +36288,7 @@ Partial Class Ventas
End Sub End Sub
Protected Sub DdlProcedimientoModal_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlProcedimientoModal_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaPSProcedimiento(DdlProcedimientoModal.SelectedValue.ToEntero, DdlClientesWS.SelectedValue.ToEntero, DdlSubProyectoDatos.SelectedValue.ToEntero) CargaPSProcedimiento(DdlProcedimientoModal.SelectedValue.ToEntero, DdlClienteSucursalCliente, DdlSubProyectoDatos.SelectedValue.ToEntero)
End Sub End Sub
Private Sub CargaPSProcedimiento(CveProcedimiento As Integer, CveClienteL As Integer, CveSubProyectoL As Integer) Private Sub CargaPSProcedimiento(CveProcedimiento As Integer, CveClienteL As Integer, CveSubProyectoL As Integer)
@@ -36351,5 +36405,8 @@ Partial Class Ventas
Protected Sub BtnCargaAuxiliarConta_Click(sender As Object, e As EventArgs) Protected Sub BtnCargaAuxiliarConta_Click(sender As Object, e As EventArgs)
CargarSaldoAuxiliar(CveCliente) CargarSaldoAuxiliar(CveCliente)
End Sub End Sub
End Class End Class