diff --git a/App_Code/ClsOS.vb b/App_Code/ClsOS.vb index ec92c6dcc..b983ac43d 100644 --- a/App_Code/ClsOS.vb +++ b/App_Code/ClsOS.vb @@ -852,13 +852,14 @@ Public Class ClsOS Return Retorno End Function - Public Function GetDetalleMateriales(CveOSDetalle As Integer, CveOS As Integer) As Boolean + Public Function GetDetalleMateriales(CveOSDetalle As Integer, CveOS As Integer, Optional FiltraTipoAlamacen As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OS_OrdenesServicioDetallesMaterialesGet") With SqlAdapter.SelectCommand.Parameters .Add("@CveOSDetalle", SqlDbType.Int).Value = CveOSDetalle .Add("@CveOS", SqlDbType.Int).Value = CveOS + .Add("@FiltraTipoAlamacen", SqlDbType.Bit).Value = FiltraTipoAlamacen End With Try diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 911f51a6b..cf41f838f 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -6342,7 +6342,7 @@ Public Class ClsVentas End Function - Public Function GetProcedimientoProducto(CveProcedimiento As Integer, Estatus As Integer, CveEmpresa As Integer) As Boolean + Public Function GetProcedimientoProducto(CveProcedimiento As Integer, Estatus As Integer, CveEmpresa As Integer, CveCliente As Integer, CveSubProyecto As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_ProcedimientosProductosGet") @@ -6351,6 +6351,8 @@ Public Class ClsVentas .Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento .Add("@Estatus", SqlDbType.Int).Value = Estatus .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index 7ca31a268..d79ec8554 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -1701,8 +1701,22 @@ Namespace Extensiones Return DirectCast(Row.FindControl(Control), MaskedEditExtender) End Function - 'AjaxControlToolkit + + Public Function FCHtmlGenericControl(ByVal Row As GridViewRow, ByVal Control As String) As HtmlGenericControl + Return DirectCast(Row.FindControl(Control), HtmlGenericControl) + End Function + + + + Public Function FCValidatorCalloutExtender(ByVal Row As GridViewRow, ByVal Control As String) As ValidatorCalloutExtender + Return DirectCast(Row.FindControl(Control), ValidatorCalloutExtender) + End Function + + + + 'AjaxControlToolkit + Public Function FCRangeValidator(ByVal Row As GridViewRow, ByVal Control As String) As RangeValidator Return DirectCast(Row.FindControl(Control), RangeValidator) diff --git a/OS/OrdenesServicios.aspx b/OS/OrdenesServicios.aspx index 3427d48b7..1bb42a407 100644 --- a/OS/OrdenesServicios.aspx +++ b/OS/OrdenesServicios.aspx @@ -355,7 +355,7 @@ - + @@ -1277,8 +1277,8 @@
- @@ -1297,9 +1297,44 @@ Concepto - + + + + Lote + + + + + + + Serie + + + + + + + Fecha Cad. + + +
+ + + + + + + + +
+
+
+ +
@@ -1311,7 +1346,7 @@
- <%--MODAL FINALIZAR ORDEN INICIO --%> + + diff --git a/OS/OrdenesServicios.aspx.vb b/OS/OrdenesServicios.aspx.vb index 735ee02a9..1c1c2b60f 100644 --- a/OS/OrdenesServicios.aspx.vb +++ b/OS/OrdenesServicios.aspx.vb @@ -875,7 +875,7 @@ Partial Class OS_OrdenesServicios Private Sub CargaMateriales() Dim objOS As New ClsOS - If objOS.GetDetalleMateriales(-1, CveOS) Then + If objOS.GetDetalleMateriales(-1, CveOS, True) Then GvMateriales.DataSource = objOS.DtResultados End If objOS.Dispose() @@ -3083,7 +3083,31 @@ Partial Class OS_OrdenesServicios Protected Sub GvSolicitarDevolucion_RowDataBound(sender As Object, e As GridViewRowEventArgs) If e.Row.RowType = DataControlRowType.DataRow Then + e.Row.FCTextBox("TxtDev").Attributes.Add("onblur", String.Format("ValidarCantidad(this, {0})", e.Row.DataKey("Cantidad"))) + + 'AplicaSerie, AplicaLote, AplicaCaducidad + If Boolean.Parse(e.Row.DataKey("AplicaSerie")) Then + e.Row.FCTextBox("TxtSerie").Visible = True + End If + + If Boolean.Parse(e.Row.DataKey("AplicaLote")) Then + e.Row.FCTextBox("TxtLote").Visible = True + End If + + If Boolean.Parse(e.Row.DataKey("AplicaCaducidad")) Then + + e.Row.FCHtmlGenericControl("DVFechaCaducidad").Visible = True + 'e.Row.FCTextBox("TxtFechaCaducidad").Visible = True + 'e.Row.FCMaskedEditExtender("METxtFechaCaducidad").Visible = True + 'e.Row.FCCalendarExtender("CCTxtFechaCaducidad").Visible = True + 'e.Row.FCCompareValidator("CVTxtFechaCaducidad").Visible = True + 'e.Row.FCValidatorCalloutExtender("VCTxtFechaCaducidad").Visible = True + + End If + + + End If End Sub @@ -3101,6 +3125,58 @@ Partial Class OS_OrdenesServicios Exit Sub End If + + + Dim SbErroresDev As New StringBuilder + + For Each GvRow As GridViewRow In GvSolicitarDevolucion.Rows + + + If GvRow.DataKey("Cantidad").ToDecimal > 0 Then + + Dim sbTemperror As New StringBuilder + Dim ErrorCountDev As Integer = 0 + + sbTemperror.Append($"Producto: {GvRow.DataKey("CodigoPS") } requiere: ") + + + If Boolean.Parse(GvRow.DataKey("AplicaSerie")) Then + If GvRow.FCTextBox("TxtSerie").Text.Trim = String.Empty Then + sbTemperror.Append($" Serie, ") + ErrorCountDev = ErrorCountDev + 1 + End If + End If + + If Boolean.Parse(GvRow.DataKey("AplicaLote")) Then + If GvRow.FCTextBox("TxtLote").Text = String.Empty Then + sbTemperror.Append($" Lote, ") + ErrorCountDev = ErrorCountDev + 1 + End If + End If + + If Boolean.Parse(GvRow.DataKey("AplicaCaducidad")) Then + If Not IsDate(GvRow.FCTextBox("TxtFechaCaducidad").Text) Then + sbTemperror.Append($" Fecha de caducidad") + ErrorCountDev = ErrorCountDev + 1 + End If + End If + + If ErrorCountDev > 0 Then + sbTemperror.Append($"
") + SbErroresDev.AppendLine(sbTemperror.ToString) + End If + + + End If + + Next + + + If SbErroresDev.ToString.Length > 0 Then + Alert($"Se encontraron los siguientes errores:
{SbErroresDev.ToString}", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + Dim PropcesoOK As Boolean = True Dim ObjV As New ClsVentas ObjV.IniciaTransacSQL() @@ -3130,6 +3206,7 @@ Partial Class OS_OrdenesServicios Dim ObjInventario As New ClsInventarios(ObjV.IniciaTransacSQL()) Dim CveMovimiento As Integer = ObjInventario.AddMovimiento(CveAlmacenActual, 8, CveMoneda, ClsPaginas.NowADS(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaPedido, CveSubProyectoPedido, -1, CveOS:=CveOS, CveAlmacenDestino:=CveAlmacenDestino) + Dim Folio As Integer = ObjInventario.Folio If CveMovimiento > 0 Then @@ -3143,9 +3220,12 @@ Partial Class OS_OrdenesServicios Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero Dim CveMovimientoDetalle As Integer = GvRow.DataKey("CveMovimientoDetalle").ToEntero - Dim Lote As String = GvRow.DataKey("Lote") - Dim Serie As String = GvRow.DataKey("Serie") - Dim FechaCaducidad As DateTime = GvRow.DataKey("FechaCaducidad").ToDateTime + + Dim Lote As String = GvRow.FCTextBox("TxtLote").Text.Trim + Dim Serie As String = GvRow.FCTextBox("TxtSerie").Text.Trim + Dim FechaCaducidad As DateTime = GvRow.FCTextBox("TxtFechaCaducidad").Text.ToDate + + If CantidadRegistro > 0 Then If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadRegistro, CveUM, CvePS, PU, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalle, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad) Then @@ -3171,6 +3251,7 @@ Partial Class OS_OrdenesServicios Dim PU As Decimal = dRow("PU").ToString.ToDecimal Dim CveVentaDetalle As Integer = dRow("CveVentaDetalle").ToString.ToEntero Dim CveMovimientoDetalle As Integer = dRow("CveMovimientoDetalle").ToString.ToEntero + Dim Lote As String = dRow("Lote").ToString Dim Serie As String = dRow("Serie").ToString Dim FechaCaducidad As DateTime = dRow("FechaCaducidad").ToString.ToDateTime @@ -3183,6 +3264,18 @@ Partial Class OS_OrdenesServicios Next + If PropcesoOK Then + + Dim ObjEventos As New ClsOIEventos(ObjInventario.IniciaTransacSQL) + Dim LigaVenta As String = String.Format("Venta {2} en Folio: {1}", CveMovimiento, Folio, "Material utilizado") + + If Not ObjEventos.AddEventoBitacora(LigaVenta, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVentaPedido, CveOS:=CveOS) Then + PropcesoOK = False + End If + + End If + + Else PropcesoOK = False End If diff --git a/Ventas/CatProcedimientoDetalle.aspx.vb b/Ventas/CatProcedimientoDetalle.aspx.vb index d666e49bd..47ccce34e 100644 --- a/Ventas/CatProcedimientoDetalle.aspx.vb +++ b/Ventas/CatProcedimientoDetalle.aspx.vb @@ -240,7 +240,7 @@ Partial Class Ventas_CatProcedimientoDetalle Dim objVenta As New ClsVentas - If objVenta.GetProcedimientoProducto(CveProcedimiento, -1, UsuarioActual.CveEmpresa) Then + If objVenta.GetProcedimientoProducto(CveProcedimiento, -1, UsuarioActual.CveEmpresa, -1, -1) Then GvProductos.DataSource = objVenta.DtResultados End If diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 1212cac5d..4880672b7 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -4098,7 +4098,7 @@ - + Seleccione uno @@ -4110,8 +4110,7 @@ - + Seleccione uno @@ -8422,7 +8421,7 @@
Cliente: - +
@@ -8473,17 +8472,16 @@
Productos utilizados en el procedimiento + DataKeyNames="CveProcedimientoProducto,CveProcedimiento,Cantidad,CvePS,CodigoPS,Autogenerado,Estatus,CveVenta,CveUnidadMedida,Abreviatura,CveClasificacion,Clasificacion" GridLines="None"> - - - - - + + + + - + - + @@ -8498,9 +8496,9 @@ --%> - + - + diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index e9f137ff9..7b0ba3040 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -35976,36 +35976,12 @@ Partial Class Ventas UpDvModalTipoVenta.Update() End Sub - 'Protected Sub DdlClientesWS_selectedindexchange(sender As Object, e As EventArgs) - - ' If DdlClientesWS.SelectedValue.ToEntero > 0 Then - - ' DvModalTipoVentaPasoCliente.Visible = False - ' DvModalTipoVentaPasoRequiereOS.Visible = True + Protected Sub DdlClientesWS_selectedindexchange(sender As Object, e As EventArgs) + CargaPSProcedimiento(DdlProcedimiento.SelectedValue.ToEntero, DdlClientesWS.SelectedValue.ToEntero, DdlSubProyectoDatos.SelectedValue.ToEntero) + End Sub - ' 'si es A - Vista o ,Fuera De Linea requiere tecnico - ' If RBLTipoVenta.SelectedValue.ToEntero.Contiene(1, 3) Then - ' ChkRequiereTecnicoModal.Checked = True - ' ChkRequiereTecnicoModal.Enabled = False - ' DvModalRequiereOSFecha.Visible = True - ' End If - - ' End If - - ' UpDvModalTipoVenta.Update() - - 'End Sub - - 'Protected Sub DdlMedicoModal_SelectedIndexChanged(sender As Object, e As EventArgs) - ' ModalValidaMedicoProcedimiento() - 'End Sub - - 'Protected Sub DdlProcedimientoModal_SelectedIndexChanged(sender As Object, e As EventArgs) - ' ModalValidaMedicoProcedimiento() - 'End Sub - Protected Sub ModalValidaMedicoProcedimiento() If DdlMedicoModal.SelectedValue.ToEntero > 0 AndAlso DdlProcedimientoModal.SelectedValue.ToEntero > 0 Then @@ -36109,26 +36085,21 @@ Partial Class Ventas 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 - + 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 Cantidad > 0 Then 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 + 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 @@ -36153,12 +36124,14 @@ Partial Class Ventas End Sub Protected Sub DdlProcedimientoModal_SelectedIndexChanged(sender As Object, e As EventArgs) + CargaPSProcedimiento(DdlProcedimiento.SelectedValue.ToEntero, DdlClientesWS.SelectedValue.ToEntero, DdlSubProyectoDatos.SelectedValue.ToEntero) + End Sub - + Private Sub CargaPSProcedimiento(CveProcedimiento As Integer, CveClienteL As Integer, CveSubProyectoL As Integer) If DdlProcedimientoModal.SelectedValue.ToEntero > 0 Then Dim objVenta As New ClsVentas - If objVenta.GetProcedimientoProducto(DdlProcedimientoModal.SelectedValue.ToEntero, 1, UsuarioActual.CveEmpresa) Then + If objVenta.GetProcedimientoProducto(CveProcedimiento, 1, UsuarioActual.CveEmpresa, CveClienteL, CveSubProyectoL) Then GvProductosProcedimiento.DataSource = objVenta.DtResultados End If @@ -36172,9 +36145,9 @@ Partial Class Ventas DVGvProductosProcedimiento.Visible = True UpDvModalTipoVenta.Update() - End Sub + Private Function GeneraOS(ByRef TransacSQL As SqlTransaction, ByRef errorList As List(Of String)) As Boolean @@ -36268,10 +36241,5 @@ Partial Class Ventas RblRNCTipo_SelectedIndexChanged(RblRNCTipo, EventArgs.Empty) RegistraScript("$('#ModalAplicarNC').modal('show');", "ModalNC") End Sub - - Protected Sub LnkTabContabilidad_Click(sender As Object, e As EventArgs) - Tab.ActiveTabIndex = 6 - CargarSaldoAuxiliar(CveCliente) - End Sub End Class