modificacion en el formulario de materiales al solicitar en la orden de servicio ERROR: al volver a guardar los materiales con la modal se volveran a guardar los materiales ya solicitados
This commit is contained in:
@@ -659,16 +659,8 @@
|
||||
<asp:DropDownList ID="DdlUnidadMedidaM" CssClass="form-control input-sm select2me " runat="server" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" Width="80px" AutoPostBack="true"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVUnidadM" runat="server" ControlToValidate="DdlUnidadMedidaM" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Unidad de Medida''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarM"></asp:RequiredFieldValidator>
|
||||
</td>
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlClasificacion" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" CssClass="form-control input-sm select2me" Style="width: 220px !important;">
|
||||
<asp:ListItem Selected="True" Text="Seleccione la Clasificación (Todas)" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:DropDownList ID="DdlPS" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="PSCodigo" DataValueField="CvePS" ValidationGroup="GrpGuardarM" CssClass="form-control input-sm select2me" Style="width: 220px !important;">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="*** Actualizar listado de Productos o Servicios ***" Value="-2"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVPsM" runat="server" ControlToValidate="DdlPS" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Producto o Servicio''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarM"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="RFVPsM" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<td style="vertical-align: top;">
|
||||
<ADS:Dropdownlost runat="server" ID="DdlPS" DataTextField="PSCodigo" DataValueField="CvePS" Width="100%" CssClassDdl="select2me" CssStyle="width: 220px;"/>
|
||||
</td>
|
||||
<td style="text-align: center; vertical-align: top;">
|
||||
<asp:LinkButton ID="LbAgregarMaterial" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardarM"></asp:LinkButton>
|
||||
|
||||
@@ -286,8 +286,8 @@ Partial Class OS_OrdenesServicios
|
||||
CargaTiposOrden()
|
||||
CargaTecnico()
|
||||
CargaPS(-1, DdlPSDetalle)
|
||||
CargaPsMateriales(-1, DdlPS)
|
||||
CargaClasificaciones()
|
||||
CargaPsMateriales()
|
||||
'CargaClasificaciones()
|
||||
CargaPSCaracteristicasOpciones()
|
||||
CargaCuentasCaracteristicas()
|
||||
CargaAlmacen()
|
||||
@@ -499,8 +499,19 @@ Partial Class OS_OrdenesServicios
|
||||
'End If
|
||||
|
||||
If TipoEstatus = 3 Then
|
||||
DisableAll()
|
||||
'DisableAll()
|
||||
|
||||
'If SeFacturara = "True" Then
|
||||
' HplFacturar.Visible = True
|
||||
' If ObjOS.CveCotizacion > 0 Then
|
||||
' HplFacturar.NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", ObjOS.CveCotizacion)
|
||||
' Else
|
||||
' HplFacturar.NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveOS={0}", CveOS)
|
||||
' End If
|
||||
'End If
|
||||
|
||||
ElseIf TipoEstatus = 4 Then
|
||||
'DisableAll()
|
||||
If SeFacturara = "True" Then
|
||||
HplFacturar.Visible = True
|
||||
If ObjOS.CveCotizacion > 0 Then
|
||||
@@ -509,9 +520,6 @@ Partial Class OS_OrdenesServicios
|
||||
HplFacturar.NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveOS={0}", CveOS)
|
||||
End If
|
||||
End If
|
||||
|
||||
ElseIf TipoEstatus = 4 Then
|
||||
DisableAll()
|
||||
End If
|
||||
|
||||
DivCliente.Attributes.Add("class", "col-md-8")
|
||||
@@ -707,12 +715,27 @@ Partial Class OS_OrdenesServicios
|
||||
Objeto.Items.Insert(0, New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2"))
|
||||
Objeto.Items.Insert(0, New ListItem("Seleccione el Servicio", "-1"))
|
||||
End Sub
|
||||
Private Sub CargaPsMateriales(CveClasificacion As Integer, Objeto As DropDownList)
|
||||
Objeto.Items.Clear()
|
||||
Objeto.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion, Estatus:=1)
|
||||
Objeto.DataBind()
|
||||
Objeto.Items.Insert(0, New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2"))
|
||||
Objeto.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
|
||||
Private Sub CargaPsMateriales()
|
||||
'Objeto.Items.Clear()
|
||||
'Objeto.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion, Estatus:=1)
|
||||
'Objeto.DataBind()
|
||||
'Objeto.Items.Insert(0, New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2"))
|
||||
'Objeto.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
|
||||
'Carga Productos
|
||||
|
||||
DdlPS.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
|
||||
'DdlPS.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue)
|
||||
DdlPS.SelectedText = ""
|
||||
DdlPS.SelectedValue = "-1"
|
||||
Else
|
||||
DdlPS.ddl.Items.Clear()
|
||||
'DdlPS.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=DdlClasificacion.SelectedValue.ToEntero)
|
||||
DdlPS.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
|
||||
DdlPS.ddl.DataBind()
|
||||
DdlPS.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaCliente(CveCliente As Integer, Optional Estatus As Integer = 1)
|
||||
Dim ObjCliente As New ClsClientes()
|
||||
@@ -847,11 +870,11 @@ Partial Class OS_OrdenesServicios
|
||||
GvPS.DataSource = TmpDT
|
||||
GvPS.DataBind()
|
||||
End Sub
|
||||
Private Sub CargaClasificaciones()
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlClasificacion.DataBind()
|
||||
'' DdlClasificacion.Items.Insert(0, New ListItem("Seleccione la Clasificación", "-1"))
|
||||
End Sub
|
||||
'Private Sub CargaClasificaciones()
|
||||
' DdlClasificacion.DataSource = GlobalDTClasificaciones.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
' DdlClasificacion.DataBind()
|
||||
' '' DdlClasificacion.Items.Insert(0, New ListItem("Seleccione la Clasificación", "-1"))
|
||||
'End Sub
|
||||
Private Sub CargaFolios(CveSub As Integer)
|
||||
Dim ObjFolios As New ClsGralFolios()
|
||||
If ObjFolios.GetFolios() Then
|
||||
@@ -2101,13 +2124,13 @@ Partial Class OS_OrdenesServicios
|
||||
UpAddMateriales.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivGvMateriales"))
|
||||
End Sub
|
||||
Private Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClasificacion.SelectedIndexChanged
|
||||
CargaPsMateriales(DdlClasificacion.SelectedValue.ToEntero, DdlPS)
|
||||
UpAddMateriales.Update()
|
||||
End Sub
|
||||
Private Sub DdlPS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPS.SelectedIndexChanged
|
||||
'Private Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClasificacion.SelectedIndexChanged
|
||||
' CargaPsMateriales()
|
||||
' UpAddMateriales.Update()
|
||||
'End Sub
|
||||
Private Sub DdlPS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPS.selectedindexchange
|
||||
If CveCliente > 0 OrElse DdlPS.SelectedValue = "-2" Then
|
||||
If DdlPS.SelectedIndex > 1 Then
|
||||
If DdlPS.SelectedValue.ToEntero > 1 Then
|
||||
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimero("")
|
||||
|
||||
If drPS IsNot Nothing Then
|
||||
@@ -2116,25 +2139,31 @@ Partial Class OS_OrdenesServicios
|
||||
DdlUnidadMedidaM.DataBind()
|
||||
DdlUnidadMedidaM.SelectedValueExist(drPS("CveUnidadMedida").ToString)
|
||||
|
||||
If DdlClasificacion.SelectedIndex = 0 Then
|
||||
If drPS("CveClasificacion").ToString IsNot Nothing Then
|
||||
DdlClasificacion.SelectedValueExist(drPS("CveClasificacion").ToString)
|
||||
Else
|
||||
'If DdlClasificacion.SelectedIndex = 0 Then
|
||||
' If drPS("CveClasificacion").ToString IsNot Nothing Then
|
||||
' DdlClasificacion.SelectedValueExist(drPS("CveClasificacion").ToString)
|
||||
' Else
|
||||
|
||||
Alert("El Productos/Servicio no tiene asignada una Clasificación.")
|
||||
End If
|
||||
End If
|
||||
' Alert("El Productos/Servicio no tiene asignada una Clasificación.")
|
||||
' End If
|
||||
'End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Private Sub LbAgregarMaterial_Click(sender As Object, e As EventArgs) Handles LbAgregarMaterial.Click
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
Dim Clasificacion As String = ""
|
||||
Dim CveClasificacion As Integer
|
||||
If ObjPS.GetPS(DdlPS.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa) Then
|
||||
Clasificacion = ObjPS.DtResultados.Rows(0)("Clasificacion").ToString
|
||||
CveClasificacion = ObjPS.CveClasificacion
|
||||
End If
|
||||
Dim Consecutivo As Integer = TmpDTMaterialesDetalle.Rows.Count + 1
|
||||
AddMaterial(CveOsDetalle, DdlClasificacion.SelectedValue.ToEntero, TxtCantidadM.Text.ToEntero, DdlClasificacion.SelectedItem.Text, DdlPS.SelectedValue.ToEntero, DdlPS.SelectedItem.Text, DdlUnidadMedidaM.SelectedValue.ToEntero, DdlUnidadMedidaM.SelectedItem.Text, Consecutivo)
|
||||
AddMaterial(CveOsDetalle, CveClasificacion, TxtCantidadM.Text.ToEntero, Clasificacion,
|
||||
DdlPS.SelectedValue.ToEntero, DdlPS.SelectedText, DdlUnidadMedidaM.SelectedValue.ToEntero, DdlUnidadMedidaM.SelectedItem.Text, Consecutivo)
|
||||
TxtCantidadM.Text = ""
|
||||
DdlClasificacion.SelectedIndex = 0
|
||||
CargaClasificaciones()
|
||||
CargaPsMateriales(-1, DdlPS)
|
||||
CargaPsMateriales()
|
||||
End Sub
|
||||
Private Sub AddMaterial(CveOSDetalle As Integer, CveClasificacion As Integer, Cantidad As Integer, Clasificacion As String, CvePS As Integer, PS As String, CveUM As Integer, UM As String, Consecutivo As Integer)
|
||||
|
||||
@@ -2188,6 +2217,8 @@ Partial Class OS_OrdenesServicios
|
||||
End Sub
|
||||
Private Sub BtnGuardarMateriales_Click(sender As Object, e As EventArgs) Handles BtnGuardarMateriales.Click
|
||||
'VALIDA ALMACEN ORIGEN Y DESTINO
|
||||
Dim ErrorEncontrado As New StringBuilder
|
||||
|
||||
If DdlAlmacenOrigen.SelectedValue = DdlAlmacenDestino.SelectedValue Then
|
||||
Alert("No se puede realizar un traspaso entre el mismo almacén.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
@@ -2235,16 +2266,25 @@ Partial Class OS_OrdenesServicios
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
Dim ObjOS As New ClsOS
|
||||
For Each Row As DataRow In TmpDTMaterialesDetalle.Rows
|
||||
Dim CveUM As Integer = Row("CveUM").ToString.ToEntero
|
||||
Dim CvePS As Integer = Row("CvePS").ToString.ToEntero
|
||||
Dim Cantidad As Integer = Row("Cantidad").ToString.ToEntero
|
||||
Dim CveClasificacion As Integer = Row("CveClasificacion").ToString.ToEntero
|
||||
|
||||
If Not ObjOS.AddUpdateDetalleMateriales(-1, CveOsDetalle, Cantidad, CveUM, CveClasificacion, CvePS, True) Then
|
||||
TieneError = True
|
||||
ErrorEncontrado.AppendFormat("Ocurrió un Error al agregar los materiales.<br/>")
|
||||
Exit For
|
||||
End If
|
||||
If Not ObjInventario.AddTrasladoSolicitudDetalle(CveTraspasoSolicitud, Cantidad, CveUM, CvePS, 0, "", -1) Then
|
||||
ErrorEncontrado.AppendFormat("Ocurrió un Error al guardar el traspaso.")
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
ObjOS.Dispose()
|
||||
End If
|
||||
|
||||
|
||||
@@ -2259,7 +2299,7 @@ Partial Class OS_OrdenesServicios
|
||||
Alert($"El Traspaso se guardó correctamente con el folio #: <b>{Folio}</b>.", TipoMensaje.MsgInformacion, $"document.location.href=""/Inventarios/TrasladoSolicitud.aspx?CveTraspasoSolicitud={CveTraspasoSolicitud}""")
|
||||
Else
|
||||
ObjInventario.RollBack()
|
||||
Alert("Ocurrió un Error al guardar el traspaso.", TipoMensaje.MsgError)
|
||||
Alert(ErrorEncontrado.ToString, TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjInventario.Dispose()
|
||||
@@ -2430,7 +2470,6 @@ Partial Class OS_OrdenesServicios
|
||||
TmpDTSolicitarMaterial.Columns.Add("UM", GetType(String))
|
||||
End Sub
|
||||
Public Sub CargaAlmacen()
|
||||
Dim tablaAuxiliar As DataTable = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1)
|
||||
DdlAlmacenOrigen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (1)") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
|
||||
DdlAlmacenOrigen.DataBind()
|
||||
DdlAlmacenOrigen.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
Reference in New Issue
Block a user