GDias 2024-12-22 Traslados con un articulo y mas de los solicitados, Pop up buscar venta por Vendedor, promosiones ocultar ultimo costo y % de ganancia
This commit is contained in:
@@ -4565,7 +4565,7 @@ Public Class ClsInventarios
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function AddTrasladoSolicitudDetalle(CveTrasladoSolicitud As Integer, Cantidad As Integer, CveUM As Integer, CvePS As Integer, Precio As Decimal, Observaciones As String,
|
||||
Public Function AddTrasladoSolicitudDetalle(CveTrasladoSolicitud As Integer, Cantidad As Decimal, CveUM As Integer, CvePS As Integer, Precio As Decimal, Observaciones As String,
|
||||
CveContratoDetalle As Integer, Optional Serie As String = "-1", Optional Lote As String = "-1", Optional FechaCaducidad As Date = MinFecha) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
Dim CveTraspasoSolicitud As Integer = 0
|
||||
@@ -4573,7 +4573,7 @@ Public Class ClsInventarios
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveTrasladoSolicitud", SqlDbType.Int).Value = CveTrasladoSolicitud
|
||||
.Add("@Cantidad", SqlDbType.Int).Value = Cantidad
|
||||
.Add("@Cantidad", SqlDbType.Money).Value = Cantidad
|
||||
.Add("@CveUM", SqlDbType.Int).Value = CveUM
|
||||
.Add("@CvePS", SqlDbType.Int).Value = CvePS
|
||||
.Add("@Precio", SqlDbType.Float).Value = Precio
|
||||
@@ -4597,6 +4597,41 @@ Public Class ClsInventarios
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
Public Function UpdateTrasladoSolicitudDetalle(CveTrasladoSolicitudDetalle As Integer, CveEmpresa As Integer, CveTrasladoSolicitud As Integer, Cantidad As Decimal, CveUM As Integer, CvePS As Integer, Precio As Decimal, Observaciones As String,
|
||||
CveContratoDetalle As Integer, Optional Serie As String = "-1", Optional Lote As String = "-1", Optional FechaCaducidad As Date = MinFecha) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
Dim CveTraspasoSolicitud As Integer = 0
|
||||
DataAdapter("PA_Inv_TraspasoSolicitudDetalleUpdate")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveTrasladoSolicitudDetalle", SqlDbType.Int).Value = CveTrasladoSolicitudDetalle
|
||||
.Add("@CveTrasladoSolicitud", SqlDbType.Int).Value = CveTrasladoSolicitud
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@Cantidad", SqlDbType.Money).Value = Cantidad
|
||||
.Add("@CveUM", SqlDbType.Int).Value = CveUM
|
||||
.Add("@CvePS", SqlDbType.Int).Value = CvePS
|
||||
.Add("@Precio", SqlDbType.Float).Value = Precio
|
||||
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
|
||||
.Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle
|
||||
.Add("@Serie", SqlDbType.NVarChar).Value = Serie
|
||||
.Add("@Lote", SqlDbType.NVarChar).Value = Lote
|
||||
.Add("@FechaCaducidad", SqlDbType.Date).Value = FechaCaducidad
|
||||
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch Ex1 As SqlException
|
||||
Me.OnError("Ocurrió un error al actualizar los detalles del movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al actualizar los detalles del movimiento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function AddTrasladoSolicitudGet(CveTrasladoSolicitud As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
Dim CveTraspasoSolicitud As Integer = 0
|
||||
|
||||
@@ -293,7 +293,7 @@ Public Class ClsVentas
|
||||
Public Function GetVentas(CveEmpresa As Integer, TipoDocto As String, Serie As String, Folio As Integer, Codigo As String, CveCliente As Integer,
|
||||
CveSubProyecto As Integer, CveEstatus As Integer, CveUsuario As Integer, FechaI As String, FechaF As String, FolioFiscal As String, Optional CveClienteSucursal As Integer = -1, Optional CvePS As Integer = -1, Optional PedidoContrato As String = "-1",
|
||||
Optional OrdenCompra As String = "-1", Optional CveUsuarioConsulta As Integer = -1, Optional ClienteRFC As String = "-1",
|
||||
Optional CveEmpresaCRM As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, Optional TopSelect As Integer = 1000) As Boolean
|
||||
Optional CveEmpresaCRM As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, Optional TopSelect As Integer = 1000, Optional CveVendedor As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Vta_VentasGetBuscar")
|
||||
@@ -319,6 +319,7 @@ Public Class ClsVentas
|
||||
.Add("@CveEmpresaCRM", SqlDbType.Int).Value = CveEmpresaCRM
|
||||
.Add("@CveAcercamientoCRM", SqlDbType.Int).Value = CveAcercamientoCRM
|
||||
.Add("@TopSelect", SqlDbType.Int).Value = TopSelect
|
||||
.Add("@CveVendedorFiltro", SqlDbType.Int).Value = CveVendedor
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -299,7 +299,7 @@
|
||||
<div class="col-md-12">
|
||||
|
||||
<asp:GridView ID="GvSolicitudes" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="CvePS, CodigoPS, CveUM, Cantidad, Precio, Observaciones, CveContratoDetalle,UnidadMedida,Serie, Lote, FechaCaducidad" EmptyDataText="No se encontraron Productos registrados"
|
||||
DataKeyNames="CveTrasladoSolicitudDetalle,CvePS, CodigoPS, CveUM, Cantidad, Precio, Observaciones, CveContratoDetalle,UnidadMedida,Serie, Lote, FechaCaducidad" EmptyDataText="No se encontraron Productos registrados"
|
||||
ToolTip="Listado de Productos" CssClass="table table-striped table-advance table-hover mysmallbtn ScrollAD Widthall" GridLines="None"
|
||||
OnRowDataBound="GvSolicitudes_RowDataBound" >
|
||||
<Columns>
|
||||
|
||||
@@ -503,8 +503,9 @@ Partial Class Inventarios_TrasladoSolicitud
|
||||
TextoExistencia.Append("Los siguiente productos no tienen existencia:<br/>")
|
||||
|
||||
For Each gvr As GridViewRow In GvSolicitudes.Rows
|
||||
Dim Existencia As Decimal = 0
|
||||
|
||||
|
||||
Dim Existencia As Decimal = 0
|
||||
Dim MsgAdicional As String = ""
|
||||
|
||||
If ObjInventario.GetExistenciasProducto(gvr.DataKey("CvePS").ToEntero, gvr.DataKey("CveUM").ToEntero, UsuarioActual.CveEmpresa, CveAlmacenOrigen, FechaMovto:=NowADS.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=-1, Serie:="-1", Lote:="-1", Caducidad:=MinFecha) Then
|
||||
@@ -606,15 +607,32 @@ Partial Class Inventarios_TrasladoSolicitud
|
||||
|
||||
For Each gvr As GridViewRow In GvSolicitudes.Rows
|
||||
|
||||
Dim Cantidad As Decimal = gvr.FCTextBox("TxtCantidad").Text.ToDecimal
|
||||
If gvr.FCCheckBox("Chk").Checked AndAlso Cantidad > 0 Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Cantidad, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, 0, CveAF:=-1, CveSeccionAlmacen:=-1, Serie:="-1", Lote:="-1", FechaCaducidad:=MinFecha, Observaciones:="") Then
|
||||
Dim CveTrasladoSolicitudDetalle As Integer = gvr.DataKey("CveTrasladoSolicitudDetalle").ToEntero
|
||||
Dim CantidadOriginal As Decimal = gvr.DataKey("Cantidad").ToDecimal
|
||||
Dim CantidadAceptada As Decimal = gvr.FCTextBox("TxtCantidad").Text.ToDecimal
|
||||
|
||||
|
||||
If gvr.FCCheckBox("Chk").Checked AndAlso CantidadAceptada > 0 Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadAceptada, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, 0, CveAF:=-1, CveSeccionAlmacen:=-1, Serie:="-1", Lote:="-1", FechaCaducidad:=MinFecha, Observaciones:="") Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
||||
Exit For
|
||||
End If
|
||||
|
||||
If CantidadOriginal <> CantidadAceptada Then
|
||||
If Not ObjInventario.UpdateTrasladoSolicitudDetalle(CveTrasladoSolicitudDetalle, UsuarioActual.CveEmpresa, -1, CantidadAceptada, -1, -1, -1, "-1", -1, "-1", "-1", MinFecha) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al actuazliar el detalle de traslado"
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
Cont += 1
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Next
|
||||
|
||||
'For Each Dr As DataRow In DtMovimientos.RowsF
|
||||
|
||||
@@ -164,6 +164,18 @@
|
||||
<asp:TextBox ID="TxtOrdenCompra" runat="server" CssClass="form-control" Width="230px" Height="30px" style="padding: 0px"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
<tr align="left" runat="server" id="TRVendedores" >
|
||||
<td class="text-right"><b>Vendedor:</b></td>
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlVendedor" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" Width="228px" >
|
||||
<asp:ListItem Selected="true" Text="Todos" Value="-1" ></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
|
||||
<td class="text-right"></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="text-align: center;" colspan="4">
|
||||
|
||||
@@ -30,6 +30,9 @@ Partial Class PopUpBuscarFolio
|
||||
CargaPS(-1)
|
||||
'CargaCodigoCliente()
|
||||
|
||||
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltraParametros("VendedorTipo = 1")
|
||||
DdlVendedor.DataBind()
|
||||
|
||||
RegistraScript($"$('#{TxtFolio.ClientID}').focus();", "A1")
|
||||
End If
|
||||
End Sub
|
||||
@@ -138,7 +141,7 @@ Partial Class PopUpBuscarFolio
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, DdlTipoDocto.SelectedValue, Serie, Folio, Codigo, Cliente.ToEntero, DdlSubProyecto.SelectedValue.ToEntero,
|
||||
DdlEstatusFactura.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, FechaI, FechaF, FolioFiscal, If(DdlSucursalCliente.Visible, DdlSucursalCliente.SelectedValue.ToEntero, -1),
|
||||
DdlPS.SelectedValue.ToEntero, PedidoContrato:=PeidoContrato, OrdenCompra:=OrdenCompra, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TopSelect:=100) Then
|
||||
DdlPS.SelectedValue.ToEntero, PedidoContrato:=PeidoContrato, OrdenCompra:=OrdenCompra, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TopSelect:=100, CveVendedor:=DdlVendedor.SelectedValue.ToEntero) Then
|
||||
If ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
LtlTotalRegistros.Text = ObjVentas.DtResultados.Rows.Count.ToString.FormatoNumero(0)
|
||||
GV.DataSource = ObjVentas.DtResultados
|
||||
|
||||
@@ -217,23 +217,23 @@
|
||||
<asp:BoundField HeaderText="Promoción" DataField="Promocion" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,###.00##}" ItemStyle-Width="10%" />
|
||||
<%--5--%>
|
||||
<asp:BoundField HeaderText="P.U. Promoción" DataField="PUPromocion" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,###.00##}" ItemStyle-Width="10%" />
|
||||
|
||||
<asp:BoundField HeaderText="Ultimo Costo" DataField="UltimoCosto" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,###.00##}" ItemStyle-Width="10%" Visible="false" />
|
||||
<asp:BoundField HeaderText="% Utilidad" DataField="UtilidadPorcentaje" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,###.00}" ItemStyle-Width="10%" Visible="false" />
|
||||
|
||||
<%--6--%>
|
||||
<asp:BoundField HeaderText="Condiciones" ItemStyle-HorizontalAlign="Center" DataField="AplicaRestriccionTexto" ItemStyle-Width="15%" />
|
||||
<asp:BoundField HeaderText="Ultimo Costo" DataField="UltimoCosto" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,###.00##}" ItemStyle-Width="10%" Visible="false" />
|
||||
<%--7--%>
|
||||
<asp:BoundField HeaderText="Clasificacion" ItemStyle-HorizontalAlign="Left" DataField="Clasificacion"/>
|
||||
<asp:BoundField HeaderText="% Utilidad" DataField="UtilidadPorcentaje" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,###.00}" ItemStyle-Width="10%" Visible="false" />
|
||||
<%--8--%>
|
||||
<asp:BoundField HeaderText="Rin" ItemStyle-HorizontalAlign="Left" DataField="RinTamaño" Visible="false"/>
|
||||
<asp:BoundField HeaderText="Condiciones" ItemStyle-HorizontalAlign="Center" DataField="AplicaRestriccionTexto" ItemStyle-Width="15%" />
|
||||
<%--9--%>
|
||||
<asp:BoundField HeaderText="Clasificacion" ItemStyle-HorizontalAlign="Left" DataField="Clasificacion"/>
|
||||
<%--10--%>
|
||||
<asp:BoundField HeaderText="Rin" ItemStyle-HorizontalAlign="Left" DataField="RinTamaño" Visible="false"/>
|
||||
<%--11--%>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkGvDetalleEditar" runat="server" AlternateText="Editar" CausesValidation="False" CommandArgument='<%# Container.DataItemIndex%>' CommandName="Editar" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--10--%>
|
||||
<%--12--%>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkGvDetalleEliminar" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" 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" />
|
||||
@@ -333,7 +333,7 @@
|
||||
<asp:Label Text="" ID="LbPUActual" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="row" runat="server" visible ="true" id="DVUltimoCostoCostoPromedio">
|
||||
<label class="col-md-3 truncate">Ultimo Costo:</label>
|
||||
<div class="col-md-3">
|
||||
<asp:Label Text="" ID="LblUltimoCosto" runat="server" />
|
||||
|
||||
@@ -184,7 +184,6 @@ Partial Class Ventas_Promociones
|
||||
If ChkEstatus.Checked = True And Not PermisoAutorizPromocionPorcentaje Then
|
||||
BtnGuardar.Visible = False
|
||||
ButBtnEliminar.Visible = False
|
||||
'UpBotones.Update()
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -195,6 +194,13 @@ Partial Class Ventas_Promociones
|
||||
CreaDT()
|
||||
End If
|
||||
|
||||
If EmpresaGrupoDiaz AndAlso Not PermisoAutorizPromocionPorcentaje Then
|
||||
DVUltimoCostoCostoPromedio.Visible = False
|
||||
GvDatos.Columns(6).Visible = False
|
||||
GvDatos.Columns(7).Visible = False
|
||||
End If
|
||||
|
||||
CargaGvBitacora()
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user