-- cmbios de material utilizado
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
<asp:LinkButton ID="ImgImprimir" runat="server"> <i class="fa fa-ad-pdf"></i> Imprimir Orden</asp:LinkButton>
|
<asp:LinkButton ID="ImgImprimir" runat="server"> <i class="fa fa-ad-pdf"></i> Imprimir Orden</asp:LinkButton>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<asp:LinkButton ID="LnkAccionesDevolucion" runat="server" OnClick="LnkAccionesDevolucion_Click" Visible="false"> <i class="fa fa-plus"></i> Devolución Material</asp:LinkButton>
|
<asp:LinkButton ID="LnkAccionesMaterialUtilizado" runat="server" OnClick="LnkAccionesMaterialUtilizado_Click" Visible="false"> <i class="fa fa-plus"></i> Material Utilizado</asp:LinkButton>
|
||||||
</li>
|
</li>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
<Triggers>
|
<Triggers>
|
||||||
@@ -1262,24 +1262,24 @@
|
|||||||
<%--MODAL FINALIZAR ORDEN INICIO --%>
|
<%--MODAL FINALIZAR ORDEN INICIO --%>
|
||||||
|
|
||||||
|
|
||||||
<div id="DVModalSolicitarDevolucion" class="modal ADS fade" role="dialog">
|
<div id="DivModalMaterialUtilizado" class="modal ADS fade" role="dialog">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<asp:UpdatePanel ID="UpModalSolicitarDevolucion" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="UpModalMaterialUtilizado" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title" >Solicitar Devolución</h4>
|
<h4 class="modal-title" >Material Utilizado</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
|
|
||||||
<asp:GridView ID="GvSolicitarDevolucion" runat="server" AutoGenerateColumns="False" EmptyDataText="No se han capturado Historial"
|
<asp:GridView ID="GvMaterialUtilizado" runat="server" AutoGenerateColumns="False" EmptyDataText="No se han capturado Historial"
|
||||||
DataKeyNames="CveVentaDetalle,Cantidad,CveAlmacenActual,CvePS,CveUM,PU,CveMovimientoDetalle,Lote,Serie,FechaCaducidad,AplicaSerie,AplicaLote,AplicaCaducidad,CodigoPS"
|
DataKeyNames="CveVentaDetalle,Cantidad,CveAlmacenActual,CvePS,CveUM,PU,CveMovimientoDetalle,Lote,Serie,FechaCaducidad,AplicaSerie,AplicaLote,AplicaCaducidad,CodigoPS"
|
||||||
CssClass="table table-striped table-advance table-hover Widthall" GridLines="None" OnRowDataBound="GvSolicitarDevolucion_RowDataBound">
|
CssClass="table table-striped table-advance table-hover Widthall" GridLines="None" OnRowDataBound="GvMaterialUtilizado_RowDataBound">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
<HeaderTemplate>Cant.</HeaderTemplate>
|
<HeaderTemplate>Cant.</HeaderTemplate>
|
||||||
@@ -1288,7 +1288,7 @@
|
|||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
<HeaderTemplate>Dev</HeaderTemplate>
|
<HeaderTemplate>Utilizado</HeaderTemplate>
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:TextBox ID="TxtDev" runat="server" Width="50px" ></asp:TextBox>
|
<asp:TextBox ID="TxtDev" runat="server" Width="50px" ></asp:TextBox>
|
||||||
<ajax:FilteredTextBoxExtender runat="server" FilterType="Custom" TargetControlID="TxtDev" ValidChars="123456789." />
|
<ajax:FilteredTextBoxExtender runat="server" FilterType="Custom" TargetControlID="TxtDev" ValidChars="123456789." />
|
||||||
@@ -1301,35 +1301,22 @@
|
|||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
||||||
<asp:TemplateField>
|
|
||||||
<HeaderTemplate>Lote</HeaderTemplate>
|
|
||||||
<ItemTemplate>
|
|
||||||
<asp:TextBox ID="TxtLote" runat="server" Width="50px" Text='<%# Eval("Lote") %>' Visible="false"></asp:TextBox>
|
|
||||||
</ItemTemplate>
|
|
||||||
</asp:TemplateField>
|
|
||||||
|
|
||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
<HeaderTemplate>Serie</HeaderTemplate>
|
<HeaderTemplate>Serie</HeaderTemplate>
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:TextBox ID="TxtSerie" runat="server" Width="50px" Text='<%# Eval("Serie") %>' Visible="false" ></asp:TextBox>
|
<asp:Label ID="TxtSerie" runat="server" Width="50px" Text='<%# Eval("Serie") %>' Visible="false" ></asp:Label>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField>
|
||||||
|
<HeaderTemplate>Lote</HeaderTemplate>
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Label ID="TxtLote" runat="server" Width="50px" Text='<%# Eval("Lote") %>' Visible="false"></asp:Label>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
<HeaderTemplate>Fecha Cad.</HeaderTemplate>
|
<HeaderTemplate>Fecha Cad.</HeaderTemplate>
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
|
<asp:Label ID="TxtFechaCaducidad" runat="server" Width="70px" Text='<%# Eval("FechaCaducidad", "{0:d}") %>' ></asp:Label>
|
||||||
<div runat="server" id="DVFechaCaducidad" visible="false">
|
|
||||||
|
|
||||||
<asp:TextBox ID="TxtFechaCaducidad" runat="server" Width="70px" Text='<%# Eval("FechaCaducidad") %>' ></asp:TextBox>
|
|
||||||
<ajax:MaskedEditExtender ID="METxtFechaCaducidad" runat="server" TargetControlID="TxtFechaCaducidad" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
|
||||||
<ajax:CalendarExtender runat="server" ID="CCTxtFechaCaducidad" TargetControlID="TxtFechaCaducidad" PopupButtonID="TxtFechaCaducidad" PopupPosition="BottomLeft" ></ajax:CalendarExtender>
|
|
||||||
<asp:CompareValidator ID="CVTxtFechaCaducidad" runat="server" ControlToValidate="TxtFechaCaducidad" Display="None"
|
|
||||||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Caducidad''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)."
|
|
||||||
Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpDevolucion">
|
|
||||||
</asp:CompareValidator>
|
|
||||||
<ajax:ValidatorCalloutExtender ID="VCTxtFechaCaducidad" runat="server" HighlightCssClass="vco" TargetControlID="CVTxtFechaCaducidad" Width="350px"></ajax:ValidatorCalloutExtender>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
@@ -1346,8 +1333,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
|
|
||||||
<asp:LinkButton ID="LnkModalSolicitarDevolucion" runat="server" CssClass="btn btn-primary" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" ValidationGroup="GrpDevolucion"
|
<asp:LinkButton ID="LnkModalMaterialUtilizado" runat="server" CssClass="btn btn-primary" data-toggle="confirmation" data-popout="true" data-original-title="El material definido es el correcto?" data-btn-ok-label="si" ValidationGroup="GrpDevolucion"
|
||||||
OnClick="LnkModalSolicitarDevolucion_Click" >Guardar</asp:LinkButton>
|
OnClick="LnkModalMaterialUtilizado_Click" >Guardar</asp:LinkButton>
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -704,7 +704,7 @@ Partial Class OS_OrdenesServicios
|
|||||||
|
|
||||||
|
|
||||||
If CveVenta > 0 And TipoEstatus.Contiene(1, 2, 3) Then
|
If CveVenta > 0 And TipoEstatus.Contiene(1, 2, 3) Then
|
||||||
LnkAccionesDevolucion.Visible = True
|
LnkAccionesMaterialUtilizado.Visible = True
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
Alert("La Orden de Servicio Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
|
Alert("La Orden de Servicio Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
|
||||||
@@ -1192,7 +1192,7 @@ Partial Class OS_OrdenesServicios
|
|||||||
|
|
||||||
#Region "P E R M I S O S"
|
#Region "P E R M I S O S"
|
||||||
Private Sub PermisosSegunEstatus()
|
Private Sub PermisosSegunEstatus()
|
||||||
Dim TipoEstatus = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor(String.Format("TipoEstatus", "CveEstatusOrdenServicio = {0}", "CveEstatusOrdenServicio ASC", DdlEstatusOS.SelectedValue.ToEntero))
|
Dim TipoEstatus As String = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor(String.Format("TipoEstatus", "CveEstatusOrdenServicio = {0}", "CveEstatusOrdenServicio ASC", DdlEstatusOS.SelectedValue.ToEntero))
|
||||||
|
|
||||||
Select Case TipoEstatus.ToEntero
|
Select Case TipoEstatus.ToEntero
|
||||||
Case 1
|
Case 1
|
||||||
@@ -1258,7 +1258,7 @@ Partial Class OS_OrdenesServicios
|
|||||||
|
|
||||||
Dim Errores As Boolean = False
|
Dim Errores As Boolean = False
|
||||||
Dim EstatusOrdenServicio As Integer = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 1").ToEntero
|
Dim EstatusOrdenServicio As Integer = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 1").ToEntero
|
||||||
Dim DirectorioEmpresa = UsuarioActual.Empresa.Ruta
|
Dim DirectorioEmpresa As String = UsuarioActual.Empresa.Ruta
|
||||||
|
|
||||||
|
|
||||||
If Not CveOS > 0 Then
|
If Not CveOS > 0 Then
|
||||||
@@ -1354,8 +1354,7 @@ Partial Class OS_OrdenesServicios
|
|||||||
MensajeAlert.AppendFormat(String.Format("<br/>La Orden de Servicio: <b>{0}</b> se generó correctamente.<br/><br/>", ObjOrdenServicio.Folio))
|
MensajeAlert.AppendFormat(String.Format("<br/>La Orden de Servicio: <b>{0}</b> se generó correctamente.<br/><br/>", ObjOrdenServicio.Folio))
|
||||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=OS&CVEOS={0}", ObjOrdenServicio.CveOS)))
|
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=OS&CVEOS={0}", ObjOrdenServicio.CveOS)))
|
||||||
|
|
||||||
|
Dim Liga As String = $"document.location.href=""/OS/RepOrdenesServicios.aspx"";"
|
||||||
Dim Liga = $"document.location.href=""/OS/RepOrdenesServicios.aspx"";"
|
|
||||||
|
|
||||||
ObjOrdenServicio.Commit()
|
ObjOrdenServicio.Commit()
|
||||||
|
|
||||||
@@ -1603,7 +1602,7 @@ Partial Class OS_OrdenesServicios
|
|||||||
Protected Sub imgEstatus_Click(sender As Object, e As EventArgs)
|
Protected Sub imgEstatus_Click(sender As Object, e As EventArgs)
|
||||||
Dim Row As GridViewRow = DirectCast(DirectCast(sender, Control).NamingContainer, GridViewRow)
|
Dim Row As GridViewRow = DirectCast(DirectCast(sender, Control).NamingContainer, GridViewRow)
|
||||||
|
|
||||||
Dim Estatus = TmpDT(Row.RowIndex)("Estatus").ToString
|
Dim Estatus As String = TmpDT(Row.RowIndex)("Estatus").ToString
|
||||||
|
|
||||||
If Estatus = "False" Then
|
If Estatus = "False" Then
|
||||||
TmpDT.Rows(Row.RowIndex)("Estatus") = "True"
|
TmpDT.Rows(Row.RowIndex)("Estatus") = "True"
|
||||||
@@ -1616,7 +1615,7 @@ Partial Class OS_OrdenesServicios
|
|||||||
End Sub
|
End Sub
|
||||||
Private Sub BtnAddGvDetalle_Click(sender As Object, e As EventArgs) Handles BtnAddGvDetalle.Click
|
Private Sub BtnAddGvDetalle_Click(sender As Object, e As EventArgs) Handles BtnAddGvDetalle.Click
|
||||||
Dim ObjOS As New ClsOS
|
Dim ObjOS As New ClsOS
|
||||||
Dim TieneError = False
|
Dim TieneError As Boolean = False
|
||||||
|
|
||||||
If CveCliente > 0 Then
|
If CveCliente > 0 Then
|
||||||
If DdlPSDetalle.SelectedValue.ToEntero > 0 Then
|
If DdlPSDetalle.SelectedValue.ToEntero > 0 Then
|
||||||
@@ -2972,7 +2971,7 @@ Partial Class OS_OrdenesServicios
|
|||||||
End Sub
|
End Sub
|
||||||
Private Sub BtnCambiarTecnico_Click(sender As Object, e As EventArgs) Handles BtnCambiarTecnico.Click
|
Private Sub BtnCambiarTecnico_Click(sender As Object, e As EventArgs) Handles BtnCambiarTecnico.Click
|
||||||
Dim ObjOS As New ClsOS
|
Dim ObjOS As New ClsOS
|
||||||
Dim TieneError = False
|
Dim TieneError As Boolean = False
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(151).ToString = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(151).ToString = "1" Then
|
||||||
If Not ObjOS.UpdateTecnicoOS(DdlTecnico.SelectedValue.ToEntero, CveOS) Then
|
If Not ObjOS.UpdateTecnicoOS(DdlTecnico.SelectedValue.ToEntero, CveOS) Then
|
||||||
@@ -3041,76 +3040,45 @@ Partial Class OS_OrdenesServicios
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub LnkAccionesMaterialUtilizado_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
LnkModalMaterialUtilizado.Visible = True
|
||||||
|
GvMaterialUtilizado.DataSource = Nothing
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Protected Sub LnkAccionesDevolucion_Click(sender As Object, e As EventArgs)
|
|
||||||
|
|
||||||
LnkModalSolicitarDevolucion.Visible = True
|
|
||||||
|
|
||||||
GvSolicitarDevolucion.DataSource = Nothing
|
|
||||||
DTSolicitudDev = New DataTable
|
DTSolicitudDev = New DataTable
|
||||||
|
|
||||||
Dim ObjOS As New ClsOS
|
Dim ObjOS As New ClsOS
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If ObjOS.GetOrdenesServicioDevolucionMaterial(CveOS, CveVenta, UsuarioActual.CveEmpresa) Then
|
If ObjOS.GetOrdenesServicioDevolucionMaterial(CveOS, CveVenta, UsuarioActual.CveEmpresa) Then
|
||||||
DTSolicitudDev = ObjOS.DtResultados
|
DTSolicitudDev = ObjOS.DtResultados
|
||||||
GvSolicitarDevolucion.DataSource = DTSolicitudDev
|
GvMaterialUtilizado.DataSource = DTSolicitudDev
|
||||||
|
GvMaterialUtilizado.Columns(3).Visible = DTSolicitudDev.MIN("Serie") <> ""
|
||||||
|
GvMaterialUtilizado.Columns(4).Visible = DTSolicitudDev.MIN("Lote") <> ""
|
||||||
|
GvMaterialUtilizado.Columns(5).Visible = DTSolicitudDev.MIN("FechaCaducidad") <> ""
|
||||||
End If
|
End If
|
||||||
|
|
||||||
ObjOS.Dispose()
|
ObjOS.Dispose()
|
||||||
GvSolicitarDevolucion.DataBind()
|
GvMaterialUtilizado.DataBind()
|
||||||
|
|
||||||
Dim EsDevolucionVenta As Boolean = (DTSolicitudDev.FiltroPrimeroValor("EsDevolucionVenta", "").ToEntero > 0)
|
Dim EsDevolucionVenta As Boolean = (DTSolicitudDev.FiltroPrimeroValor("EsDevolucionVenta", "").ToEntero > 0)
|
||||||
|
|
||||||
RegistraScript("$('#DVModalSolicitarDevolucion').modal();")
|
RegistraScript("$('#DivModalMaterialUtilizado').modal();")
|
||||||
|
|
||||||
If EsDevolucionVenta Then
|
If EsDevolucionVenta Then
|
||||||
Alert("Ya existe una solicitud de devolución", TipoMensaje.MsgAdvertencia)
|
Alert("En la orden de servicio ya se determinó el material utilizado.", TipoMensaje.MsgAdvertencia)
|
||||||
LnkModalSolicitarDevolucion.Visible = False
|
LnkModalMaterialUtilizado.Visible = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
UpModalSolicitarDevolucion.Update()
|
UpModalMaterialUtilizado.Update()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub GvSolicitarDevolucion_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
Protected Sub GvMaterialUtilizado_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||||
|
|
||||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||||
|
|
||||||
e.Row.FCTextBox("TxtDev").Attributes.Add("onblur", String.Format("ValidarCantidad(this, {0})", e.Row.DataKey("Cantidad")))
|
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 If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub LnkModalSolicitarDevolucion_Click(sender As Object, e As EventArgs)
|
Protected Sub LnkModalMaterialUtilizado_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
Dim CveAlmacenActual As Integer = DTSolicitudDev.FiltroPrimeroValor("CveAlmacenActual").ToEntero
|
Dim CveAlmacenActual As Integer = DTSolicitudDev.FiltroPrimeroValor("CveAlmacenActual").ToEntero
|
||||||
Dim CveMoneda As Integer = DTSolicitudDev.FiltroPrimeroValor("CveMoneda").ToEntero
|
Dim CveMoneda As Integer = DTSolicitudDev.FiltroPrimeroValor("CveMoneda").ToEntero
|
||||||
@@ -3125,82 +3093,72 @@ Partial Class OS_OrdenesServicios
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Dim SbErroresDev As New StringBuilder
|
Dim SbErroresDev As New StringBuilder
|
||||||
|
|
||||||
For Each GvRow As GridViewRow In GvSolicitarDevolucion.Rows
|
For Each GvRow As GridViewRow In GvMaterialUtilizado.Rows
|
||||||
|
|
||||||
|
|
||||||
If GvRow.DataKey("Cantidad").ToDecimal > 0 Then
|
If GvRow.DataKey("Cantidad").ToDecimal > 0 Then
|
||||||
|
|
||||||
Dim sbTemperror As New StringBuilder
|
Dim sbTemperror As New StringBuilder
|
||||||
Dim ErrorCountDev As Integer = 0
|
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
|
||||||
|
|
||||||
sbTemperror.Append($"Producto: {GvRow.DataKey("CodigoPS") } requiere: ")
|
'If Boolean.Parse(GvRow.DataKey("AplicaLote")) Then
|
||||||
|
' If GvRow.FCTextBox("TxtLote").Text = String.Empty Then
|
||||||
|
' sbTemperror.Append($" Lote, ")
|
||||||
If Boolean.Parse(GvRow.DataKey("AplicaSerie")) Then
|
' ErrorCountDev = ErrorCountDev + 1
|
||||||
If GvRow.FCTextBox("TxtSerie").Text.Trim = String.Empty Then
|
' End If
|
||||||
sbTemperror.Append($" Serie, ")
|
'End If
|
||||||
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($"<br/>")
|
|
||||||
SbErroresDev.AppendLine(sbTemperror.ToString)
|
|
||||||
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($"<br/>")
|
||||||
|
' SbErroresDev.AppendLine(sbTemperror.ToString)
|
||||||
|
'End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
|
||||||
If SbErroresDev.ToString.Length > 0 Then
|
If SbErroresDev.ToString.Length > 0 Then
|
||||||
Alert($"Se encontraron los siguientes errores: <br> {SbErroresDev.ToString}", TipoMensaje.MsgAdvertencia)
|
Alert($"Se encontraron los siguientes errores: <br> {SbErroresDev.ToString}", TipoMensaje.MsgAdvertencia)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim PropcesoOK As Boolean = True
|
Dim ProcesoOK As Boolean = True
|
||||||
Dim ObjV As New ClsVentas
|
Dim ObjV As New ClsVentas
|
||||||
ObjV.IniciaTransacSQL()
|
ObjV.IniciaTransacSQL()
|
||||||
|
|
||||||
If Not ObjV.UpdateVentasDevolucionAlmacen(1, CveVenta) Then
|
If Not ObjV.UpdateVentasDevolucionAlmacen(1, CveVenta) Then
|
||||||
PropcesoOK = False
|
ProcesoOK = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If PropcesoOK Then
|
If ProcesoOK Then
|
||||||
For Each GvRow As GridViewRow In GvSolicitarDevolucion.Rows
|
For Each GvRow As GridViewRow In GvMaterialUtilizado.Rows
|
||||||
|
|
||||||
Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero
|
Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero
|
||||||
Dim CantidadDev As Decimal = GvRow.FCTextBox("TxtDev").Text.ToDecimal
|
Dim CantidadDev As Decimal = GvRow.FCTextBox("TxtDev").Text.ToDecimal
|
||||||
|
|
||||||
If CantidadDev > 0 Then
|
If CantidadDev > 0 Then
|
||||||
If Not ObjV.UpdateVentasDetalleCantidadDevolucion(CveVentaDetalle, CantidadDev) Then
|
If Not ObjV.UpdateVentasDetalleCantidadDevolucion(CveVentaDetalle, CantidadDev) Then
|
||||||
PropcesoOK = False
|
ProcesoOK = False
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If PropcesoOK Then
|
If ProcesoOK Then
|
||||||
|
|
||||||
Dim ObjInventario As New ClsInventarios(ObjV.IniciaTransacSQL())
|
Dim ObjInventario As New ClsInventarios(ObjV.IniciaTransacSQL())
|
||||||
|
|
||||||
@@ -3209,34 +3167,30 @@ Partial Class OS_OrdenesServicios
|
|||||||
|
|
||||||
If CveMovimiento > 0 Then
|
If CveMovimiento > 0 Then
|
||||||
|
|
||||||
For Each GvRow As GridViewRow In GvSolicitarDevolucion.Rows
|
For Each GvRow As GridViewRow In GvMaterialUtilizado.Rows
|
||||||
|
|
||||||
Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal
|
Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal
|
||||||
Dim CantidadDev As Decimal = GvRow.FCTextBox("TxtDev").Text.ToDecimal
|
Dim CantidadRegistro As Decimal = GvRow.FCTextBox("TxtDev").Text.ToDecimal
|
||||||
Dim CantidadRegistro = Cantidad - CantidadDev
|
|
||||||
Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
|
Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
|
||||||
Dim CveUM As Integer = GvRow.DataKey("CveUM").ToEntero
|
Dim CveUM As Integer = GvRow.DataKey("CveUM").ToEntero
|
||||||
Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal
|
Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal
|
||||||
Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero
|
Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero
|
||||||
Dim CveMovimientoDetalle As Integer = GvRow.DataKey("CveMovimientoDetalle").ToEntero
|
Dim CveMovimientoDetalle As Integer = GvRow.DataKey("CveMovimientoDetalle").ToEntero
|
||||||
|
|
||||||
Dim Lote As String = GvRow.FCTextBox("TxtLote").Text.Trim
|
Dim Serie As String = GvRow.DataKey("Serie")
|
||||||
Dim Serie As String = GvRow.FCTextBox("TxtSerie").Text.Trim
|
Dim Lote As String = GvRow.DataKey("Lote")
|
||||||
Dim FechaCaducidad As DateTime = GvRow.FCTextBox("TxtFechaCaducidad").Text.ToDate
|
Dim FechaCaducidad As DateTime = GvRow.DataKey("FechaCaducidad").ToDate
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If CantidadRegistro > 0 Then
|
If CantidadRegistro > 0 Then
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadRegistro, CveUM, CvePS, PU, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalle, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadRegistro, CveUM, CvePS, PU, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalle, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad) Then
|
||||||
Alert("Error al agregar detalle de movimiento.", TipoMensaje.MsgAdvertencia)
|
Alert("Error al agregar detalle de movimiento.", TipoMensaje.MsgAdvertencia)
|
||||||
PropcesoOK = False
|
ProcesoOK = False
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
If PropcesoOK Then
|
If ProcesoOK Then
|
||||||
|
|
||||||
Dim CveMovimientoSalida As Integer = ObjInventario.AddMovimiento(CveAlmacenDestino, 9, CveMoneda, ClsPaginas.NowADS(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaPedido, CveSubProyectoPedido, -1, CveOS:=CveOS, CveMovimientoRelacionado:=CveMovimiento)
|
Dim CveMovimientoSalida As Integer = ObjInventario.AddMovimiento(CveAlmacenDestino, 9, CveMoneda, ClsPaginas.NowADS(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaPedido, CveSubProyectoPedido, -1, CveOS:=CveOS, CveMovimientoRelacionado:=CveMovimiento)
|
||||||
|
|
||||||
@@ -3257,48 +3211,36 @@ Partial Class OS_OrdenesServicios
|
|||||||
|
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Cantidad, CveUM, CvePS, PU, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalle, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Cantidad, CveUM, CvePS, PU, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalle, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad) Then
|
||||||
Alert("Error al agregar detalle de movimiento.", TipoMensaje.MsgAdvertencia)
|
Alert("Error al agregar detalle de movimiento.", TipoMensaje.MsgAdvertencia)
|
||||||
PropcesoOK = False
|
ProcesoOK = False
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
If ProcesoOK Then
|
||||||
If PropcesoOK Then
|
|
||||||
|
|
||||||
Dim ObjEventos As New ClsOIEventos(ObjInventario.IniciaTransacSQL)
|
Dim ObjEventos As New ClsOIEventos(ObjInventario.IniciaTransacSQL)
|
||||||
Dim LigaVenta As String = String.Format("Venta {2} en Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovimiento, Folio, "Material utilizado")
|
Dim LigaVenta As String = String.Format("Venta {2} en Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovimiento, Folio, "Material utilizado")
|
||||||
|
|
||||||
If Not ObjEventos.AddEventoBitacora(LigaVenta, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVentaPedido, CveOS:=CveOS) Then
|
If Not ObjEventos.AddEventoBitacora(LigaVenta, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVentaPedido, CveOS:=CveOS) Then
|
||||||
PropcesoOK = False
|
ProcesoOK = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
PropcesoOK = False
|
ProcesoOK = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
Else
|
||||||
Else
|
ProcesoOK = False
|
||||||
PropcesoOK = False
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If ProcesoOK Then
|
||||||
If PropcesoOK Then
|
|
||||||
'ObjV.RollBack()
|
'ObjV.RollBack()
|
||||||
ObjV.Commit()
|
ObjV.Commit()
|
||||||
Alert("La solicitud de Devolución de Almacén se guardó correctamente")
|
Alert("El material utilizado se guardó correctamente")
|
||||||
RegistraScript("$('#DVModalSolicitarDevolucion').modal('hide');")
|
RegistraScript("$('#DivModalMaterialUtilizado').modal('hide');")
|
||||||
Else
|
Else
|
||||||
ObjV.RollBack()
|
ObjV.RollBack()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ObjV.Dispose()
|
ObjV.Dispose()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
Reference in New Issue
Block a user