Merge branch 'master' of http://jperez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -2607,7 +2607,8 @@ Public Class ClsInventarios
|
||||
|
||||
#Region "I N V E N T A R I O - F I S I C O - D E T A L L E"
|
||||
|
||||
Public Function UpdateInventarioFisicoDetalles(CveInventarioFisicoDetalle As Integer, CvePS As Integer, CveUM As Integer, Cantidad As Double) As Boolean
|
||||
Public Function UpdateInventarioFisicoDetalles(CveInventarioFisicoDetalle As Integer, CvePS As Integer, CveUM As Integer, Cantidad As Double, Optional Serie As String = "-1",
|
||||
Optional Lote As String = "-1", Optional FechaCaducidad As Date = MinFecha) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Inv_InventarioFisicoDetalleUpdate")
|
||||
@@ -2617,6 +2618,9 @@ Public Class ClsInventarios
|
||||
.Add("@CveUM", SqlDbType.Int).Value = CveUM
|
||||
.Add("@Cantidad", SqlDbType.Money).Value = Cantidad
|
||||
.Add("@CvePS", SqlDbType.Int).Value = CvePS
|
||||
.Add("@Serie", SqlDbType.VarChar).Value = Serie
|
||||
.Add("@Lote", SqlDbType.NVarChar).Value = Lote
|
||||
.Add("@FechaCaducidad", SqlDbType.Date).Value = FechaCaducidad
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -1263,14 +1263,14 @@ Partial Class Compras_Compras
|
||||
Dim ObjPersonal As New ClsRH
|
||||
ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa)
|
||||
DdlPersonal.DataSource = ObjPersonal.DtResultados
|
||||
|
||||
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
DdlPersonalReembolso.DataSource = ObjPersonal.DtResultados
|
||||
Else
|
||||
DdlPersonalReembolso.DataSource = ObjPersonal.DtResultados.FiltraParametros("CveEstatusPersonal = 1")
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
ObjPersonal.Dispose()
|
||||
DdlPersonal.DataBind()
|
||||
DdlPersonalReembolso.DataBind()
|
||||
@@ -4359,7 +4359,7 @@ Partial Class Compras_Compras
|
||||
If Not AjustaCombustibles() Then
|
||||
Exit Sub
|
||||
End If
|
||||
Exit Sub
|
||||
|
||||
|
||||
|
||||
'------------------TERMINA VALIDACIONES------------------
|
||||
@@ -8434,18 +8434,17 @@ Partial Class Compras_Compras
|
||||
Msg.Append("¿Desea realizar una evaluacion al proveedor?")
|
||||
Msg.AppendFormat($"</br><a class=""Texto"" target='_blank' href=""/Compras/EvaluacionProveedor.aspx?CveEvaluacionProveedor={CveEvaluacionProveedor}"">Evaluar Proveedor.</a>")
|
||||
End If
|
||||
|
||||
BtnGuardar.Enabled = False
|
||||
UpFacturar.Update()
|
||||
|
||||
Alert(Msg.ToString, TipoMensaje.MsgInformacion, MsgAccionAceptar)
|
||||
Else
|
||||
ObjCompras.RollBack()
|
||||
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
|
||||
Alert("Ocurrio un error al guardar la compra. Por favor intente nuevamente.", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
BtnGuardar.Enabled = False
|
||||
UpFacturar.Update()
|
||||
|
||||
Alert(Msg.ToString, TipoMensaje.MsgInformacion, MsgAccionAceptar)
|
||||
|
||||
|
||||
End If
|
||||
|
||||
Else
|
||||
@@ -8570,21 +8569,21 @@ Partial Class Compras_Compras
|
||||
|
||||
If Math.Abs(DiferenciaIVas) > 0.01D Then
|
||||
Respuesta = False
|
||||
'If IVADetalles > 0 Then
|
||||
If IVADetalles > 0 Then
|
||||
|
||||
' For Each dRow As DataRow In TmpDT.Rows
|
||||
' If dRow("IVA").ToString.ToDecimal > 0 Then
|
||||
' dRow("IVA") = dRow("IVA").ToString.ToDecimal + DiferenciaIVas
|
||||
' TmpDT.AcceptChanges()
|
||||
' Respuesta = True
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
For Each dRow As DataRow In TmpDT.Rows
|
||||
If dRow("IVA").ToString.ToDecimal > 0 Then
|
||||
dRow("IVA") = dRow("IVA").ToString.ToDecimal + DiferenciaIVas
|
||||
TmpDT.AcceptChanges()
|
||||
Respuesta = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
'Else
|
||||
' Alert("Los productos especificados en el lisado no tienen asigando impuesto IVA, favor de realizar la correción en el producto que aplique el impúesto.", TipoMensaje.MsgAdvertencia)
|
||||
' Respuesta = False
|
||||
'End If
|
||||
Else
|
||||
Alert("Los productos especificados en el lisado no tienen asigando impuesto IVA, favor de realizar la correción en el producto que aplique el impúesto.", TipoMensaje.MsgAdvertencia)
|
||||
Respuesta = False
|
||||
End If
|
||||
Else
|
||||
Respuesta = True
|
||||
End If
|
||||
@@ -12604,52 +12603,7 @@ Partial Class Compras_Compras
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "C O N T R A T O S"
|
||||
'Protected Sub ImgBtnBuscarContrato_Click(sender As Object, e As ImageClickEventArgs) Handles ImgBtnBuscarContrato.Click
|
||||
' If CveProveedor <= 0 Then
|
||||
' Alert("Debe de Seleccionar un proveedor")
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
' RegistraScript(String.Format("AbrirVentana('/Contratos/PopUpBuscarContrato.aspx?V=VCCOMP',730,300,'N');"))
|
||||
'End Sub
|
||||
|
||||
'Protected Sub CargaVContrato(sender As Object, e As EventArgs)
|
||||
' CargaVContrato2(HdnVCveContrato.Value)
|
||||
'End Sub
|
||||
|
||||
'Protected Sub CargaVContrato2(CveContrato As String)
|
||||
' If TxtContrato.Text <> "" Then
|
||||
' Dim ObjContratos As New ClsContratos
|
||||
' Dim DTContratosTemp As DataTable = Nothing
|
||||
|
||||
' GvContratos1.DataSource = TmpDT
|
||||
' GvContratos1.DataBind()
|
||||
' UPGVContratos1.Update()
|
||||
|
||||
' Dim ArrayCveContratos As String() = HdnVCveContrato.Value.Split(New Char() {","c})
|
||||
' For i As Integer = 1 To ArrayCveContratos.Count
|
||||
' If ObjContratos.GetContratosDetalle(ArrayCveContratos(i - 1).ToEntero) Then
|
||||
' If IsNothing(DTContratosTemp) Then
|
||||
' DTContratosTemp = ObjContratos.DtResultados.Copy
|
||||
' Else
|
||||
' DTContratosTemp.Merge(ObjContratos.DtResultados)
|
||||
' End If
|
||||
' Else
|
||||
' Alert("Ocurrio un ERROR al cargar el Contrato")
|
||||
' DTContratosTemp.Rows.Clear()
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
|
||||
' GvContratos2.DataSource = DTContratosTemp
|
||||
' GvContratos2.DataBind()
|
||||
' UPGVContratos2.Update()
|
||||
|
||||
' ObjContratos.Dispose()
|
||||
' End If
|
||||
'End Sub
|
||||
#End Region
|
||||
|
||||
#Region "TAB ALMACEN - INVENTARIOS ISRAEL PIÑA - 5 FEBRERO 2015"
|
||||
|
||||
@@ -18149,7 +18103,7 @@ Partial Class Compras_Compras
|
||||
Dim ObjContratos As New ClsContratos
|
||||
Dim TieneError As Boolean = False
|
||||
Dim Mensaje As String = ""
|
||||
Dim dttemp As DataTable = GlobalDTContratos().FiltraParametros(String.Format("CveSubProyecto = {0}", DdlSubProyecto.SelectedValue.ToString))
|
||||
Dim dttemp As DataTable = Nothing ' GlobalDTContratos().FiltraParametros(String.Format("CveSubProyecto = {0}", DdlSubProyecto.SelectedValue.ToString))
|
||||
If dttemp IsNot Nothing AndAlso dttemp.Rows.Count > 0 Then
|
||||
Dim drContrato As DataRow = dttemp.Rows(0)
|
||||
If ObjContratos.GetContratosDetalle(drContrato("CveContrato").ToString.ToEntero) Then
|
||||
@@ -18166,19 +18120,19 @@ Partial Class Compras_Compras
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
Mensaje = "Este producto no pertence al contrato seleccionado"
|
||||
Mensaje = "Este producto no pertenece al contrato seleccionado."
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
Mensaje = "Error al consultar el contrato"
|
||||
Mensaje = "Error al consultar el contrato."
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
Mensaje = "Este producto no pertence al contrato seleccionado"
|
||||
Mensaje = "Este producto no pertenece al contrato seleccionado."
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
Mensaje = "Error al consultar el contrato"
|
||||
Mensaje = "Error al consultar el contrato."
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -1358,6 +1358,7 @@ Partial Class PopUpVerFactura
|
||||
CveMovimientoRelacionado = ObjInventarios.DtResultados.Rows(0)("CveMtoRel").ToString().ToEntero()
|
||||
If CveConcepto.Contiene(2, 3, 26, 27, 40, 41) AndAlso ObjInventarios.DtResultados.FiltroPrimeroValor("CveMovimientoVirtual").ToEntero() > 0 Then
|
||||
FolioRelacionado = ObjInventarios.DtResultados.FiltroPrimeroValor("FolioVirtual")
|
||||
CveMovimientoRelacionado = ObjInventarios.DtResultados.FiltroPrimeroValor("CveMovimientoVirtual").ToEntero
|
||||
CveConceptoMovtoRelacionado = 37
|
||||
ElseIf CveConcepto.Contiene(36, 37) Then
|
||||
FolioRelacionado = ObjInventarios.DtResultados.FiltroPrimeroValor("FolioRelacionado")
|
||||
|
||||
@@ -365,55 +365,47 @@
|
||||
<div class="row" >
|
||||
<label class="col-md-3 truncate ">
|
||||
<asp:Label ID="LblCliente" runat="server" Text="Cliente:"></asp:Label></label>
|
||||
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList ID="DdlCliente" runat="server" AppendDataBoundItems="True" DataTextField="NombreComercial" DataValueField="CveCliente" Class="table-group-action-input form-control input-inline input-sm select2me" Style="width: 350px !important;" ValidationGroup="GrpGuardar">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
|
||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpCliente">
|
||||
<ContentTemplate>
|
||||
<div class="col-md-9">
|
||||
<ADS:Dropdownlost ID="DdlCliente" runat="server" AutoPostBack="False" DataTextField="NombreComercial" IncluyeTodos="false" DataValueField="CveCliente" CssClassDdl="select2me" CssStyle="width: 250px; "></ADS:Dropdownlost>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="row" style="display: none;">
|
||||
<label class="col-md-3 truncate ">Ubicacion:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:TextBox ID="TxtUbicacion" runat="server" MaxLength="50" Width="400px"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="display: none;">
|
||||
<label class="col-md-3 truncate ">Ubicacion:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:TextBox ID="TxtUbicacion" runat="server" MaxLength="50" Width="400px"></asp:TextBox>
|
||||
</div>
|
||||
<div class="row" id="divResponsable" runat="server">
|
||||
<label class="col-md-3 truncate ">Responsable:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:TextBox ID="TxtResponsable" runat="server" MaxLength="50" Width="400px"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="divResponsable" runat="server">
|
||||
<label class="col-md-3 truncate ">Responsable:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:TextBox ID="TxtResponsable" runat="server" MaxLength="50" Width="400px"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" id="div3" runat="server">
|
||||
<label class="col-md-3 truncate ">Lugar:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:TextBox ID="TxtLugar" runat="server" MaxLength="300" Width="400px"></asp:TextBox>
|
||||
</div>
|
||||
<div class="row" id="div3" runat="server">
|
||||
<label class="col-md-3 truncate ">Lugar:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:TextBox ID="TxtLugar" runat="server" MaxLength="300" Width="400px"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-3 truncate">Tipo Contrato:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList ID="DdlTipoContratoObra" runat="server" CssClass="select2me" Width="150px" >
|
||||
<asp:ListItem Value="-1">Seleccione uno</asp:ListItem>
|
||||
<asp:ListItem Value="30">Obra</asp:ListItem>
|
||||
<asp:ListItem Value="31">Comercial</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<label class="col-md-3 truncate">Tipo Contrato:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList ID="DdlTipoContratoObra" runat="server" CssClass="select2me" Width="150px" >
|
||||
<asp:ListItem Value="-1">Seleccione uno</asp:ListItem>
|
||||
<asp:ListItem Value="30">Obra</asp:ListItem>
|
||||
<asp:ListItem Value="31">Comercial</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
|
||||
<asp:RequiredFieldValidator ID="RFVDdlTipoContratoObra" runat="server" InitialValue="-1" ControlToValidate="DdlTipoContratoObra" CssClass="help-block errorimput" Display="None" ErrorMessage="El campo <b>''Tipo Contrato''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCERFVDdlTipoContratoObra" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlTipoContratoObra" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
<asp:RequiredFieldValidator ID="RFVDdlTipoContratoObra" runat="server" InitialValue="-1" ControlToValidate="DdlTipoContratoObra" CssClass="help-block errorimput" Display="None" ErrorMessage="El campo <b>''Tipo Contrato''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCERFVDdlTipoContratoObra" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlTipoContratoObra" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-3 truncate">Fecha Inicial:</label>
|
||||
<div class="col-md-9">
|
||||
@@ -490,16 +482,13 @@
|
||||
<div class="caption uppercase" style="position: relative;"><i class="fa fa-info-circle"></i>Información</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body rowpadding">
|
||||
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row" id="TrCliente" runat="server" visible="False">
|
||||
<label class="col-md-3 ">
|
||||
<asp:Label ID="Label1" runat="server" Text="Cliente:"></asp:Label></label>
|
||||
<div class="col-md-9">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row" id="TrClienteSucursal" runat="server" visible="False">
|
||||
|
||||
@@ -571,8 +571,8 @@ Partial Class Contratos_ContratoObra
|
||||
End Function
|
||||
|
||||
Private Sub cargaClientes()
|
||||
DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
|
||||
DdlCliente.DataBind()
|
||||
DdlCliente.setEsWebService(True)
|
||||
DdlCliente.Attributes.Add("data-metodo", "getcliente")
|
||||
End Sub
|
||||
|
||||
Private Sub CreaDT()
|
||||
@@ -735,17 +735,19 @@ Partial Class Contratos_ContratoObra
|
||||
TxtNumeroLicitacion.Text = ObjContratos.NumeroLicitacion
|
||||
TipoContrato = ObjContratos.CveContratoTipo
|
||||
CveTipoContrato = ObjContratos.DtResultados.Rows(0)("CveContratoTipo").ToString.ToEntero
|
||||
TxtCorreoNotificacion.Text = ObjContratos.DtResultados.Rows(0)("CorreoNotificacionPedDev").ToString
|
||||
DdlCliente.SelectedValueExist(ObjContratos.DtResultados.Rows(0)("CveCliente").ToString)
|
||||
|
||||
TxtCorreoNotificacion.Text = ObjContratos.DtResultados.Rows(0)("CorreoNotificacionPedDev").ToString
|
||||
DdlCliente.SelectedValue = ObjContratos.CveCliente.ToString
|
||||
DdlCliente.SelectedText = ObjContratos.NombreComercial.ToString
|
||||
|
||||
If ObjContratos.CveProveedor > 0 Then
|
||||
' TrProveedor.Visible = True
|
||||
TrCliente.Visible = False
|
||||
CargaContratista()
|
||||
DdlContratista.SelectedValue = ObjContratos.CveProveedor.ToString
|
||||
Else
|
||||
cargaClientes()
|
||||
DdlCliente.SelectedValueExist(ObjContratos.CveCliente.ToString)
|
||||
cargaClientes()
|
||||
DdlCliente.SelectedValue = ObjContratos.CveCliente.ToString
|
||||
UpCliente.Update()
|
||||
UpGral.Update()
|
||||
CargaSucursalCliente()
|
||||
DdlSucursalCliente.SelectedValue = ObjContratos.CveSucursalCliente.ToString
|
||||
@@ -2076,7 +2078,7 @@ Partial Class Contratos_ContratoObra
|
||||
End If
|
||||
|
||||
End If
|
||||
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
|
||||
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
|
||||
e.Row.FCDropDownList("DdlUMEdit").DataSource = GlobalDTProductosServiciosEquivalencias(e.Row.DataKey("CvePS").ToString.ToEntero, -1, UsuarioActual.CveEmpresa)
|
||||
e.Row.FCDropDownList("DdlUMEdit").DataBind()
|
||||
e.Row.FCDropDownList("DdlUMEdit").SelectedValue = e.Row.DataKey("CveUM")
|
||||
@@ -3334,7 +3336,7 @@ Partial Class Contratos_ContratoObra
|
||||
Dim StrReturn As String = String.Empty
|
||||
Dim CvePS As Integer = 0
|
||||
|
||||
CvePS = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS", Opt & " = '" & Valor & "'").ToString.ToEntero
|
||||
CvePS = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS", String.Format("{0}= '{1}'", Opt, Valor.Replace("'", ""))).ToString.ToEntero
|
||||
|
||||
If CvePS > 0 Then
|
||||
StrReturn = "True|" & CvePS.ToString
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvAlmacen" runat="server" GridLines="None" DataKeyNames="CveAlmacen,Almacen" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn scrollAD" Width="100%" AutoGenerateColumns="False" EmptyDataText="No ha seleccionado un almacen" ToolTip="Listado de Almacenes">
|
||||
<asp:GridView ID="GvAlmacen" runat="server" GridLines="None" DataKeyNames="CveAlmacen,Almacen" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" data-heightfijo="150" data-height="150" Width="380px" AutoGenerateColumns="False" EmptyDataText="No ha seleccionado un almacen" ToolTip="Listado de Almacenes">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Almacen" HeaderText="Almacen" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Comandos">
|
||||
@@ -211,7 +211,7 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvClasificacion" runat="server" GridLines="None" DataKeyNames="CveClasificacion,Clasificacion" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ADSCroll" Width="100%" AutoGenerateColumns="False" ToolTip="Listado de Clasificaciones" >
|
||||
<asp:GridView ID="GvClasificacion" runat="server" GridLines="None" DataKeyNames="CveClasificacion,Clasificacion" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" data-heightfijo="150" data-height="150" Width="380px" AutoGenerateColumns="False" ToolTip="Listado de Clasificaciones" >
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Clasificacion" HeaderText="Clasificacion" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Comandos">
|
||||
@@ -258,10 +258,10 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvPS" runat="server" GridLines="None" DataKeyNames="CvePS" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" data-heightfijo="150" data-height="150" Width="100%" AutoGenerateColumns="False" EmptyDataText="">
|
||||
<asp:GridView ID="GvPS" runat="server" GridLines="None" DataKeyNames="CvePS" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" data-heightfijo="150" data-height="150" Width="380px" AutoGenerateColumns="False" EmptyDataText="">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="CodigoPS" HeaderText="Productos" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Comandos">
|
||||
<asp:BoundField DataField="CodigoPS" HeaderText="Productos" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="310px" HeaderStyle-Width="310px"/>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Comandos" ItemStyle-Width="70px" HeaderStyle-Width="70px">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" OnClick="DeleteProductosServicios_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
@@ -302,7 +302,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvClasificacionExcluida" runat="server" GridLines="None" DataKeyNames="CveClasificacion,Clasificacion" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ADSCroll" Width="100%" AutoGenerateColumns="False" ToolTip="Listado de Clasificaciones Excluidas">
|
||||
<asp:GridView ID="GvClasificacionExcluida" runat="server" GridLines="None" DataKeyNames="CveClasificacion,Clasificacion" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" data-heightfijo="150" data-height="150" Width="380px" AutoGenerateColumns="False" ToolTip="Listado de Clasificaciones Excluidas">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Clasificacion" HeaderText="Clasificacion" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Comandos">
|
||||
@@ -349,7 +349,7 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvPSExcluye" runat="server" GridLines="None" DataKeyNames="CvePS" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" data-heightfijo="150" data-height="150" Width="100%" max-heigth="" AutoGenerateColumns="False" EmptyDataText="">
|
||||
<asp:GridView ID="GvPSExcluye" runat="server" GridLines="None" DataKeyNames="CvePS" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" data-heightfijo="150" data-height="150" Width="380px" AutoGenerateColumns="False" EmptyDataText="">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="CodigoPS" HeaderText="Productos" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Comandos">
|
||||
@@ -394,7 +394,7 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvProveedor" runat="server" GridLines="None" DataKeyNames="CveProveedor,RazonSocial" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ADSCroll" Width="100%" AutoGenerateColumns="False" ToolTip="Listado de Clasificaciones" >
|
||||
<asp:GridView ID="GvProveedor" runat="server" GridLines="None" DataKeyNames="CveProveedor,RazonSocial" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" data-heightfijo="150" data-height="150" Width="380px" AutoGenerateColumns="False" ToolTip="Listado de Proveedores" >
|
||||
<Columns>
|
||||
<asp:BoundField DataField="RazonSocial" HeaderText="Proveedor" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Comandos">
|
||||
|
||||
@@ -83,6 +83,15 @@
|
||||
.SinColor th {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.divmodal{
|
||||
width: 500px;
|
||||
}
|
||||
.center {
|
||||
float: none;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
</asp:Content>
|
||||
@@ -106,6 +115,7 @@
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExcel" runat="server"><i class="fa fa-ad-excel"></i> Imprimir EXCEL</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkPDF" />
|
||||
@@ -113,7 +123,9 @@
|
||||
<asp:PostBackTrigger ControlID="LnkExcel" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExcelUniverso" runat="server" ToolTip="Descarga listado de todos los productos que se consideran para la verificación de existencias"><i class="fa fa-ad-excel"></i> Descargar productos</asp:LinkButton>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Inventario Físico Detalle
|
||||
@@ -357,7 +369,7 @@
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvIFD.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
<div style="display: inline-block;" id="SumFiltra"></div>
|
||||
</div>
|
||||
<asp:GridView ID="GvIFD" ClientIDMode="Static" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" GridLines="None" DataKeyNames="CveInventarioFisicoDetalle" ShowHeaderWhenEmpty="True" CssClass="table table-striped table-hover Widthall">
|
||||
<asp:GridView ID="GvIFD" ClientIDMode="Static" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" GridLines="None" DataKeyNames="CveInventarioFisicoDetalle, CvePS, SerieLote, Lote, FechaCaducidad, Cantidad, CveUnidadMedida" ShowHeaderWhenEmpty="True" CssClass="table table-striped table-hover Widthall">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Fecha" DataField="FechaInvFisico" DataFormatString="{0:g}"></asp:BoundField>
|
||||
<asp:BoundField HeaderText="Código Barras" DataField="CodigoBarras" ItemStyle-HorizontalAlign="Left"></asp:BoundField>
|
||||
@@ -368,6 +380,11 @@
|
||||
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" Visible="false"></asp:BoundField>
|
||||
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" Visible="false" DataFormatString="{0:d}"></asp:BoundField>
|
||||
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right"></asp:BoundField>
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkEditar" OnClick="LnkEditar_Click" runat="server" AlternateText="Editar" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-xs red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Estas seguro que desea eliminar el registro?" data-btn-ok-label="si" />
|
||||
@@ -381,6 +398,55 @@
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
<div id="ModalEditarPS" class="modal ADS fade centered" role="dialog">
|
||||
<div class="modal-dialog" id="modal">
|
||||
<asp:UpdatePanel ID="UpAddInventarioFisico" class="modal-content divmodal" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel" runat="server">Editar PS</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpEditarPS" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField ID="HfCveInventarioFisicoDetalle" Value="" runat="server"/>
|
||||
<asp:HiddenField ID="HfCvePS" Value="" runat="server"/>
|
||||
<asp:HiddenField ID="HfCveUM" Value="" runat="server"/>
|
||||
<div class="form-group form-md-line-input input-iconright" id="DivSerieEdit" runat="server">
|
||||
<asp:TextBox ID="TxtSerieLote" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="500" Width="175px"></asp:TextBox>
|
||||
<label for="<%= TxtSerieLote.ClientID.ToString()%>">Serie:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright" id="DivLoteEdit" runat="server">
|
||||
<asp:TextBox ID="TxtLoteEdit" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="500" Width="175px"></asp:TextBox>
|
||||
|
||||
<label for="<%= TxtLoteEdit.ClientID.ToString()%>">Lote:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright" id="DivFechaEdit" runat="server">
|
||||
<asp:TextBox ID="TxtFechaCaducida" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="500" Width="175px"></asp:TextBox>
|
||||
<label for="<%= TxtFechaCaducida.ClientID.ToString()%>">Fecha Caducida:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright" id="DivCantidadEdit" runat="server">
|
||||
<asp:TextBox ID="TxtCantidad" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="500" Width="175px"></asp:TextBox>
|
||||
<label for="<%= TxtCantidad.ClientID.ToString()%>">Cantidad:</label>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnGuadarEditarPS" OnClick="BtnGuadarEditarPS_Click" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <i class='material-icons'>done_all</i> Guardar</asp:LinkButton>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ Option Explicit On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports GemBox.Spreadsheet
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Inventarios_InventarioFisicoDetalle
|
||||
@@ -49,6 +50,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
@@ -153,7 +155,14 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
CveAlmacenesStr.AppendFormat("{0},", dr("CveAlmacen"))
|
||||
Next
|
||||
End If
|
||||
LblAlmacenes.Text = str.ToString
|
||||
If str.ToString.Length > 500 Then
|
||||
LblAlmacenes.Text = str.ToString.Substring(0, 500)
|
||||
LblAlmacenes.ToolTip = str.ToString
|
||||
Else
|
||||
LblAlmacenes.Text = str.ToString
|
||||
End If
|
||||
str.Clear()
|
||||
|
||||
CveAlmacenes = CveAlmacenesStr.ToString.Substring(0, CveAlmacenesStr.Length - 1)
|
||||
End If
|
||||
|
||||
@@ -165,12 +174,24 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
For Each dr As DataRow In dt.FiltraParametros("Incluye = 1").Rows
|
||||
str.AppendFormat("{0},", dr("Clasificacion"))
|
||||
Next
|
||||
LblClasif.Text = str.ToString
|
||||
If str.ToString.Length > 500 Then
|
||||
LblClasif.Text = str.ToString.Substring(0, 29)
|
||||
LblClasif.ToolTip = str.ToString
|
||||
Else
|
||||
LblClasif.Text = str.ToString
|
||||
End If
|
||||
str.Clear()
|
||||
For Each dr As DataRow In dt.FiltraParametros("Incluye = 0").Rows
|
||||
str.AppendFormat("{0},", dr("Clasificacion"))
|
||||
Next
|
||||
LblClasificacionesExcluidas.Text = str.ToString
|
||||
Next
|
||||
If str.ToString.Length > 500 Then
|
||||
LblClasificacionesExcluidas.Text = str.ToString.Substring(0, 500)
|
||||
LblClasificacionesExcluidas.ToolTip = str.ToString
|
||||
Else
|
||||
LblClasificacionesExcluidas.Text = str.ToString
|
||||
End If
|
||||
str.Clear()
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -182,13 +203,26 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
|
||||
For Each dr As DataRow In dt.FiltraParametros("Incluye = 1").Rows
|
||||
str.AppendFormat("{0},", dr("CodigoPS"))
|
||||
Next
|
||||
LblProductos.Text = str.ToString
|
||||
Next
|
||||
If str.ToString.Length > 500 Then
|
||||
LblProductos.Text = str.ToString.Substring(0, 500)
|
||||
LblProductos.ToolTip = str.ToString
|
||||
|
||||
Else
|
||||
LblProductos.Text = str.ToString
|
||||
End If
|
||||
str.Clear()
|
||||
For Each dr As DataRow In dt.FiltraParametros("Incluye = 0").Rows
|
||||
str.AppendFormat("{0},", dr("CodigoPS"))
|
||||
Next
|
||||
LblProductosExcluidos.Text = str.ToString
|
||||
Next
|
||||
If str.ToString.Length > 500 Then
|
||||
LblProductosExcluidos.Text = str.ToString.Substring(0, 500)
|
||||
LblProductosExcluidos.ToolTip = str.ToString
|
||||
Else
|
||||
LblProductosExcluidos.Text = str.ToString
|
||||
End If
|
||||
str.Clear()
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -200,8 +234,13 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
|
||||
For Each dr As DataRow In dt.FiltraParametros("Incluye = 1").Rows
|
||||
str.AppendFormat("{0},", dr("RazonSocial"))
|
||||
Next
|
||||
LblProveedores.Text = str.ToString
|
||||
Next
|
||||
If str.ToString.Length > 500 Then
|
||||
LblProveedores.Text = str.ToString.Substring(0, 500)
|
||||
LblProveedores.ToolTip = str.ToString
|
||||
Else
|
||||
LblProveedores.Text = str.ToString
|
||||
End If
|
||||
str.Clear()
|
||||
End If
|
||||
|
||||
@@ -566,7 +605,6 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
Private Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click
|
||||
Impimir(Formato:="EXCEL")
|
||||
End Sub
|
||||
|
||||
Protected Sub Impimir(Optional Formato As String = "PDF", Optional Agrupar As Boolean = False)
|
||||
Dim DtDatos As New DataTable
|
||||
Dim ObjInventario As New ClsInventarios()
|
||||
@@ -607,6 +645,86 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub LnkExcelUniverso_Click(sender As Object, e As EventArgs) Handles LnkExcelUniverso.Click
|
||||
Dim IncluyePS, ExcluyePS, IncluyeClasificacion, ExcluyeClasificacion, IncluyeProveedor As New StringBuilder
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
|
||||
If ObjInventario.GetInventarioFisicoDetallesClasificacion(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
|
||||
Dim dt As DataTable = ObjInventario.DtResultados
|
||||
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||
For Each dr As DataRow In dt.FiltraParametros("Incluye = 1").Rows
|
||||
IncluyeClasificacion.AppendFormat("{0},", dr("CveClasificacion"))
|
||||
Next
|
||||
For Each dr As DataRow In dt.FiltraParametros("Incluye = 0").Rows
|
||||
ExcluyeClasificacion.AppendFormat("{0},", dr("CveClasificacion"))
|
||||
Next
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If ObjInventario.GetInventarioFisicoDetallesProductosServicios(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
|
||||
Dim dt As DataTable = ObjInventario.DtResultados
|
||||
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||
For Each dr As DataRow In dt.FiltraParametros("Incluye = 1").Rows
|
||||
IncluyePS.AppendFormat("{0},", dr("CvePS"))
|
||||
Next
|
||||
For Each dr As DataRow In dt.FiltraParametros("Incluye = 0").Rows
|
||||
ExcluyePS.AppendFormat("{0},", dr("CvePS"))
|
||||
Next
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If ObjInventario.GetInventarioFisicoDetallesProveedores(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
|
||||
Dim dt As DataTable = ObjInventario.DtResultados
|
||||
Dim str As New StringBuilder
|
||||
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||
For Each dr As DataRow In dt.FiltraParametros("Incluye = 1").Rows
|
||||
IncluyeProveedor.AppendFormat("{0},", dr("CveProveedor"))
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
Dim dtPS As DataTable = GlobalDTPS(UsuarioActual.CveEmpresa)
|
||||
If IncluyePS.ToString <> "" Then
|
||||
dtPS = dtPS.FiltraParametros(String.Format("CvePS IN ({0})", IncluyePS.ToString.TrimEnd(",")))
|
||||
End If
|
||||
If ExcluyePS.ToString <> "" Then
|
||||
dtPS = dtPS.FiltraParametros(String.Format("CvePS NOT IN ({0})", ExcluyePS.ToString.TrimEnd(",")))
|
||||
End If
|
||||
If IncluyeClasificacion.ToString <> "" Then
|
||||
dtPS = dtPS.FiltraParametros(String.Format("CveClasificacion IN ({0})", IncluyeClasificacion.ToString.TrimEnd(",")))
|
||||
End If
|
||||
If ExcluyeClasificacion.ToString <> "" Then
|
||||
dtPS = dtPS.FiltraParametros(String.Format("CveClasificacion NOT IN ({0})", ExcluyeClasificacion.ToString.TrimEnd(",")))
|
||||
End If
|
||||
If IncluyeProveedor.ToString <> "" Then
|
||||
dtPS = dtPS.FiltraParametros(String.Format("CveProveedorCompra IN ({0})", IncluyeProveedor.ToString.TrimEnd(",")))
|
||||
End If
|
||||
dtPS = dtPS.FiltraParametros("", "PS", {"Codigo", "PS", "Clasificacion", "ProveedorCompra"})
|
||||
Dim NombreArchivo As String
|
||||
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||
Dim workbook As New ExcelFile()
|
||||
Dim worksheet = workbook.Worksheets.Add("Productos")
|
||||
worksheet.InsertDataTable(dtPS, New InsertDataTableOptions() With
|
||||
{
|
||||
.ColumnHeaders = True,
|
||||
.StartRow = 0,
|
||||
.StartColumn = 0
|
||||
})
|
||||
|
||||
'worksheet.Columns("B").Style.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(217, 217, 217), SpreadsheetColor.FromArgb(255, 255, 255))
|
||||
'worksheet.Columns("C").Style.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(217, 217, 217), SpreadsheetColor.FromArgb(255, 255, 255))
|
||||
'worksheet.Columns("Q").Style.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(217, 217, 217), SpreadsheetColor.FromArgb(255, 255, 255))
|
||||
worksheet.Rows(0).Style.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(217, 217, 217), SpreadsheetColor.FromArgb(255, 255, 255))
|
||||
|
||||
Dim columnCount = worksheet.CalculateMaxUsedColumns()
|
||||
For i = 0 To columnCount
|
||||
worksheet.Columns(i).AutoFit(1, worksheet.Rows(0), worksheet.Rows(worksheet.Rows.Count - 1))
|
||||
Next
|
||||
|
||||
NombreArchivo = "Productos"
|
||||
workbook.Save(Response, $"{NombreArchivo}.xlsx", SaveOptions.XlsxDefault)
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
Protected Sub BtnBuscarCodVarras_Click(sender As Object, e As EventArgs)
|
||||
@@ -647,4 +765,68 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
|
||||
' UPAgregarPro.Update()
|
||||
'End Sub
|
||||
|
||||
Protected Sub LnkEditar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
LimpiarModal()
|
||||
HfCveInventarioFisicoDetalle.Value = GvRow.DataKey("CveInventarioFisicoDetalle").ToString
|
||||
|
||||
HfCvePS.Value = GvRow.DataKey("CvePS").ToString
|
||||
HfCveUM.Value = GvRow.DataKey("CveUnidadMedida").ToString
|
||||
|
||||
TxtSerieLote.Text = GvRow.DataKey("SerieLote").ToString
|
||||
TxtLoteEdit.Text = GvRow.DataKey("Lote").ToString
|
||||
TxtFechaCaducida.Text = GvRow.DataKey("FechaCaducidad").ToString
|
||||
TxtCantidad.Text = GvRow.DataKey("Cantidad").ToString
|
||||
UpEditarPS.Update()
|
||||
|
||||
RegistraScript("$('#ModalEditarPS').modal('show')")
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub LimpiarModal()
|
||||
HfCveInventarioFisicoDetalle.Value = ""
|
||||
HfCvePS.Value = ""
|
||||
HfCveUM.Value = ""
|
||||
TxtSerieLote.Text = ""
|
||||
TxtLoteEdit.Text = ""
|
||||
TxtFechaCaducida.Text = ""
|
||||
TxtCantidad.Text = ""
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnGuadarEditarPS_Click(sender As Object, e As EventArgs)
|
||||
Dim objInventario As New ClsInventarios
|
||||
If Not TxtCantidad.Text.ToEntero > 0 Then
|
||||
Alert("La cantidad debe ser mayor a 0", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
Dim serie As String = IIf(TxtSerieLote.Text.ToString = "", "-1", TxtSerieLote.Text.ToString)
|
||||
Dim Lote As String = IIf(TxtLoteEdit.Text.ToString = "", "-1", TxtLoteEdit.Text.ToString)
|
||||
Dim FechaCaducida As Date = IIf(TxtFechaCaducida.Text.ToString = "", MinFecha, TxtFechaCaducida.Text.ToString.ToDate)
|
||||
|
||||
If objInventario.UpdateInventarioFisicoDetalles(HfCveInventarioFisicoDetalle.Value.ToEntero, HfCvePS.Value.ToEntero, HfCveUM.Value.ToEntero, TxtCantidad.Text.ToEntero, serie, Lote, FechaCaducida) Then
|
||||
If objInventario.GetInventarioFisicoDetalle(CveInventarioFisico, ddlUsuario.SelectedValue.ToString.ToEntero) Then
|
||||
GvIFD.DataSource = objInventario.DtResultados
|
||||
End If
|
||||
|
||||
GvIFD.DataBind()
|
||||
|
||||
If (GvIFD.Rows.Count > 0) Then
|
||||
GvIFD.UseAccessibleHeader = True
|
||||
GvIFD.HeaderRow.TableSection = TableRowSection.TableHeader
|
||||
RegistraScript("OrdenarGV();")
|
||||
End If
|
||||
|
||||
UPPInventario.Update()
|
||||
UPAgregarPro.Update()
|
||||
RegistraScript("$('#ModalEditarPS').modal('hide')")
|
||||
Alert("Se modico el producto correctamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrio un error al actuliazar", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
objInventario.Dispose()
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -2187,7 +2187,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
Dim Index = 0
|
||||
For Each gvr As GridViewRow In GvInv.Rows
|
||||
If gvr.FCCheckBox("cbInv").Checked AndAlso gvr.FCTextBox("TbCantidadF").Text.ToDecimal > 0 Then
|
||||
DtInv.Rows(Index)("CantidadSurtidaPantalla") = gvr.FCTextBox("TbCantidadF").Text.ToDouble
|
||||
DtInv.Rows(Index)("CantidadSurtidaPantalla") = gvr.FCTextBox("TbCantidadF").Text.ToDecimal
|
||||
|
||||
If CBool(gvr.DataKey("AplicaSeccion")) AndAlso gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero <= 0 Then
|
||||
ValidaSeccion = True
|
||||
@@ -2511,9 +2511,9 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
If gvr.FCTextBox("TbCantidadF").Text.ToDouble = 1 Then PU = PU.RoundAD
|
||||
For Each Dr As DataRow In DtDetalle.Rows
|
||||
SumaTotal += PU + CostoIndirecto
|
||||
If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso ContDt + 1 = DtDetalle.Rows.Count AndAlso Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) <> SumaTotal Then
|
||||
If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso ContDt + 1 = DtDetalle.Rows.Count AndAlso (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL <> SumaTotal Then
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
PU = Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) - (SumaTotal - (PU))
|
||||
PU = (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL - (SumaTotal - (PU))
|
||||
End If
|
||||
End If
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaTraspaso, 1, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), Serie:=Dr("Serie").ToString, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario, FechaCaducidad:=If(CBool(gvr.DataKey("AplicaCaducidad")), gvr.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha), Lote:=If(CBool(gvr.DataKey("AplicaLote")), gvr.FCTextBox("TxtLote").Text, ""), CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
|
||||
@@ -2528,9 +2528,9 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
If gvr.FCTextBox("TbCantidadF").Text.ToDouble = 1 Then PU = PU.RoundAD
|
||||
For Each Dr As DataRow In DtDetalleLote.Rows
|
||||
SumaTotal += Dr("Cantidad").ToString.ToDecimal * (PU + CostoIndirecto)
|
||||
If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso ContDt + 1 = DtDetalleLote.Rows.Count AndAlso Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) <> SumaTotal Then
|
||||
If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso ContDt + 1 = DtDetalleLote.Rows.Count AndAlso (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL <> SumaTotal Then
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
PU = (Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) - (SumaTotal - (Dr("Cantidad").ToString.ToDecimal * (PU)))) / Dr("Cantidad").ToString.ToDecimal
|
||||
PU = ((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL - (SumaTotal - (Dr("Cantidad").ToString.ToDecimal * (PU)))) / Dr("Cantidad").ToString.ToDecimal
|
||||
End If
|
||||
End If
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaTraspaso, Dr("Cantidad").ToString.ToDouble, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario, CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
|
||||
@@ -2545,10 +2545,10 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
If gvr.FCTextBox("TbCantidadF").Text.ToDouble = 1 Then PU = PU.RoundAD
|
||||
|
||||
SumaTotal += gvr.FCTextBox("TbCantidadF").Text.ToDecimal * (PU + CostoIndirecto) ' considerar el costo indirecto para el ajuste
|
||||
If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) <> Math.Round(SumaTotal, 2) Then
|
||||
If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL <> SumaTotal.RoundSQL Then
|
||||
Dim tTotal As Decimal = gvr.FCTextBox("TbCantidadF").Text.ToDecimal * (PU)
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
PU = (Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) - (SumaTotal - tTotal)) / gvr.FCTextBox("TbCantidadF").Text.ToDecimal
|
||||
PU = ((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL - (SumaTotal - tTotal)) / gvr.FCTextBox("TbCantidadF").Text.ToDecimal
|
||||
End If
|
||||
End If
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaTraspaso, gvr.FCTextBox("TbCantidadF").Text.ToDouble, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario, FechaCaducidad:=If(CBool(gvr.DataKey("AplicaCaducidad")), gvr.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha), Lote:=If(CBool(gvr.DataKey("AplicaLote")), gvr.FCTextBox("TxtLote").Text, ""), CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
|
||||
@@ -2612,9 +2612,9 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
PU = PU.RoundAD
|
||||
For Each Dr As DataRow In DtDetalle.Rows
|
||||
SumaTotal += PU.RoundAD + CostoIndirecto ' se redondea a dos decimales. por la unidad es uno
|
||||
If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso ContDt + 1 = DtDetalle.Rows.Count AndAlso Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) <> SumaTotal Then
|
||||
If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso ContDt + 1 = DtDetalle.Rows.Count AndAlso (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL <> SumaTotal Then
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
PU = Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) - (SumaTotal - (PU))
|
||||
PU = (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL - (SumaTotal - (PU))
|
||||
End If
|
||||
End If
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), Serie:=Dr("Serie").ToString, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario, FechaCaducidad:=If(CBool(gvr.DataKey("AplicaCaducidad")), gvr.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha), Lote:=If(CBool(gvr.DataKey("AplicaLote")), gvr.FCTextBox("TxtLote").Text, ""), CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
|
||||
@@ -2629,9 +2629,9 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
If gvr.FCTextBox("TbCantidadF").Text.ToDouble = 1 Then PU = PU.RoundAD
|
||||
For Each Dr As DataRow In DtDetalleLote.Rows
|
||||
SumaTotal += Dr("Cantidad").ToString.ToDecimal * (PU + CostoIndirecto)
|
||||
If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso ContDt + 1 = DtDetalleLote.Rows.Count AndAlso Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) <> SumaTotal Then
|
||||
If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso ContDt + 1 = DtDetalleLote.Rows.Count AndAlso (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL <> SumaTotal Then
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
PU = (Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) - (SumaTotal - (Dr("Cantidad").ToString.ToDecimal * (PU)))) / Dr("Cantidad").ToString.ToDecimal
|
||||
PU = ((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL - (SumaTotal - (Dr("Cantidad").ToString.ToDecimal * (PU)))) / Dr("Cantidad").ToString.ToDecimal
|
||||
End If
|
||||
End If
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario, CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
|
||||
@@ -2645,10 +2645,10 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
' por redondeo
|
||||
If gvr.FCTextBox("TbCantidadF").Text.ToDouble = 1 Then PU = PU.RoundAD
|
||||
SumaTotal += gvr.FCTextBox("TbCantidadF").Text.ToDecimal * (PU + CostoIndirecto) ' considerar el costo indirecto para el ajuste
|
||||
If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) <> Math.Round(SumaTotal, 2) Then
|
||||
If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL <> SumaTotal.RoundSQL Then
|
||||
Dim tTotal As Decimal = gvr.FCTextBox("TbCantidadF").Text.ToDecimal * (PU)
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
PU = (Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) - (SumaTotal - tTotal)) / gvr.FCTextBox("TbCantidadF").Text.ToDecimal
|
||||
PU = ((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL - (SumaTotal - tTotal)) / gvr.FCTextBox("TbCantidadF").Text.ToDecimal
|
||||
End If
|
||||
End If
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, gvr.FCTextBox("TbCantidadF").Text.ToDouble, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario, FechaCaducidad:=If(CBool(gvr.DataKey("AplicaCaducidad")), gvr.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha), Lote:=If(CBool(gvr.DataKey("AplicaLote")), gvr.FCTextBox("TxtLote").Text, ""), CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
|
||||
@@ -2682,8 +2682,8 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
End If
|
||||
If (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL <> tTotalInsertado.RoundSQL Then
|
||||
ErrorMovInv = True
|
||||
Alert("La Entrada no coincide con el valor del documento." & Math.Round(TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1), 2) & " -" & tTotalInsertado, TipoMensaje.MsgError)
|
||||
GuardaLog("La Entrada no coincide con el valor del documento." & Math.Round(TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1), 2) & " -" & tTotalInsertado)
|
||||
Alert("La Entrada no coincide con el valor del documento.." & (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)) & " -" & tTotalInsertado, TipoMensaje.MsgError)
|
||||
GuardaLog("La Entrada no coincide con el valor del documento.." & (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)) & " -" & tTotalInsertado)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -2900,9 +2900,9 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
'DEVENGAR AC
|
||||
If Not ErrorMovInv AndAlso UsuarioActual.Empresa.UsaAC AndAlso EsContabilizable Then
|
||||
Dim IDPoliza As Integer
|
||||
Dim TotalDetalle As Double = 0.0
|
||||
Dim TotalDetalle As Decimal = 0
|
||||
Dim TotalPorDevengar = 0.0
|
||||
TotalPorDevengar += GvInv.Rows.Cast(Of GridViewRow)().Sum(Function(Gvr) Math.Round(Gvr.DataKey("PU").ToString.ToDouble, 4) * Math.Round(Gvr.DataKey("CantidadF").ToString.ToDouble, 4))
|
||||
TotalPorDevengar += GvInv.Rows.Cast(Of GridViewRow)().Sum(Function(Gvr) Math.Round(Gvr.DataKey("PU").ToString.ToDecimal, 4) * Math.Round(Gvr.DataKey("CantidadF").ToString.ToDecimal, 4))
|
||||
TotalPorDevengar = Math.Round(TotalPorDevengar, 4)
|
||||
If ObjContaAC Is Nothing Then
|
||||
ObjContaAC = New ClsContPAQi(UsuarioActual.Empresa)
|
||||
@@ -2915,10 +2915,10 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
Dim drRegistroMatriz As DataRow
|
||||
Dim CuentaCargo As Integer
|
||||
Dim CuentaAbono As Integer
|
||||
Dim Importe = 0.0
|
||||
Dim Importe As Decimal = 0
|
||||
|
||||
For Each gvr As GridViewRow In GvInv.Rows
|
||||
Importe = gvr.FCTextBox("TbCantidadF").Text.ToDouble * gvr.DataKey("PU").ToString.ToDouble
|
||||
Importe = gvr.FCTextBox("TbCantidadF").Text.ToDecimal * gvr.DataKey("PU").ToString.ToDecimal
|
||||
TotalDetalle += Importe
|
||||
|
||||
If Importe > 0 Then
|
||||
@@ -3024,7 +3024,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
|
||||
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble()
|
||||
Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
|
||||
Dim PU As Decimal = RowUsado("PU").ToString().ToDecimal()
|
||||
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
||||
|
||||
@@ -3109,8 +3109,8 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
End If
|
||||
If (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL <> tTotalInsertado.RoundSQL Then
|
||||
ErrorMovInv = True
|
||||
Alert("La Entrada no coincide con el valor del documento." & Math.Round(TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1), 2) & " -" & tTotalInsertado.RoundSQL.ToString, TipoMensaje.MsgError)
|
||||
GuardaLog("La Entrada no coincide con el valor del documento." & Math.Round(TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1), 2) & " -" & tTotalInsertado.RoundSQL.ToString)
|
||||
Alert("La Entrada no coincide con el valor del documento." & (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL & " -" & tTotalInsertado.RoundSQL.ToString, TipoMensaje.MsgError)
|
||||
GuardaLog("La Entrada no coincide con el valor del documento." & (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL & " -" & tTotalInsertado.RoundSQL.ToString)
|
||||
End If
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
@@ -3239,12 +3239,12 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
For Each Dr As DataRow In DtCostos.Rows
|
||||
TotalCostoDetalle = (Dr("Total").ToString.ToDecimal)
|
||||
TotalCostoExtranjero = Dr("TotalExtranjero").ToString.ToDecimal
|
||||
TotalCostoAcumulado += Math.Round(TotalCostoDetalle, 2)
|
||||
TotalCostoAcumulado += TotalCostoDetalle.RoundSQL
|
||||
|
||||
'si es el último movimiento verifica los importes que sean igual
|
||||
If cont = DtCostos.Rows.Count AndAlso (Math.Round(TotalCosto, 2) <> Math.Round(TotalCostoAcumulado, 2)) Then
|
||||
TotalCostoDetalle = TotalCostoDetalle + (Math.Round(TotalCosto, 3) - Math.Round(TotalCostoAcumulado, 3))
|
||||
TotalCostoExtranjero = TotalCostoExtranjero + (Math.Round(TotalCosto, 3) - Math.Round(TotalCostoAcumulado, 3))
|
||||
If cont = DtCostos.Rows.Count AndAlso (TotalCosto.RoundSQL <> TotalCostoAcumulado.RoundSQL) Then
|
||||
TotalCostoDetalle = TotalCostoDetalle + (TotalCosto.RoundSQL(3) - TotalCostoAcumulado.RoundSQL(3))
|
||||
TotalCostoExtranjero = TotalCostoExtranjero + (TotalCosto.RoundSQL(3) - TotalCostoAcumulado.RoundSQL(3))
|
||||
End If
|
||||
|
||||
If CveMoneda <> 1 AndAlso UsaComplementariaFleteImportaciones Then
|
||||
@@ -3365,7 +3365,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
Dim CveCuentaClasificacion As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostosSIG", $"CveClasificacion = {CveClasificacionDifCostoNC}").ToEntero
|
||||
|
||||
TotalNC = TotalNC.RoundSQL
|
||||
Dim DifCostoNC = Math.Round(TotalCosto - TotalNC, 2)
|
||||
Dim DifCostoNC As Decimal = (TotalCosto - TotalNC).RoundSQL
|
||||
|
||||
'VARIABLES
|
||||
Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero
|
||||
@@ -4590,29 +4590,29 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
Dim dr1 As DataRow = DtInv.Rows(Index)
|
||||
Dim dr As DataRow = DtInv.NewRow
|
||||
dr.ItemArray = dr1.ItemArray
|
||||
dr1("CantidadC") = (dr1("CantidadC").ToString.ToDouble - Cantidad.ToDouble)
|
||||
Dim CantidadFOriginal As Double = dr1("CantidadF").ToString.ToDouble
|
||||
dr1("CantidadF") = (dr1("CantidadF").ToString.ToDouble - Cantidad.ToDouble)
|
||||
Dim CantidadSOriginal As Double = dr1("CantidadS").ToString.ToDouble
|
||||
dr1("CantidadS") = (CantidadSOriginal * dr1("CantidadF").ToString.ToDouble) / CantidadFOriginal
|
||||
Dim CantidadSeleccionadaOriginal As Double = dr1("CantidadSeleccionada").ToString.ToDouble
|
||||
dr1("CantidadSeleccionada") = If(CantidadSeleccionadaOriginal > dr1("CantidadF").ToString.ToDouble, dr1("CantidadF").ToString.ToDouble, CantidadSeleccionadaOriginal)
|
||||
CantidadSeleccionadaOriginal = CantidadSeleccionadaOriginal - dr1("CantidadF").ToString.ToDouble
|
||||
dr1("CantidadC") = (dr1("CantidadC").ToString.ToDecimal - Cantidad.ToDecimal)
|
||||
Dim CantidadFOriginal As Decimal = dr1("CantidadF").ToString.ToDecimal
|
||||
dr1("CantidadF") = (dr1("CantidadF").ToString.ToDecimal - Cantidad.ToDecimal)
|
||||
Dim CantidadSOriginal As Decimal = dr1("CantidadS").ToString.ToDecimal
|
||||
dr1("CantidadS") = (CantidadSOriginal * dr1("CantidadF").ToString.ToDecimal) / CantidadFOriginal
|
||||
Dim CantidadSeleccionadaOriginal As Decimal = dr1("CantidadSeleccionada").ToString.ToDecimal
|
||||
dr1("CantidadSeleccionada") = If(CantidadSeleccionadaOriginal > dr1("CantidadF").ToString.ToDecimal, dr1("CantidadF").ToString.ToDecimal, CantidadSeleccionadaOriginal)
|
||||
CantidadSeleccionadaOriginal = CantidadSeleccionadaOriginal - dr1("CantidadF").ToString.ToDecimal
|
||||
|
||||
Dim CostoIndirectoOriginal As Double = dr1("CostoIndirecto").ToString.ToDouble
|
||||
dr1("CostoIndirecto") = (CostoIndirectoOriginal * dr1("CantidadF").ToString.ToDouble) / CantidadFOriginal
|
||||
Dim CostoIndirectoExtranjeroOriginal As Double = dr1("CostoIndirectoExtranjero").ToString.ToDouble
|
||||
dr1("CostoIndirectoExtranjero") = (CostoIndirectoExtranjeroOriginal * dr1("CantidadF").ToString.ToDouble) / CantidadFOriginal
|
||||
Dim CostoIndirectoOriginal As Decimal = dr1("CostoIndirecto").ToString.ToDecimal
|
||||
dr1("CostoIndirecto") = (CostoIndirectoOriginal * dr1("CantidadF").ToString.ToDecimal) / CantidadFOriginal
|
||||
Dim CostoIndirectoExtranjeroOriginal As Decimal = dr1("CostoIndirectoExtranjero").ToString.ToDecimal
|
||||
dr1("CostoIndirectoExtranjero") = (CostoIndirectoExtranjeroOriginal * dr1("CantidadF").ToString.ToDecimal) / CantidadFOriginal
|
||||
|
||||
DtInv.AcceptChanges()
|
||||
|
||||
dr("CantidadC") = Cantidad.ToDouble
|
||||
dr("CantidadF") = Cantidad.ToDouble
|
||||
dr("CantidadS") = (CantidadSOriginal * dr("CantidadF").ToString.ToDouble) / CantidadFOriginal
|
||||
dr("CantidadC") = Cantidad.ToDecimal
|
||||
dr("CantidadF") = Cantidad.ToDecimal
|
||||
dr("CantidadS") = (CantidadSOriginal * dr("CantidadF").ToString.ToDecimal) / CantidadFOriginal
|
||||
dr("CantidadSeleccionada") = If(CantidadSeleccionadaOriginal > 0, CantidadSeleccionadaOriginal, 0)
|
||||
dr("Seleccionado") = If(CantidadSeleccionadaOriginal > 0, True, False)
|
||||
dr("CostoIndirecto") = (CostoIndirectoOriginal * dr("CantidadF").ToString.ToDouble) / CantidadFOriginal
|
||||
dr("CostoIndirectoExtranjero") = (CostoIndirectoExtranjeroOriginal * dr("CantidadF").ToString.ToDouble) / CantidadFOriginal
|
||||
dr("CostoIndirecto") = (CostoIndirectoOriginal * dr("CantidadF").ToString.ToDecimal) / CantidadFOriginal
|
||||
dr("CostoIndirectoExtranjero") = (CostoIndirectoExtranjeroOriginal * dr("CantidadF").ToString.ToDecimal) / CantidadFOriginal
|
||||
DtInv.Rows.InsertAt(dr, Index)
|
||||
DtInv.AcceptChanges()
|
||||
|
||||
|
||||
@@ -2738,6 +2738,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
DdlPSAjuste.ddlWS.Attributes.Add("data-cveclasificacion", "-1")
|
||||
DdlPSAjuste.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
|
||||
DdlPSAjuste.ddlWS.Attributes.Add("data-Estatus", "1")
|
||||
DdlPSAjuste.ddlWS.Attributes.Add("data-aplicaparaventa", "1")
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlPSAjuste_selectedindexchange(sender As Object, e As EventArgs)
|
||||
|
||||
@@ -90,10 +90,16 @@
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExportaSobrantes" runat="server"><i class="fa fa-ad-excel"></i> Exporta Sobrantes</asp:LinkButton>
|
||||
</li>--%>
|
||||
<asp:UpdatePanel runat="server">
|
||||
<asp:UpdatePanel runat="server" id="UPAcciones" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="btnFin" runat="server" Text="Finalizar" data-toggle="confirmation" data-popout="true" data-original-title="Finalizar el inventario" data-btn-ok-label="si" />
|
||||
<asp:LinkButton ID="btnFin" runat="server" Text="Finalizar Inventario" data-toggle="confirmation" data-popout="true" data-original-title="Finalizar el inventario" data-btn-ok-label="si" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkCrear" runat="server"><i class=""></i> Crear a partir de</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkGuardar" runat="server" Visible="false" > <i class="fa fa-floppy-o" style="font-weight:bold;"></i> Guardar Nuevo Inventario Físico</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
@@ -177,13 +183,17 @@
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<br />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<label style="font-size: 16px"><b>Productos que Faltan</b></label>
|
||||
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvF.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvF.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
<div class="row">
|
||||
<div class="col-md-4" align="left" id="divRegistradosFaltan" runat="server">
|
||||
<asp:Label runat="server">Número de registros: <b><asp:Literal ID="LtlTotalRegistrosFaltan" runat="server"></asp:Literal></b></asp:Label>
|
||||
</div>
|
||||
<div class="col-md-8" align="right" id="DivBuscadorFaltan" runat="server">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvF.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvF.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -191,8 +201,16 @@
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvF" data-sort="true" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False"
|
||||
CssClass="table table-striped table-hover Widthall ScrollAD" Style="text-align: center;"
|
||||
GridLines="None">
|
||||
GridLines="None" DataKeyNames="CvePS">
|
||||
<Columns>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>
|
||||
<asp:CheckBox ID="ChkAllFaltante" runat="server"/>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="ChkPSFaltante" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="#">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblC" runat="server" Font-Size="6pt"></asp:Label>
|
||||
@@ -213,21 +231,34 @@
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<br />
|
||||
<br />
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<label style="font-size: 16px"><b>Productos que Sobran</b></label>
|
||||
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
|
||||
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvS.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvS.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
<div class="row">
|
||||
<div class="col-md-4" align="left" id="divRegistradosSobran" runat="server">
|
||||
<asp:Label runat="server">Número de registros: <b><asp:Literal ID="LtlTotalRegistrosSobran" runat="server"></asp:Literal></b></asp:Label>
|
||||
</div>
|
||||
<div class="col-md-8" align="right" id="DivBuscadorSobran" runat="server">
|
||||
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvS.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvS.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpdateGvS" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvS" data-sort="true" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False"
|
||||
CssClass="table table-striped table-hover Widthall ScrollAD" Style="text-align: center;" GridLines="None">
|
||||
CssClass="table table-striped table-hover Widthall ScrollAD" Style="text-align: center;" GridLines="None" DataKeyNames="CvePS">
|
||||
<Columns>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>
|
||||
<asp:CheckBox ID="ChkAllSobrante" runat="server"/>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="ChkPSSobrante" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="#">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblC" runat="server" Font-Size="6pt"></asp:Label>
|
||||
@@ -250,13 +281,50 @@
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<br />
|
||||
|
||||
<div id="ModalGuardar" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">Guardar Nuevo Inventario Físico</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" ID="UpFecha" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtTitulo" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTitulos" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtTitulo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Titulo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtTitulo.ClientID.ToString()%>">Titulo:</label>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnCrear" runat="server" ClientIDMode="Static" Text="Crear" CssClass="btn btn-primary" ValidationGroup="Actualiza" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
|
||||
<script src="/Scripts/DataTables.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function SeleccionarTodosFaltante(chk) {
|
||||
$("#C_GvF input:checkbox").attr("checked", chk.checked);
|
||||
}
|
||||
function SeleccionarTodosSobrante(chk) {
|
||||
$("#C_GvS input:checkbox").attr("checked", chk.checked);
|
||||
}
|
||||
function pageLoad(sender, e) {
|
||||
$(document).ready(function () {
|
||||
$('a[class="ajax__tab_tab"]').click(function () {
|
||||
|
||||
@@ -148,8 +148,8 @@ Partial Class Inventarios_RepAnomalias
|
||||
End If
|
||||
Inventario.Dispose()
|
||||
|
||||
If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then GvS.Columns(7).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
|
||||
If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then GvF.Columns(7).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
|
||||
If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then GvS.Columns(8).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
|
||||
If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then GvF.Columns(8).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
|
||||
|
||||
|
||||
GvS.DataSource = dt.FiltraParametros("Diferencia < 0")
|
||||
@@ -167,15 +167,19 @@ Partial Class Inventarios_RepAnomalias
|
||||
GvF.UseAccessibleHeader = True
|
||||
GvF.HeaderRow.TableSection = TableRowSection.TableHeader
|
||||
Script = "OrdenarGVF();"
|
||||
divRegistradosFaltan.Visible = True
|
||||
LtlTotalRegistrosFaltan.Text = GvF.Rows.Count.ToString
|
||||
End If
|
||||
|
||||
If (GvS.Rows.Count > 0) Then
|
||||
GvS.UseAccessibleHeader = True
|
||||
GvS.HeaderRow.TableSection = TableRowSection.TableHeader
|
||||
Script += "OrdenarGVS();"
|
||||
divRegistradosSobran.Visible = True
|
||||
LtlTotalRegistrosSobran.Text = GvS.Rows.Count.ToString
|
||||
End If
|
||||
|
||||
|
||||
PSIguales()
|
||||
RegistraScript(Script)
|
||||
|
||||
UPAnomalias.Update()
|
||||
@@ -207,17 +211,13 @@ Partial Class Inventarios_RepAnomalias
|
||||
|
||||
Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvF.RowDataBound, GvS.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If e.Row.DBCampo("Costo") = "-1" Then
|
||||
e.Row.Cells(8).Text = "0"
|
||||
End If
|
||||
|
||||
If e.Row.Cells(7).Text = MinFecha.ToString Then
|
||||
e.Row.Cells(7).Text = ""
|
||||
End If
|
||||
|
||||
e.Row.FCLabel("Lblc").Text = e.Row.RowIndex + 1
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -295,10 +295,141 @@ Partial Class Inventarios_RepAnomalias
|
||||
#End Region
|
||||
|
||||
Private Sub BanderaSerieLoteCad(Gv As GridView, resultado As DataTable)
|
||||
Gv.Columns(4).Visible = resultado.MAX("CveSeccionAlmacen").ToEntero > 0
|
||||
Gv.Columns(5).Visible = resultado.MAX("Serie") <> ""
|
||||
Gv.Columns(6).Visible = resultado.MAX("Lote") <> ""
|
||||
Gv.Columns(7).Visible = resultado.MAX("FechaCaducidad").ToDate > MinFecha
|
||||
Gv.Columns(5).Visible = resultado.MAX("CveSeccionAlmacen").ToEntero > 0
|
||||
Gv.Columns(6).Visible = resultado.MAX("Serie") <> ""
|
||||
Gv.Columns(7).Visible = resultado.MAX("Lote") <> ""
|
||||
Gv.Columns(8).Visible = resultado.MAX("FechaCaducidad").ToDate > MinFecha
|
||||
End Sub
|
||||
|
||||
Private Sub LnkCrear_Click(sender As Object, e As EventArgs) Handles LnkCrear.Click
|
||||
If GvF.Rows.Count > 0 Then
|
||||
GvF.Columns(0).Visible = True
|
||||
LnkGuardar.Visible = True
|
||||
LnkCrear.Visible = False
|
||||
GvF.HeaderRow.FCCheckBox("ChkAllFaltante").Attributes.Add("onclick", "SeleccionarTodosFaltante(this);")
|
||||
End If
|
||||
|
||||
If GvS.Rows.Count > 0 Then
|
||||
GvS.Columns(0).Visible = True
|
||||
LnkGuardar.Visible = True
|
||||
LnkCrear.Visible = False
|
||||
GvS.HeaderRow.FCCheckBox("ChkAllSobrante").Attributes.Add("onclick", "SeleccionarTodosSobrante(this);")
|
||||
End If
|
||||
UPAnomalias.Update()
|
||||
UpdateGvS.Update()
|
||||
UPAcciones.Update()
|
||||
End Sub
|
||||
Private Sub LnkGuardar_Click(sender As Object, e As EventArgs) Handles LnkGuardar.Click
|
||||
RegistraScript("$('#ModalGuardar').modal('show')")
|
||||
End Sub
|
||||
|
||||
Private Sub BtnCrear_Click(sender As Object, e As EventArgs) Handles BtnCrear.Click
|
||||
Dim ErrorClasif As Boolean = False
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
Dim CveInventarioFisicoNew As Integer
|
||||
Dim DtAlmacen, DtClasificacion, DtClasificacionExcluida, DtProveedor As DataTable
|
||||
DtAlmacen = Nothing
|
||||
DtClasificacion = Nothing
|
||||
DtClasificacionExcluida = Nothing
|
||||
DtProveedor = Nothing
|
||||
ObjInventario.IniciaTransacSQL()
|
||||
If ObjInventario.AddInventarioFisico(UsuarioActual.CveEmpresa, TxtTitulo.Text, lbObservaciones.Text, 0, CveSubProyecto) Then
|
||||
CveInventarioFisicoNew = ObjInventario.CveInventarioFisico
|
||||
|
||||
If ObjInventario.GetInventarioFisicoDetallesAlmacen(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
|
||||
DtAlmacen = ObjInventario.DtResultados
|
||||
End If
|
||||
|
||||
If ObjInventario.GetInventarioFisicoDetallesClasificacion(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
|
||||
DtClasificacion = ObjInventario.DtResultados.FiltraParametros("Incluye = 1")
|
||||
DtClasificacionExcluida = ObjInventario.DtResultados.FiltraParametros("Incluye = 0")
|
||||
End If
|
||||
|
||||
If ObjInventario.GetInventarioFisicoDetallesProveedores(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
|
||||
DtProveedor = ObjInventario.DtResultados.FiltraParametros("Incluye = 1")
|
||||
End If
|
||||
|
||||
For Each Gvr As DataRow In DtAlmacen.Rows
|
||||
If Not ObjInventario.AddInventarioFisicoAlmacenes(CveInventarioFisicoNew, Gvr("CveAlmacen").ToString.ToEntero) Then
|
||||
ErrorClasif = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
If ErrorClasif = False Then
|
||||
For Each Gvr As DataRow In DtClasificacion.Rows
|
||||
If Not ObjInventario.AddInventarioFisicoClasificaciones(CveInventarioFisicoNew, Gvr("CveClasificacion").ToString.ToEntero, UsuarioActual.CveUsuario, True) Then
|
||||
ErrorClasif = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
For Each Gvr As DataRow In DtClasificacionExcluida.Rows
|
||||
If Not ObjInventario.AddInventarioFisicoClasificaciones(CveInventarioFisicoNew, Gvr("CveClasificacion").ToString.ToEntero, UsuarioActual.CveUsuario, False) Then
|
||||
ErrorClasif = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If ErrorClasif = False Then
|
||||
For Each Gvr As GridViewRow In GvF.Rows
|
||||
If Gvr.FCCheckBox("ChkPSFaltante").Checked Then
|
||||
If Not ObjInventario.AddInventarioFisicoProductosServicios(CveInventarioFisicoNew, Gvr.DataKey("CvePS").ToString.ToEntero, True) Then
|
||||
ErrorClasif = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
For Each Gvr As GridViewRow In GvS.Rows
|
||||
If Gvr.FCCheckBox("ChkPSSobrante").Checked Then
|
||||
If Not ObjInventario.AddInventarioFisicoProductosServicios(CveInventarioFisicoNew, Gvr.DataKey("CvePS").ToString.ToEntero, True) Then
|
||||
ErrorClasif = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If ErrorClasif = False Then
|
||||
For Each Gvr As DataRow In DtProveedor.Rows
|
||||
If Not ObjInventario.AddInventarioFisicoProveedores(CveInventarioFisicoNew, Gvr("CveProveedor").ToString.ToEntero, True) Then
|
||||
ErrorClasif = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
End If
|
||||
If ErrorClasif = False And CveInventarioFisicoNew > 0 Then
|
||||
ObjInventario.Commit()
|
||||
Alert("Agregado Correctamente.", TipoMensaje.MsgInformacion)
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalGuardar"))
|
||||
GvF.Columns(0).Visible = False
|
||||
GvS.Columns(0).Visible = False
|
||||
LnkGuardar.Visible = False
|
||||
LnkCrear.Visible = True
|
||||
CargaDatos(CveInventarioFisico)
|
||||
Else
|
||||
ObjInventario.RollBack()
|
||||
End If
|
||||
ObjInventario.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub PSIguales()
|
||||
Dim contadorF As Integer = 0
|
||||
Dim contadorS As Integer = 0
|
||||
For Each dtF As GridViewRow In GvF.Rows
|
||||
contadorS = 0
|
||||
For Each dtS As GridViewRow In GvS.Rows
|
||||
If dtS.DataKey("CvePS") = dtF.DataKey("CvePS") Then
|
||||
GvS.Rows(contadorS).BackColor = Drawing.Color.FromArgb(202, 52, 52)
|
||||
GvF.Rows(contadorF).BackColor = Drawing.Color.FromArgb(202, 52, 52)
|
||||
End If
|
||||
contadorS += 1
|
||||
Next
|
||||
contadorF += 1
|
||||
Next
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -5,7 +5,6 @@ Imports System.Data
|
||||
Imports System.IO
|
||||
Imports Extensiones
|
||||
Imports GemBox.Spreadsheet
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Inventarios_TraspasoAlmacen
|
||||
Inherits ClsPaginas
|
||||
@@ -981,7 +980,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
For Each RowVirtual As DataRow In dtvirtual.Rows
|
||||
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Double = RowVirtual("Cantidad").ToString().ToDouble()
|
||||
Dim CantidadUsado As Decimal = RowVirtual("Cantidad").ToString.ToDecimal
|
||||
Dim PU As Decimal = RowVirtual("Cargo").ToString().ToDecimal()
|
||||
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
|
||||
|
||||
@@ -2078,7 +2077,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then
|
||||
dtvirtual = ObjInventario.DtResultados
|
||||
If dtvirtual.Rows.Count > 0 Then
|
||||
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 2, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/S2")
|
||||
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 36, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveMovimientoRelacionado:=CveMovimientoEntrada, Modulo:="TA/S2")
|
||||
FolioVirtualEntrada = ObjInventario.Folio
|
||||
For Each RowVirtual As DataRow In dtvirtual.Rows
|
||||
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
|
||||
|
||||
@@ -6463,7 +6463,7 @@ Partial Class PV
|
||||
Else
|
||||
'TxtPUFactura.Enabled = True
|
||||
'TxtPUFactura.Text = ""
|
||||
DdlPSAjuste.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
|
||||
DdlPSAjuste.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, AplicaParaVenta:=1)
|
||||
End If
|
||||
DdlPSAjuste.DataBind()
|
||||
' DdlPSAjuste.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
@@ -231,9 +231,9 @@
|
||||
<div id="dvCa" style="width: 100%; top: 40px">
|
||||
<table id="dTable" class="correcto table Widthall Titulos">
|
||||
<tr>
|
||||
<td id="dvInv" runat="server" class="dataTables_scrollHead" style="text-align: center!important; width: 42%; font-size: 14px;"><b>Venta</b></td>
|
||||
<td id="dvVen" runat="server" class="dataTables_scrollHead" style="text-align: center!important; font-size: 14px; border-right-color: white!important; border-left-color: white!important; width: 25%; border-style: solid;"><b>Costo</b></td>
|
||||
<td id="dvUt" runat="server" class="dataTables_scrollHead" style="text-align: center!important; width: 42%; font-size: 14px;"><b>Utilidad/Pérdida</b></td>
|
||||
<td id="dvInv" runat="server" class="dataTables_scrollHead" style="text-align: center!important; width: 37%; font-size: 14px;"><b>Venta</b></td>
|
||||
<td id="dvVen" runat="server" class="dataTables_scrollHead" style="text-align: center!important; font-size: 14px; border-right-color: white!important; border-left-color: white!important; width: 22%; border-style: solid;"><b>Costo</b></td>
|
||||
<td id="dvUt" runat="server" class="dataTables_scrollHead" style="text-align: center!important; width: 46%; font-size: 14px;"><b>Utilidad/Pérdida</b></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -262,6 +262,16 @@
|
||||
</asp:TemplateField>
|
||||
<asp:HyperLinkField Text="Ir" DataNavigateUrlFields="CveMovimiento" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="2.5%" DataNavigateUrlFormatString="/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}" />
|
||||
|
||||
<asp:TemplateField HeaderText="$ Neto" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HlNeto" runat="server" Text='<%# If(Eval("Neto").ToString() = "0", "-", Eval("Neto", "{0:#,##0.00}")) %>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="% Neto" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HlPorNeto" runat="server" Text='<%# If(Eval("PorNeto").ToString() = "0", "-", Eval("PorNeto", "{0:#,##0.00}%")) %>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Utilidad" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
@@ -269,7 +279,7 @@
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="%" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Right">
|
||||
<asp:TemplateField HeaderText="%" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HlPorGanancia" runat="server" Text='<%# If(Eval("PorUtilidad").ToString() = "0", "-", Eval("PorUtilidad", "{0:#,##0.00}%")) %>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
@@ -281,7 +291,7 @@
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="%" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Right">
|
||||
<asp:TemplateField HeaderText="%" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HlPorPerdida" runat="server" Text='<%# If(Eval("PorPerdida").ToString() = "0", "-", Eval("PorPerdida", "{0:#,##0.00}%")) %>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
|
||||
@@ -2488,9 +2488,12 @@ Partial Class Ventas
|
||||
ObjInv.Dispose()
|
||||
|
||||
End If
|
||||
|
||||
'regenrea el tipo de cambio
|
||||
CargaNuevaFactura(Nothing)
|
||||
|
||||
CambiaMoneda()
|
||||
|
||||
|
||||
|
||||
'NOTA DE CREDITO
|
||||
If NuevaFactura = 2 Then
|
||||
|
||||
Reference in New Issue
Block a user