SMS - 2024.01.08 quitar Ddls Medico y Procedmiento de observaciones, solo dejar los que estan en el area de cliente

This commit is contained in:
rakcsle
2024-01-11 11:30:19 -07:00
parent e16c86064c
commit f1c4c0d359
3 changed files with 157 additions and 100 deletions

View File

@@ -1380,7 +1380,8 @@ Public Class ClsVentas
CvePresupuestoIngreso As Integer, Optional TiempoEntrega As String = "", Optional CveVentaDetallePadre As Integer = -1, CvePresupuestoIngreso As Integer, Optional TiempoEntrega As String = "", Optional CveVentaDetallePadre As Integer = -1,
Optional CveContratoDetalle As Integer = -1, Optional PorcentajeIVA As Decimal = 0, Optional IEPS As Decimal = -1, Optional PorcentajeIEPS As Double = 0, Optional CvePromocionDetalle As Integer = -1, Optional CveContratoDetalle As Integer = -1, Optional PorcentajeIVA As Decimal = 0, Optional IEPS As Decimal = -1, Optional PorcentajeIEPS As Double = 0, Optional CvePromocionDetalle As Integer = -1,
Optional CveMovimientoDetallePedido As Integer = -1, Optional ImporteRetIVA As Decimal = 0, Optional PorcentajeRetIVA As Double = 0, Optional CveMovimientoDetallePedido As Integer = -1, Optional ImporteRetIVA As Decimal = 0, Optional PorcentajeRetIVA As Double = 0,
Optional ImporteRetISR As Decimal = 0, Optional PorcentajeRetISR As Decimal = 0, Optional CuentaPredial As String = "", Optional CvePrecioLista As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional NumTurnos As Decimal = 0D) As Boolean Optional ImporteRetISR As Decimal = 0, Optional PorcentajeRetISR As Decimal = 0, Optional CuentaPredial As String = "", Optional CvePrecioLista As Integer = -1, Optional CveActivoFijo As Integer = -1,
Optional NumTurnos As Decimal = 0D, Optional EstatusAlmacen As Integer = 0) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_VentasDetalleAdd") DataAdapter("PA_VentasDetalleAdd")
@@ -1413,6 +1414,7 @@ Public Class ClsVentas
.Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
.Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
.Add("@NumTurnos", SqlDbType.Decimal).Value = NumTurnos .Add("@NumTurnos", SqlDbType.Decimal).Value = NumTurnos
.Add("@EstatusAlmacen", SqlDbType.Int).Value = EstatusAlmacen
End With End With
Try Try

View File

@@ -582,16 +582,16 @@
</tr> </tr>
<tr runat="server" id="TrVentasMedicas2" visible="false"> <tr runat="server" id="TrVentasMedicas2" visible="false">
<td runat="server" id="TdRequiereTecnico1" visible="false"> <td runat="server" id="TdRequiereTecnico1" visible="true">
<b>Requiere Técnico:</b> <b>Requiere Técnico:</b>
</td> </td>
<td runat="server" id="TdRequiereTecnico2" visible="false"> <td runat="server" id="TdRequiereTecnico2" visible="true">
<asp:CheckBox ID="ChkRequiereTecnico" runat="server" CssClass="chksino" OnCheckedChanged="ChkRequiereTecnico_CheckedChanged" AutoPostBack="true" Text="Requiere Técnico:" /> <asp:CheckBox ID="ChkRequiereTecnico" runat="server" CssClass="chksino" OnCheckedChanged="ChkRequiereTecnico_CheckedChanged" AutoPostBack="true" Text="Requiere Técnico:" />
</td> </td>
<td runat="server" id="TdFechaOS1" visible="false"> <td runat="server" id="TdFechaOS1" visible="true">
<b>Fecha de Cirugia:</b> <b>Fecha de Cirugia:</b>
</td> </td>
<td runat="server" id="TdFechaOS2" visible="false"> <td runat="server" id="TdFechaOS2" visible="true">
<asp:TextBox ID="TxtFechaOS" type="datetime-local" runat="server" CssClass="make-switchsd" CausesValidation="true" Style="width: 130px" ></asp:TextBox> <asp:TextBox ID="TxtFechaOS" type="datetime-local" runat="server" CssClass="make-switchsd" CausesValidation="true" Style="width: 130px" ></asp:TextBox>
</td> </td>
</tr> </tr>
@@ -4093,7 +4093,7 @@
</tr> </tr>
<tr align="left" id="TrObsMedico1" visible="false" runat="server"> <%--<tr align="left" id="TrObsMedico1" visible="false" runat="server">
<td>Médico:&nbsp;</td> <td>Médico:&nbsp;</td>
</tr> </tr>
<tr align="left" id="TrObsMedico2" visible="false" runat="server"> <tr align="left" id="TrObsMedico2" visible="false" runat="server">
@@ -4114,7 +4114,7 @@
<asp:ListItem Value="-1">Seleccione uno</asp:ListItem> <asp:ListItem Value="-1">Seleccione uno</asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</td> </td>
</tr> </tr>--%>
</table> </table>
@@ -8405,13 +8405,13 @@
<%--Tipo Venta--%> <%--Tipo Venta--%>
<div class="row" runat="server" visible="True" id="DvModalTipoVentaPasoTipo"> <div class="row" runat="server" visible="True" id="DvModalTipoVentaPasoTipo">
<div class="col-md-4"> <div class="col-md-3">
</div> </div>
<div class="col-md-4" style="text-align: left!important"> <div class="col-md-6" style="text-align: left!important">
<asp:RadioButtonList ID="RBLTipoVenta" DataTextField="TipoVenta" RepeatDirection="Vertical" DataValueField="CveTipoVenta" runat="server" AutoPostBack="true" OnSelectedIndexChanged="RBLTipoVenta_SelectedIndexChanged" Style="margin-top: 10px!important"> <asp:RadioButtonList ID="RBLTipoVenta" DataTextField="TipoVenta" RepeatDirection="Vertical" DataValueField="CveTipoVenta" runat="server" AutoPostBack="true" OnSelectedIndexChanged="RBLTipoVenta_SelectedIndexChanged" Style="margin-top: 10px!important">
</asp:RadioButtonList> </asp:RadioButtonList>
</div> </div>
<div class="col-md-4"> <div class="col-md-3">
</div> </div>
</div> </div>
@@ -8489,7 +8489,7 @@
<div runat="server" visible="False" id="DvModalTipoVentaPasoRequiereOS"> <div runat="server" visible="False" id="DvModalTipoVentaPasoRequiereOS">
<div class="row"> <div class="row">
<div class="form-group col-md-6 form-md-line-input input-iconright "> <div class="form-group col-md-6 form-md-line-input input-iconright ">
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlMedicoModal">Requiere Técnico:</asp:Label> <asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="ChkRequiereTecnicoModal">Requiere Técnico:</asp:Label>
<asp:CheckBox ID="ChkRequiereTecnicoModal" CssClass="chksino" runat="server" OnCheckedChanged="ChkRequiereTecnicoModal_CheckedChanged" AutoPostBack="true" Text="Requiere Técnico" /> <asp:CheckBox ID="ChkRequiereTecnicoModal" CssClass="chksino" runat="server" OnCheckedChanged="ChkRequiereTecnicoModal_CheckedChanged" AutoPostBack="true" Text="Requiere Técnico" />
</div> </div>
<div class="form-group col-md-6 form-md-line-input input-iconright " runat="server" id="DvModalRequiereOSFecha" visible="false"> <div class="form-group col-md-6 form-md-line-input input-iconright " runat="server" id="DvModalRequiereOSFecha" visible="false">

View File

@@ -2282,6 +2282,53 @@ Partial Class Ventas
End Set End Set
End Property End Property
#Region "VENTA MEDICA"
Property EsVentaMedica As Boolean
Get
If ViewState("EsVentaMedica") Is Nothing Then
ViewState("EsVentaMedica") = False
End If
Return Boolean.Parse(ViewState("EsVentaMedica").ToString)
End Get
Set(value As Boolean)
ViewState("EsVentaMedica") = value
End Set
End Property
Property SeEstaFActurandoVentaMedica As Boolean
Get
If ViewState("SeEstaFActurandoVentaMedica") Is Nothing Then
ViewState("SeEstaFActurandoVentaMedica") = False
End If
Return Boolean.Parse(ViewState("SeEstaFActurandoVentaMedica").ToString)
End Get
Set(value As Boolean)
ViewState("SeEstaFActurandoVentaMedica") = value
End Set
End Property
Public Property CveTipoVenta As Integer
Get
If ViewState("CveTipoVenta") Is Nothing Then
ViewState("CveTipoVenta") = -1
End If
Return ViewState("CveTipoVenta").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveTipoVenta") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
@@ -3391,7 +3438,7 @@ Partial Class Ventas
End If End If
End If End If
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
If CveVenta <= 0 Then If CveVenta <= 0 Then
EsVentaMedica = True EsVentaMedica = True
CargaTiposVenta() CargaTiposVenta()
@@ -5819,14 +5866,16 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
If DbRowVenta("CveMedico").ToString.ToEntero > 0 Then CveTipoVenta = If(DbRowVenta("CveTipoVenta").ToString.ToEntero > 0, DbRowVenta("CveTipoVenta").ToString.ToEntero, -1)
TrObsMedico1.Visible = True
TrObsMedico2.Visible = True
TrObsProcedimiento1.Visible = True
TrObsProcedimiento2.Visible = True
DdlMedicoObservaciones.SelectedValueExist(DbRowVenta("CveMedico").ToString) If DbRowVenta("CveMedico").ToString.ToEntero > 0 AndAlso CveTipoVenta.Contiene(1, 3, 5) Then
DdlProcedimientoObservaciones.SelectedValueExist(DbRowVenta("CveProcedimiento").ToString) TrVentasMedicas1.Visible = True
DdlMedico.SelectedValueExist(DbRowVenta("CveMedico").ToString)
DdlProcedimiento.SelectedValueExist(DbRowVenta("CveProcedimiento").ToString)
DdlMedico.Enabled = False
DdlProcedimiento.Enabled = False
End If End If
@@ -13192,20 +13241,15 @@ Partial Class Ventas
Dim CveMedico As Integer = -1 Dim CveMedico As Integer = -1
Dim CveProcedimiento As Integer = -1 Dim CveProcedimiento As Integer = -1
Dim CveTipoVentaGuardar As Integer = -1
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
If SeEstaFActurandoVentaMedica Then CveMedico = DdlMedico.SelectedValue.ToEntero
CveMedico = DdlMedicoObservaciones.SelectedValue.ToEntero CveProcedimiento = DdlProcedimiento.SelectedValue.ToEntero
CveProcedimiento = DdlProcedimientoObservaciones.SelectedValue.ToEntero CveTipoVentaGuardar = If(SeEstaFActurandoVentaMedica, CveTipoVenta, RBLTipoVenta.SelectedValue.ToEntero)
Else
CveMedico = DdlMedico.SelectedValue.ToEntero
CveProcedimiento = DdlProcedimiento.SelectedValue.ToEntero
End If
End If End If
If Not ObjVentas.AddVenta(factura.TipoDocto, factura.Folio, factura.CveCliente, factura.CveClienteSucursal, factura.SubTotalTC, factura.DescuentoTC, If Not ObjVentas.AddVenta(factura.TipoDocto, factura.Folio, factura.CveCliente, factura.CveClienteSucursal, factura.SubTotalTC, factura.DescuentoTC,
factura.AmortizacionTC, factura.IVATC, factura.RetIVATC, factura.RetISRTC, factura.AmortizacionTC, factura.IVATC, factura.RetIVATC, factura.RetISRTC,
factura.TotalTC, factura.CveMoneda, factura.TipoCambio, factura.CveMetodoPago, factura.CondicionesPago, factura.FormaPago, factura.FechaPago, factura.Fecha, factura.MotivoDescuento, factura.TotalTC, factura.CveMoneda, factura.TipoCambio, factura.CveMetodoPago, factura.CondicionesPago, factura.FormaPago, factura.FechaPago, factura.Fecha, factura.MotivoDescuento,
@@ -13223,7 +13267,7 @@ Partial Class Ventas
Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=factura.CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text, Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=factura.CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text,
FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero, FacturarSucursal:=factura.FacturarSucursal, VentaDesglosaIEPS:=factura.VentaDesglosaIEPS, RFCReceptor:=RFCReceptor, Adjunto:=Adjunto, DevolucionImportePagado:=factura.DevolucionImportePagado, EsGarantia:=factura.EsGarantia, ServicioDomicilio:=TrServicioDomicilio.Visible, FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero, FacturarSucursal:=factura.FacturarSucursal, VentaDesglosaIEPS:=factura.VentaDesglosaIEPS, RFCReceptor:=RFCReceptor, Adjunto:=Adjunto, DevolucionImportePagado:=factura.DevolucionImportePagado, EsGarantia:=factura.EsGarantia, ServicioDomicilio:=TrServicioDomicilio.Visible,
CveLineaAdicional:=DdlLineaAdicional.SelectedValue.ToEntero(), DescripcionVenta:=DescripcionVenta, CveLineaAdicional:=DdlLineaAdicional.SelectedValue.ToEntero(), DescripcionVenta:=DescripcionVenta,
CveMedico:=CveMedico, CveProcedimiento:=CveProcedimiento, CveTipoVenta:=RBLTipoVenta.SelectedValue.ToEntero, RequiereOS:=ChkRequiereTecnico.Checked) Then CveMedico:=CveMedico, CveProcedimiento:=CveProcedimiento, CveTipoVenta:=CveTipoVentaGuardar, RequiereOS:=ChkRequiereTecnico.Checked) Then
ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico") ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Else Else
If factura.TipoDocto.Contiene("Dev", "Egs") OrElse DtVentasNC IsNot Nothing OrElse CveEstatusRefacturacion > 0 OrElse CveAnticipoPadre > 0 Then If factura.TipoDocto.Contiene("Dev", "Egs") OrElse DtVentasNC IsNot Nothing OrElse CveEstatusRefacturacion > 0 OrElse CveAnticipoPadre > 0 Then
@@ -13333,13 +13377,16 @@ Partial Class Ventas
CargaNCDT(factura.CveVentaPadre, DdlTipoComprobante.SelectedValue, factura.Total, NuevaFactura:=NuevaFactura, ObjVentas:=ObjVentas) CargaNCDT(factura.CveVentaPadre, DdlTipoComprobante.SelectedValue, factura.Total, NuevaFactura:=NuevaFactura, ObjVentas:=ObjVentas)
End If End If
'Dim EsatusAlmacen As Integer = If(RBLTipoVenta.SelectedValue = "5" AndAlso EsVentaMedica AndAlso DdlTipoComprobante.SelectedValue = "Ped", 1, 0) ', EstatusAlmacen:=EsatusAlmacen
'Se agregan los PS 'Se agregan los PS
For Each Row As DataRow In TmpDTDetalle.Rows For Each Row As DataRow In TmpDTDetalle.Rows
If Not ObjVentas.AddVentaDetalle(ObjVentas.CveVenta, Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDecimal, Row("CveUM").ToString().ToEntero(), If Not ObjVentas.AddVentaDetalle(ObjVentas.CveVenta, Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDecimal, Row("CveUM").ToString().ToEntero(),
Row("PU").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("ImporteIVA").ToString().ToDecimal, Math.Round((Row("Total").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)) * (1 + Row("PorcentajeIVA").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)))), 6), Row("PU").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("ImporteIVA").ToString().ToDecimal, Math.Round((Row("Total").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)) * (1 + Row("PorcentajeIVA").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)))), 6),
Row("Obs").ToString(), Row("Descuento").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("TipoDescuento").ToString().ToEntero(), Row("CveSubProyecto").ToString().ToEntero(), Row("CvePresupuestoIngreso").ToString().ToEntero(), TiempoEntrega:=Row("TiempoEntrega").ToString(), CveVentaDetallePadre:=Row("CveVentaDetalle").ToString().ToEntero(), Row("Obs").ToString(), Row("Descuento").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("TipoDescuento").ToString().ToEntero(), Row("CveSubProyecto").ToString().ToEntero(), Row("CvePresupuestoIngreso").ToString().ToEntero(), TiempoEntrega:=Row("TiempoEntrega").ToString(), CveVentaDetallePadre:=Row("CveVentaDetalle").ToString().ToEntero(),
CveContratoDetalle:=Row("CveContratoDetalle").ToString().ToEntero(), CvePromocionDetalle:=Row("CvePromocionDetalle").ToString().ToEntero(), IEPS:=Row("ImporteIEPS").ToString().ToDecimal, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString().ToEntero(), ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDecimal, ImporteRetISR:=Row("ImporteRetISR").ToString().ToDecimal, CveContratoDetalle:=Row("CveContratoDetalle").ToString().ToEntero(), CvePromocionDetalle:=Row("CvePromocionDetalle").ToString().ToEntero(), IEPS:=Row("ImporteIEPS").ToString().ToDecimal, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString().ToEntero(), ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDecimal, ImporteRetISR:=Row("ImporteRetISR").ToString().ToDecimal,
PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDecimal, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDecimal, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDecimal, CuentaPredial:=Row("CuentaPredial").ToString(), CvePrecioLista:=Row("CvePrecioLista").ToString().ToEntero(), CveActivoFijo:=Row("CveActivoFijo").ToString().ToEntero(), NumTurnos:=Row("NumTurnos").ToString().ToDecimal()) Then PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDecimal, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDecimal,
PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDecimal, CuentaPredial:=Row("CuentaPredial").ToString(), CvePrecioLista:=Row("CvePrecioLista").ToString().ToEntero(),
CveActivoFijo:=Row("CveActivoFijo").ToString().ToEntero(), NumTurnos:=Row("NumTurnos").ToString().ToDecimal()) Then
ErrorList.Add("Ocurrió un error al agregar un Producto o Servicio a la Factura.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico") ErrorList.Add("Ocurrió un error al agregar un Producto o Servicio a la Factura.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Exit For Exit For
Else Else
@@ -21702,7 +21749,6 @@ Partial Class Ventas
BtnEditarRemision.Visible = True BtnEditarRemision.Visible = True
BtnPermisoEditarRemision.Visible = False BtnPermisoEditarRemision.Visible = False
BtnCrearApartirDe.Visible = False BtnCrearApartirDe.Visible = False
DdlSucursalCliente.Enabled = True
TxtObsFact.Enabled = True TxtObsFact.Enabled = True
TxtOrdenCompra.Enabled = True TxtOrdenCompra.Enabled = True
TxtPedidoContrato.Enabled = True TxtPedidoContrato.Enabled = True
@@ -21713,12 +21759,17 @@ Partial Class Ventas
UPCondicionesPago.Update() UPCondicionesPago.Update()
If Me.PermiteCredito Then RBLPago.Enabled = True If Me.PermiteCredito Then RBLPago.Enabled = True
DdlVendedor.Enabled = True DdlVendedor.Enabled = True
ModalidadEdicion = True ModalidadEdicion = True
ViewState("CveClienteAnterior") = CveCliente ViewState("CveClienteAnterior") = CveCliente
DdlMedicoObservaciones.Enabled = True If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso CveTipoVenta.Contiene(1, 3, 5) Then
DdlProcedimientoObservaciones.Enabled = True TrVentasMedicas1.Visible = True
DdlMedico.Enabled = True
DdlProcedimiento.Enabled = True
End If
Dim CantidadFacturadaRemision As Decimal = 0 Dim CantidadFacturadaRemision As Decimal = 0
@@ -21767,6 +21818,7 @@ Partial Class Ventas
TxtPrecio.Enabled = True TxtPrecio.Enabled = True
End If End If
LbAgregar.Enabled = True LbAgregar.Enabled = True
ImgDescTotal.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '2'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = ''; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = 'none'; $get('BtnAplicarDescG').style.display = ''; $get('TrMotivoDescuento').style.display = '';") ImgDescTotal.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '2'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = ''; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = 'none'; $get('BtnAplicarDescG').style.display = ''; $get('TrMotivoDescuento').style.display = '';")
LblSubTotal1.Text = TxtSubTotal.Text LblSubTotal1.Text = TxtSubTotal.Text
@@ -21793,9 +21845,8 @@ Partial Class Ventas
Dim ObjCGame As New ClsCGame(ObjVentas.IniciaTransacSQL()) Dim ObjCGame As New ClsCGame(ObjVentas.IniciaTransacSQL())
Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero() Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero()
Dim TipoCambio As Decimal = TxtTipoCambio.Text.ToDecimal Dim TipoCambio As Double = TxtTipoCambio.Text.ToDouble
EditoRemision = True EditoRemision = True
CveClienteSucursal = DdlSucursalCliente.SelectedValue.ToEntero
Try Try
'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS 'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS
If DdlMoneda.SelectedValue.ToEntero() <> 2 AndAlso ChkConvertirDolares.Checked Then If DdlMoneda.SelectedValue.ToEntero() <> 2 AndAlso ChkConvertirDolares.Checked Then
@@ -21872,12 +21923,12 @@ Partial Class Ventas
'Actualizo los parametros de la venta 'Actualizo los parametros de la venta
If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal, TxtIVA.Text.ToDecimal, TxtIEPS.Text.ToDecimal, TxtTotal.Text.ToDecimal, Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim, If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal, TxtIVA.Text.ToDecimal, TxtIEPS.Text.ToDecimal, TxtTotal.Text.ToDecimal, Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim,
UsuarioActual.CveEmpresa, CveVenta, UsuarioActual.CveEmpresa, CveVenta, 0, 0,
Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1), Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1),
PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(),
CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:=DdlTipoComprobante.SelectedValue, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:="Rem", CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal,
OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDecimal, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(),
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedicoObservaciones.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimientoObservaciones.SelectedValue.ToEntero) Then CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero) Then
OcurrioError = True OcurrioError = True
End If End If
@@ -30312,7 +30363,7 @@ Partial Class Ventas
End If End If
Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero() Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero()
Dim TipoCambio As Decimal = TxtTipoCambio.Text.Trim.ToDecimal Dim TipoCambio As Double = TxtTipoCambio.Text.Trim.ToDecimal
If DdlMoneda.SelectedValue.ToEntero() <> 1 AndAlso ChkConvertirDoctoPesos.Checked Then If DdlMoneda.SelectedValue.ToEntero() <> 1 AndAlso ChkConvertirDoctoPesos.Checked Then
TipoCambio = 1 TipoCambio = 1
Moneda = 1 Moneda = 1
@@ -30399,14 +30450,15 @@ Partial Class Ventas
Moneda = 1 Moneda = 1
End If End If
'ACTUALIZA VENTA 'ACTUALIZA VENTA
If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal(), TxtIVA.Text.ToDecimal(), TxtIEPS.Text.ToDecimal(), TxtTotal.Text.ToDecimal(), If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDouble(), LblDescuentos.Text.ToDouble(), TxtIVA.Text.ToDouble(), TxtIEPS.Text.ToDouble(), TxtTotal.Text.ToDouble(),
Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim, Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim,
UsuarioActual.CveEmpresa, CveVenta, UsuarioActual.CveEmpresa, CveVenta, 0, 0,
Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1), Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1),
PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(),
CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal,
TipoDocto:=DdlTipoComprobante.SelectedValue, Kilometraje:=TxtKilometraje.Text.ToDecimal, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero()) Then TipoDocto:=DdlTipoComprobante.SelectedValue, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero()) Then
MensajeError = "Ocurrió un error al actualizar la información de la cotización" MensajeError = "Ocurrió un error al actualizar la información de la cotización"
OcurrioError = True OcurrioError = True
End If End If
@@ -33676,9 +33728,10 @@ Partial Class Ventas
DdlUsoCFDI.Enabled = True DdlUsoCFDI.Enabled = True
End If End If
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso CveTipoVenta.Contiene(1, 3, 5) Then
DdlMedicoObservaciones.Enabled = True TrVentasMedicas1.Visible = True
DdlProcedimientoObservaciones.Enabled = True DdlMedico.Enabled = True
DdlProcedimiento.Enabled = True
End If End If
If UsuarioActual.TienePermisoProceso(289) Then If UsuarioActual.TienePermisoProceso(289) Then
@@ -33719,12 +33772,12 @@ Partial Class Ventas
Dim ObjVentas As New ClsVentas() Dim ObjVentas As New ClsVentas()
ObjVentas.IniciaTransacSQL() ObjVentas.IniciaTransacSQL()
DdlMedicoObservaciones.Enabled = True 'DdlMedicoObservaciones.Enabled = True
DdlProcedimientoObservaciones.Enabled = True 'DdlProcedimientoObservaciones.Enabled = True
If Not ObjVentas.UpdateObservacionesVenta(Me.CveVenta, UsuarioActual.CveEmpresa, DdlVendedor.SelectedValue.ToEntero(), TxtObsFact.Text, RblPaqueteria.SelectedValue.ToEntero(), TxtCorreoNotificaciones.Text, 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, TxtObsAlmacen.Text, TxtPedidoContrato.Text, TxtOrdenCompra.Text, TxtFechaPago.Text, DdlUsoCFDI.SelectedValue.ToEntero, DescripcionVenta:=TxtDescripcionVenta.Text.Trim,
CveMedico:=DdlMedicoObservaciones.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimientoObservaciones.SelectedValue.ToEntero) Then CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero) Then
TieneError = True TieneError = True
End If End If
@@ -35045,34 +35098,7 @@ Partial Class Ventas
End Set End Set
End Property End Property
Property EsVentaMedica As Boolean
Get
If ViewState("EsVentaMedica") Is Nothing Then
ViewState("EsVentaMedica") = False
End If
Return Boolean.Parse(ViewState("EsVentaMedica").ToString)
End Get
Set(value As Boolean)
ViewState("EsVentaMedica") = value
End Set
End Property
Property SeEstaFActurandoVentaMedica As Boolean
Get
If ViewState("SeEstaFActurandoVentaMedica") Is Nothing Then
ViewState("SeEstaFActurandoVentaMedica") = False
End If
Return Boolean.Parse(ViewState("SeEstaFActurandoVentaMedica").ToString)
End Get
Set(value As Boolean)
ViewState("SeEstaFActurandoVentaMedica") = value
End Set
End Property
@@ -36057,7 +36083,7 @@ Partial Class Ventas
RBLTipoVenta.DataSource = GlobalDTTipoVenta().FiltraParametros("Estatus = 'True' ") RBLTipoVenta.DataSource = GlobalDTTipoVenta().FiltraParametros("Estatus = 'True' ")
RBLTipoVenta.DataBind() RBLTipoVenta.DataBind()
RBLTipoVenta.Items.Add(New ListItem("Otros", "5")) RBLTipoVenta.Items.Add(New ListItem("Otros", "99"))
TrVentasMedicas1.Visible = True TrVentasMedicas1.Visible = True
TrVentasMedicas2.Visible = True TrVentasMedicas2.Visible = True
@@ -36076,8 +36102,7 @@ Partial Class Ventas
DdlProcedimientoModal.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ") DdlProcedimientoModal.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
DdlProcedimientoModal.DataBind() DdlProcedimientoModal.DataBind()
DdlProcedimientoObservaciones.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa)
DdlProcedimientoObservaciones.DataBind()
End Sub End Sub
@@ -36088,8 +36113,7 @@ Partial Class Ventas
DdlMedicoModal.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ") DdlMedicoModal.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
DdlMedicoModal.DataBind() DdlMedicoModal.DataBind()
DdlMedicoObservaciones.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa)
DdlMedicoObservaciones.DataBind()
End Sub End Sub
@@ -36140,7 +36164,11 @@ Partial Class Ventas
End Sub 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
TdFechaOS1.Visible = ChkRequiereTecnico.Checked
TdFechaOS2.Visible = ChkRequiereTecnico.Checked
UpCliente.Update() UpCliente.Update()
End Sub End Sub
@@ -36167,7 +36195,7 @@ Partial Class Ventas
Select Case RBLTipoVenta.SelectedValue Select Case RBLTipoVenta.SelectedValue
Case "1" ' Fuera de linea Case "1", "5" '1 Fuera de linea || 5 Consignación - Uso material
ChkRequiereTecnicoModal.Checked = True ChkRequiereTecnicoModal.Checked = True
ChkRequiereTecnicoModal.Enabled = True ChkRequiereTecnicoModal.Enabled = True
DvModalRequiereOSFecha.Visible = True DvModalRequiereOSFecha.Visible = True
@@ -36181,13 +36209,13 @@ Partial Class Ventas
DvModalRequiereOSFecha.Visible = False DvModalRequiereOSFecha.Visible = False
DvModalTipoVentaPasoMedicoProcedimiento.Visible = False DvModalTipoVentaPasoMedicoProcedimiento.Visible = False
DVGvProductosProcedimiento.Visible = False DVGvProductosProcedimiento.Visible = False
Case "4" 'Consigna Case "4" 'Consignación
ChkRequiereTecnicoModal.Checked = False ChkRequiereTecnicoModal.Checked = False
DvModalTipoVentaPasoRequiereOS.Visible = False DvModalTipoVentaPasoRequiereOS.Visible = False
DvModalRequiereOSFecha.Visible = False DvModalRequiereOSFecha.Visible = False
DvModalTipoVentaPasoMedicoProcedimiento.Visible = False DvModalTipoVentaPasoMedicoProcedimiento.Visible = False
DVGvProductosProcedimiento.Visible = False DVGvProductosProcedimiento.Visible = False
Case "5" ' Otros Case "99" ' Otros
LnkDvModalTipoVentaAceptar.Visible = False LnkDvModalTipoVentaAceptar.Visible = False
UpDvModalTipoVenta.Update() UpDvModalTipoVenta.Update()
RegistraScript("$('#DvModalTipoVenta').modal('hide');") RegistraScript("$('#DvModalTipoVenta').modal('hide');")
@@ -36290,6 +36318,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 DdlClienteSucursalCliente() > 0 Then If DdlClienteSucursalCliente() > 0 Then
ViewState("CveCliente") = DdlClienteSucursalCliente() ViewState("CveCliente") = DdlClienteSucursalCliente()
Else Else
@@ -36318,21 +36348,46 @@ Partial Class Ventas
DdlMedico.SelectedValueExist(DdlMedicoModal.SelectedValue) DdlMedico.SelectedValueExist(DdlMedicoModal.SelectedValue)
DdlProcedimiento.SelectedValueExist(DdlProcedimientoModal.SelectedValue) DdlProcedimiento.SelectedValueExist(DdlProcedimientoModal.SelectedValue)
'si es pago directo es factura
If RBLTipoVenta.SelectedValue.Contiene("2") Then ' Pago Directo If RBLTipoVenta.SelectedValue.Contiene("2") Then 'si es pago directo es factura
DdlTipoComprobante.SelectedValueExist("Ing") DdlTipoComprobante.SelectedValueExist("Ing")
TdRequiereTecnico1.Visible = True
TdRequiereTecnico2.Visible = True TrVentasMedicas1.Visible = True
ElseIf RBLTipoVenta.SelectedValue.Contiene("4") Then ' Consigna TrVentasMedicas2.Visible = True
DdlTipoComprobante.SelectedValueExist("Ing")
Else TdFechaOS1.Visible = True
TdFechaOS1.Visible = True TdFechaOS2.Visible = True
TdFechaOS2.Visible = True ChkRequiereTecnico.Checked = True
ChkRequiereTecnico.Checked = True ChkRequiereTecnico.Enabled = False
ChkRequiereTecnico.Enabled = False
DdlTipoComprobante.Items.Insert(DdlTipoComprobante.Items.Count, New ListItem("Pedido", "Ped")) ElseIf RBLTipoVenta.SelectedValue.Contiene("3") Then ' A vista
DdlTipoComprobante.SelectedValueExist("Ped") DdlTipoComprobante.Items.Insert(DdlTipoComprobante.Items.Count, New ListItem("Pedido", "Ped"))
End If DdlTipoComprobante.SelectedValueExist("Ped")
TrVentasMedicas1.Visible = False
TrVentasMedicas2.Visible = False
ChkRequiereTecnico.Enabled = True
ElseIf RBLTipoVenta.SelectedValue.Contiene("4") Then ' consignacion
DdlTipoComprobante.SelectedValueExist("Ing")
TrVentasMedicas1.Visible = False
TrVentasMedicas2.Visible = False
ChkRequiereTecnico.Enabled = True
Else
DdlTipoComprobante.Items.Insert(DdlTipoComprobante.Items.Count, New ListItem("Pedido", "Ped"))
DdlTipoComprobante.SelectedValueExist("Ped")
TrVentasMedicas1.Visible = True
TrVentasMedicas2.Visible = True
TdFechaOS1.Visible = True
TdFechaOS2.Visible = True
ChkRequiereTecnico.Enabled = True
ChkRequiereTecnico.Checked = ChkRequiereTecnicoModal.Checked
TdFechaOS1.Visible = ChkRequiereTecnicoModal.Checked
TdFechaOS2.Visible = ChkRequiereTecnicoModal.Checked
End If
DdlTipoComprobante.Enabled = False DdlTipoComprobante.Enabled = False
CargaCliente(CveCliente) CargaCliente(CveCliente)