diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index dcc9544ea..84675133f 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -8460,7 +8460,8 @@
Procedimiento: - + Seleccione uno + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + --%> + + + + + + + + + + + + +
+
+ + diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 8b3a784ff..04c334b26 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -35618,6 +35618,9 @@ Partial Class Ventas DdlMedicoModal.SelectedValueExist(-1) DdlProcedimientoModal.SelectedValueExist(-1) + GvProductosProcedimiento.DataSource = Nothing + GvProductosProcedimiento.DataBind() + UpDvModalTipoVenta.Update() End Sub @@ -35676,6 +35679,44 @@ Partial Class Ventas RegistraScript("$('#DvModalTipoVenta').modal('hide');") + + + Dim CountPsAgregados As Integer = 0 + + For Each GvRow As GridViewRow In GvProductosProcedimiento.Rows + + Dim Chk As CheckBox = GvRow.FCCheckBox("Chk") + Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidad").Text.ToDecimal + + If Chk.Checked AndAlso Cantidad > 0 Then + + + Dim CveUnidadMedida As Integer = GvRow.DataKey("CveUnidadMedida").ToEntero + Dim Abreviatura As String = GvRow.DataKey("Abreviatura").ToString + Dim PU As Decimal = GvRow.FCTextBox("TxtPrecio").Text.ToDecimal + Dim CveClasificacion As Integer = GvRow.DataKey("CveClasificacion").ToEntero + Dim Clasificacion As String = GvRow.DataKey("Clasificacion").ToString + + Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero + + + If AgregarProductoServicio(Cantidad, CveUnidadMedida, Abreviatura, CveClasificacion, Clasificacion, + CvePS, "", TxtObsPS.Text.TrimEnd, PU, 0, + DdlProyecto.SelectedValue.ToEntero(), DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedItem.Text, + Serie:=If(DIVCod.Visible, TxtCodigoSerie.Text.Trim, ""), TiempoEntrega:=TxtTiempoEntrega.Text, CuentaPredial:=TxtCuentaPredial.Text.Trim, RegeneraIEPS:=ClienteDesglosaIEPS, CvePromocionDetalle:=-1, + ImporteProntoPago:=0, ObjDescuento:=Nothing, CvePrecioLista:=-1, PrecioLista:="", NumTurnos:=0) Then + CountPsAgregados = CountPsAgregados + 1 + Else + Exit For + End If + End If + + Next + + If CountPsAgregados > 0 Then + CalculaTotalesVenta() + End If + UpCliente.Update() End Sub @@ -35687,6 +35728,27 @@ Partial Class Ventas End Sub + Protected Sub DdlProcedimientoModal_SelectedIndexChanged(sender As Object, e As EventArgs) + + + If DdlProcedimientoModal.SelectedValue.ToEntero > 0 Then + Dim objVenta As New ClsVentas + + If objVenta.GetProcedimientoProducto(DdlProcedimientoModal.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa) Then + GvProductosProcedimiento.DataSource = objVenta.DtResultados + End If + + objVenta.Dispose() + + Else + GvProductosProcedimiento.DataSource = Nothing + End If + + GvProductosProcedimiento.DataBind() + + UpDvModalTipoVenta.Update() + + End Sub Private Function GeneraOS(ByRef TransacSQL As SqlTransaction, ByRef errorList As List(Of String)) As Boolean @@ -35772,5 +35834,7 @@ Partial Class Ventas 'End Sub + + End Class