This commit is contained in:
rmolina
2019-12-10 19:03:08 -07:00
parent 8668218f75
commit a7bcd1a07d
16 changed files with 235 additions and 68 deletions

View File

@@ -1,19 +0,0 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="EntradasUsados.aspx.vb" Inherits="Acumuladores_EntradasUsados" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
</asp:Content>

View File

@@ -1,5 +0,0 @@

Partial Class Acumuladores_EntradasUsados
Inherits System.Web.UI.Page
End Class

View File

@@ -0,0 +1,65 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEntradasUsadosClientes.aspx.vb" Inherits="Acumuladores_RepEntradasUsadosClientes" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a>
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
</div>
<div class="titlefiltros caption">
<div class="col-md-1 truncate v-center" style="text-align: right!important">Almacen:</div>
<div class="col-md-2 v-center">
<asp:ListBox ID="DdlAlmacen" CssClass="form-control input-sm select2me" DataTextField="Almacen" DataValueField="CveAlmacen" Style="width: 100%;" runat="server"></asp:ListBox>
</div>
<div class="row v-center">
<div class="col-md-1 truncate" style="text-align: right!important">Fecha Inicio:</div>
<div class="col-md-1 v-center">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 95px !important; padding: 0px;">
<asp:TextBox Style="width: 80px !important;" ID="TxtFechaI" runat="server" CssClass="form-control" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaI" TargetControlID="TxtFechaI" PopupButtonID="ImgFechaI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
<div class="col-md-1 truncate" style="text-align: right!important">Fecha Fin:</div>
<div class="col-md-1 v-center">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 95px !important; padding: 0px;">
<asp:TextBox Style="width: 80px !important;" ID="TxtFechaF" runat="server" CssClass="form-control" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="TxtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaF" PopupButtonID="ImgFechaF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:GridView runat="server" id="GvDatos"></asp:GridView>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
</asp:Content>

View File

@@ -0,0 +1,48 @@
Imports Extensiones
Imports System
Partial Class Acumuladores_RepEntradasUsadosClientes
Inherits ClsPaginas
Private Sub Acumuladores_EntradasUsados_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaCombos()
End If
End Sub
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
CargaDatos()
End Sub
Public Sub CargaCombos()
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
DdlAlmacen.DataBind()
DdlAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
TxtFechaI.text = now.Firstdayofmonth
txtfechaf.text = now.toshortdatestring
End Sub
Private Sub CargaDatos()
Dim FechaI, FechaF As Date
FechaI = If(IsDate(TxtFechaI.Text.Trim()), TxtFechaI.Text.Trim.todate, minfecha)
FechaF = If(IsDate(TxtFechaF.Text.Trim()), TxtFechaF.Text.Trim.todate, maxfecha)
Dim CveAlmacen As Integer = If(DdlAlmacen.SelectedValue = "", "-1", DdlAlmacen.SelectedValue).ToString.toentero
Dim Acum As New ClsAcumuladores
If Acum.EntradasUsadosClientesRep(CveAlmacen, FechaI, FechaF, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
GvDatos.datasource = Acum.DtResultados
End If
Acum.Dispose()
GvDatos.databind
End Sub
End Class

View File

@@ -840,11 +840,11 @@ Public Class ClsAcumuladores
Return Retorno
End Function
Public Function EntradasUsadosGet(CveAlmacen As Integer, FechaI As Date, FechaF As Date, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Public Function EntradasUsadosClientesRep(CveAlmacen As Integer, FechaI As Date, FechaF As Date, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
'Data = New DataTable
SqlDataAdapter("PA_Acum_EntradasUsadosGet")
SqlDataAdapter("PA_Acum_EntradasUsadosClientesGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen

View File

@@ -1778,7 +1778,11 @@ Public Class ClsInventarios
Retorno = SqlAdapter.SelectCommand.Parameters("@Existencia").Value.ToString.ToDecimal()
Me.CvePS = SqlAdapter.SelectCommand.Parameters("@CvePSRetorno").Value.ToString.ToEntero
Catch Ex1 As SqlException
Me.OnError("Ocurrió un error al obtener las existencias del producto.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
If Ex1.Message.Contains("deadlocked") Then
Me.OnError("Ocurrió un error al obtener las existencias del producto. Puede intentarlo de nuevo", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Else
Me.OnError("Ocurrió un error al obtener las existencias del producto.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
Catch ex As Exception
OnError("Ocurrió un error al obtener las existencias del producto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
@@ -3290,8 +3294,27 @@ Public Class ClsInventarios
End Function
#End Region
Public Function GetMovimientoMetodoNulo(CveMovimiento As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_MovimientoMetodoNulo")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento
.Add("@Valido", SqlDbType.Int).Direction = ParameterDirection.Output
End With
Try
SqlAdapter.Fill(Data)
Retorno = If(SqlAdapter.SelectCommand.Parameters("@Valido").Value.ToString.ToEntero = 1, True, False)
Catch ex As Exception
OnError("Ocurrió un error al obtener El Costo del Producto/Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
#Region " INVENTARIOS - COSTO PS "
Public Function GetCostoPS(CvePS As Integer, Cantidad As Double, CveAlmacen As Integer, SerieLote As String, FechaFin As Date, Optional CveSubProyecto As Integer = -1, Optional CveTipoAlmacen As Integer = 1) As Decimal
Public Function GetCostoPS(CvePS As Integer, Cantidad As Double, CveAlmacen As Integer, SerieLote As String, FechaFin As Datetime, Optional CveSubProyecto As Integer = -1, Optional CveTipoAlmacen As Integer = 1) As Decimal
Dim Retorno As Decimal = -1D
DataAdapter("PA_Inv_PSCostoGet")
@@ -3300,7 +3323,7 @@ Public Class ClsInventarios
.Add("@Cantidad", SqlDbType.Float).Value = Cantidad
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
.Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
.Add("@FechaFin", SqlDbType.DateTime).Value = FechaFin
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen
.Add("@Costo", SqlDbType.Money).Direction = ParameterDirection.Output

View File

@@ -4580,7 +4580,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Acumuladores/CatTiposUso.aspx".ToUpper(), 1034)
PaginaDict.Add("/Acumuladores/CatFoliosGarantia.aspx".ToUpper(), 1035)
PaginaDict.Add("/Acumuladores/CatGarantiasMeses.aspx".ToUpper(), 1036)
PaginaDict.Add("/Acumuladores/EntradasUsados.aspx".ToUpper(), 543)
PaginaDict.Add("/Acumuladores/RepEntradasUsadosClientes.aspx".ToUpper(), 543)
'Antes de aquí.

View File

@@ -1696,6 +1696,41 @@ Public Class ClsProductosServicios
Return Retorno
End Function
Public Function UpdatePSPrecios(Importe As Decimal, CvePrecioLista As Integer, Porcentaje As Decimal, CvePS As Integer, CveUsuario As Integer, Fecha As DateTime, Fijo As Boolean, Optional PrecioMinimo As Decimal = Nothing) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_PSPrecioUpdate")
With SqlAdapter.SelectCommand.Parameters
If Importe = -1 Then
.Add("@Importe", SqlDbType.Float).Value = DBNull.Value
Else
.Add("@Importe", SqlDbType.Float).Value = Importe
End If
If Porcentaje = -1 Then
.Add("@Porcentaje", SqlDbType.Money).Value = DBNull.Value
Else
.Add("@Porcentaje", SqlDbType.Money).Value = Porcentaje
End If
.Add("@PrecioMinimo", SqlDbType.Decimal).Value = PrecioMinimo
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@Fecha", SqlDbType.DateTime).Value = Fecha
.Add("@Fijo", SqlDbType.Bit).Value = Fijo
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar los precios de lista.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetPSPrecioLista(CvePS As Integer, CveEmpresa As Integer, Optional CvePrecioLista As Integer = -1) As Boolean
Dim Retorno As Boolean = False

View File

@@ -367,9 +367,9 @@ Namespace Extensiones
End Sub
<Runtime.CompilerServices.Extension()>
Public Sub OnError(Obj As Object, Mensaje As String, Exeption As Exception, Optional InfoAdicional As String = "")
Public Sub OnError(Obj As Object, Mensaje As String, Exeption As Exception, Optional InfoAdicional As String = "", Optional TipoMensaje As TipoMensaje = TipoMensaje.MsgError)
GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional))
Alert(Obj, Mensaje, TipoMensaje.MsgError)
Alert(Obj, Mensaje, TipoMensaje)
If WebConfigurationManager.AppSettings("SiteName") IsNot Nothing AndAlso WebConfigurationManager.AppSettings("SiteName").ToString = "1" Then MandaCorreoError(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional))
End Sub

View File

@@ -105,7 +105,7 @@ Partial Class Contabilidad_PlantillasPolizasDetalle
Me.GvDatos.DataSource = Nothing
End If
OrdenaDatos()
' OrdenaDatos()
End Sub
Public Sub CargaDatosPoliza(CvePlantillaPoliza As Integer)
Dim ObjPlantillaPolizas As New ClsContabilidad

View File

@@ -301,10 +301,11 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
Dim CveUMTemp = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPaqueteDesarmado.SelectedValue.ToEntero).FiltroPrimeroValor("CveUM").ToEntero
CveVendedor = If(RowApartadosDesarmado.Visible, DdlVendedorDesarmado.SelectedValue.ToEntero, -1)
CveCliente = If(RowClienteDesarmado.Visible, DdlClienteDesarmado.SelectedValue.ToEntero, -1)
Dim FechaFin As String = TxtFechaDesarmado.Text.ToDateTime.ToString("yyyy/MM/dd 23:59")
Dim ObjInventarios As New ClsInventarios
Dim Existencia = ObjInventarios.GetExistenciasPS(DdlPaqueteDesarmado.SelectedValue.ToEntero, CveUMTemp, UsuarioActual.CveEmpresa, DdlAlmacenDesarmado.SelectedValue.ToEntero, FechaMovto:=TxtFechaDesarmado.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente))
Dim CostoPromedio = ObjInventarios.GetCostoPS(DdlPaqueteDesarmado.SelectedValue.ToEntero, TxtCantidadDesarmado.Text.ToDouble, DdlAlmacenDesarmado.SelectedValue.ToEntero, "-1", TxtFechaDesarmado.Text.ToDate)
Dim Existencia = ObjInventarios.GetExistenciasPS(DdlPaqueteDesarmado.SelectedValue.ToEntero, CveUMTemp, UsuarioActual.CveEmpresa, DdlAlmacenDesarmado.SelectedValue.ToEntero, FechaMovto:=FechaFin, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente))
Dim CostoPromedio = ObjInventarios.GetCostoPS(DdlPaqueteDesarmado.SelectedValue.ToEntero, TxtCantidadDesarmado.Text.ToDouble, DdlAlmacenDesarmado.SelectedValue.ToEntero, "-1", FechaFin.ToDate, CveTipoAlmacen:=-1)
ObjInventarios.Dispose()
If Existencia - TxtCantidadDesarmado.Text.ToDouble < 0 Then

View File

@@ -105,7 +105,7 @@
<label class="col-md-1 truncate" style="width: 110px">Movimiento:</label>
<div class="col-md-2">
<asp:RadioButtonList runat="server" ID="RBLOpcion" RepeatDirection="Horizontal" AutoPostBack="true" Font-Size="18pt">
<asp:ListItem Selected="True" Value="2">Entrada</asp:ListItem>
<asp:ListItem Selected="True" Value="42">Entrada</asp:ListItem>
<asp:ListItem Value="3">Salida</asp:ListItem>
</asp:RadioButtonList>
</div>

View File

@@ -1066,10 +1066,10 @@ Partial Class Inventarios_RecepcionUsados
For Each Dr As DataRow In DtMovimientos.Rows
If CveConcepto = 2 AndAlso DdlMoneda.SelectedValue.ToEntero = 2 Then
ImporteConcepto = Dr("PU").ToString.ToDouble * GlobalTipoCambio(TxtFecha.Text.ToDate)
Else
ImporteConcepto = Dr("PU").ToString.ToDouble
If CveConcepto = 42 AndAlso DdlMoneda.SelectedValue.ToEntero = 2 Then
ImporteConcepto = Dr("PU").ToString.ToDouble * GlobalTipoCambio(TxtFecha.Text.ToDate)
Else
ImporteConcepto = Dr("PU").ToString.ToDouble
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
@@ -1083,10 +1083,10 @@ Partial Class Inventarios_RecepcionUsados
ErrorMovInv = True
Exit For
End If
'si es selectedvalue = 2, es entrada ,3 -salida
Dim CveConceptoUsados As Integer = If(RBLOpcion.SelectedValue.ToEntero = 2, 1, 2)
'si es selectedvalue = 42, es entrada ,3 -salida
Dim CveConceptoUsados As Integer = If(RBLOpcion.SelectedValue.ToEntero = 42, 1, 2)
If RBLOpcion.SelectedValue.ToEntero = 2 AndAlso EsDistribuidor Then
If RBLOpcion.SelectedValue.ToEntero = 42 AndAlso EsDistribuidor Then
If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, CveVenta, UsuarioActual.CveUsuario,
UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then

View File

@@ -34,7 +34,7 @@
<div class="row v-center">
<label class="col-md-1 v-center truncate">Precio de Lista:</label>
<div class="col-md-1 v-center">
<asp:DropDownList ID="DdlPrecioLista" runat="server" Width="100%" CssClass="select2me" DataValueField="CvePrecioLista" DataTextField="PrecioLista"></asp:DropDownList>
<asp:DropDownList ID="DdlPrecioLista" runat="server" AppendDataBoundItems="true" Width="100%" CssClass="select2me" DataValueField="CvePrecioLista" DataTextField="PrecioLista"></asp:DropDownList>
</div>
<label class="col-md-1 v-center truncate">Clasificación:</label>
<div class="col-md-1 v-center">
@@ -303,7 +303,7 @@
<div class="col-md-6 v-center">
<label class="col-md-6 v-center truncate">Precio de Lista:</label>
<div class="col-md-6 v-center">
<asp:DropDownList ID="DdlPrecioListaCarga" runat="server" Width="100%" CssClass="select2me" DataValueField="CvePrecioLista" DataTextField="PrecioLista"></asp:DropDownList>
<asp:DropDownList ID="DdlPrecioListaCarga" runat="server" AppendDataBoundItems="true" Width="100%" CssClass="select2me" DataValueField="CvePrecioLista" DataTextField="PrecioLista"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVPrecioListaCarga" runat="server" ControlToValidate="DdlPrecioListaCarga" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Precio Lista''</b> es necesario, por favor selecionarlo." ValidationGroup="GrpCargarExcel"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEPrecioListaCarga" runat="server" HighlightCssClass="vco" TargetControlID="RFVPrecioListaCarga" Width="300px"></ajax:ValidatorCalloutExtender>
</div>

View File

@@ -73,18 +73,27 @@ Partial Class Ventas_ActualizarPrecios
DDlClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
Public Sub CargaPreciosLista()
Public Sub CargaPreciosLista()
DdlPrecioLista.ITEMS.CLEAR
Dim ObjVta As New ClsVentas
If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then
DdlPrecioLista.DataSource = ObjVta.DtResultados.Copy()
DdlPrecioListaCarga.DataSource = ObjVta.DtResultados.Copy()
End If
ObjVta.Dispose()
ObjVta.Dispose()
DdlPrecioLista.DataBind()
DdlPrecioListaCarga.DataBind()
DdlPrecioListaCarga.DataBind()
DdlPrecioLista.Items.Insert(0, New ListItem("Seleccione", "-1"))
If UsuarioActual.CveEmpresa.Contiene(1, 140) Then
DdlPrecioLista.Items.Insert(0, New ListItem("Sin Precio Lista", "-2"))
DdlPrecioListaCarga.Items.Insert(0, New ListItem("Sin Precio Lista", "-2"))
End If
DdlPrecioListaCarga.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
Public Sub CargaPS()
@@ -193,7 +202,7 @@ Partial Class Ventas_ActualizarPrecios
ObjPS.Dispose()
BtnConsultar_Click(Nothing, Nothing)
RegistraScript("$('#divAgregar').modal('hide')")
RegistraScript("$('#divAgregar').modal('hide')")
TxtImporte.Text = ""
TxtPrecio.Text = ""
TxtPorcentaje.Text = ""
@@ -271,7 +280,7 @@ Partial Class Ventas_ActualizarPrecios
.PS = row.DataKey("PS"),
.Precio = row.FCTextBox("TxtPrecio").Text.ToDecimal()
}).QueryToDataTable(True)
If DtExcel.Rows.Count < 2 Then
If DtExcel.Rows.Count < 1 Then
Alert("No hay resutados en la busqueda.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
@@ -350,7 +359,7 @@ Partial Class Ventas_ActualizarPrecios
End Try
If Not ErrorArchivo AndAlso dt IsNot Nothing Then
If DdlPrecioListaCarga.SelectedValue.ToEntero() <= 0 Then
If DdlPrecioListaCarga.SelectedValue.ToEntero() = -1 Then
Alert("Debe Seleccionar la lista de precios a cargar. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
@@ -380,16 +389,26 @@ Partial Class Ventas_ActualizarPrecios
Dim Correcto As Boolean = False
Dim CvePS As Integer = DtPS.FiltroPrimeroValor("CvePS", String.Format("Codigo='{0}' AND CveEmpresa={1}", row(0).ToString(), UsuarioActual.CveEmpresa))
Dim CvePrecioLista As Integer = DdlPrecioListaCarga.SelectedValue.ToEntero()
Dim PrecioNuevo As Decimal = row("Precio").ToString().ToDecimal()
Dim Porcentaje As Decimal = -1
If CvePS > 0 AndAlso CvePrecioLista > 0 Then
Dim Porcentaje As Decimal = -1
Dim PrecioNuevo As Decimal = row("Precio").ToString().ToDecimal()
If CvePS > 0 AndAlso CvePrecioLista > 0 Then
Correcto = ObjPS.UpdatePSPreciosLista(PrecioNuevo, CvePrecioLista, Porcentaje, CvePS, UsuarioActual.CveUsuario, DateTime.Now, True)
If Correcto Then
RowsCargados += 1
End If
Else
Correcto = False
Else
If CvePS > 0 AndAlso CvePrecioLista = -2 Then
Correcto = ObjPS.UpdatePSPrecios(PrecioNuevo, CvePrecioLista, Porcentaje, CvePS, UsuarioActual.CveUsuario, DateTime.Now, True)
If Correcto Then
RowsCargados += 1
End If
Else
Correcto = False
End If
End If
If Not Correcto Then
ProductosNoCargados.AppendFormat("{0},", row("Producto / Servicio").ToString())

View File

@@ -5748,10 +5748,10 @@ Partial Class Ventas
Existencia = ObjInventarios.GetExistenciasPS(CvePS, -1, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1)
End If
Dim Costo As Decimal = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero)
Dim Costo As Decimal = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero, CveTipoAlmacen:=1)
'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal
If Costo = 0 Then Costo = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1)
If Costo = 0 Then Costo = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1)
ObjInventarios.Dispose()
Dim PrecioMinimo As Decimal = 0
@@ -5900,7 +5900,7 @@ Partial Class Ventas
Dim TotalCalculableImpuestos As Decimal = ((Cantidad * PU) - (Descuento))
Dim TotalCalculableImpuestosIVA As Decimal = 0
TotalCalculableImpuestosIVA = TotalCalculableImpuestos * (1 + TmpDT.Rows(e.RowIndex)("IEPSPorcentaje").ToString.ToDecimal)
TotalCalculableImpuestosIVA = TotalCalculableImpuestos * (1 + TmpDT.Rows(e.RowIndex)("PorcentajeIEPS").ToString.ToDecimal)
TmpDT.Rows(e.RowIndex)("CveUM") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida").SelectedValue.ToEntero
@@ -6352,7 +6352,7 @@ Partial Class Ventas
EsValidoMayor = False
EsValidoPU = True
PU = dr("PU").ToString.ToDecimal * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal)
Costo = ObjInventarios.GetCostoPS(dr("CvePS").ToString.ToEntero, dr("Cantidad").ToString.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero)
Costo = ObjInventarios.GetCostoPS(dr("CvePS").ToString.ToEntero, dr("Cantidad").ToString.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero, CveTipoAlmacen:=1)
Dim PrecioMinimo As Decimal = 0
'RMF. condicion temporal, para reubicación, precio mínimo
@@ -13054,9 +13054,9 @@ Partial Class Ventas
If PrecioSugerido = 0 Then
Dim ObjInventarios As New ClsInventarios
Dim CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero)
Dim CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero, CveTipoAlmacen:=1)
'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal
If CostoPS = 0 Then CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1)
If CostoPS = 0 Then CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1)
ObjInventarios.Dispose()
If CostoPS > 0 And PorcentajePrecio > 0 Then
PrecioSugerido = ((PorcentajePrecio / 100) + 1) * CostoPS
@@ -13631,10 +13631,10 @@ Partial Class Ventas
If UsuarioActual.Empresa.UsaInventarios AndAlso CveTipoPS = 2 AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "PA") Or (DdlTipoComprobante.SelectedValue.Contiene("Cot") And UsuarioActual.CveEmpresa.Contiene(119))) Then
Dim ObjInventarios As New ClsInventarios
Dim Existencia As Decimal = ObjInventarios.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1)
Dim Costo As Decimal = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero)
Dim Costo As Decimal = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero, CveTipoAlmacen:=1)
'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal
If Costo = 0 Then Costo = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1)
If Costo = 0 Then Costo = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1)
ObjInventarios.Dispose()
Dim PrecioMinimo As Decimal = 0
@@ -14238,10 +14238,10 @@ Partial Class Ventas
PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDecimal
If PrecioSugerido = 0 Then
Dim ObjInventarios As New ClsInventarios
Dim CostoPS = ObjInventarios.GetCostoPS(CvePSAdicional, DrPoliza("Cantidad").ToString.ToDecimal, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero)
Dim CostoPS = ObjInventarios.GetCostoPS(CvePSAdicional, DrPoliza("Cantidad").ToString.ToDecimal, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero, CveTipoAlmacen:=1)
'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal
If CostoPS = 0 Then CostoPS = ObjInventarios.GetCostoPS(CvePSAdicional, DrPoliza("Cantidad").ToString.ToDecimal, -1, "-1", TxtFecha.Text.ToDate, -1)
If CostoPS = 0 Then CostoPS = ObjInventarios.GetCostoPS(CvePSAdicional, DrPoliza("Cantidad").ToString.ToDecimal, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1)
ObjInventarios.Dispose()
Dim PorcentajePrecio = ObjPS.DtResultados.FiltroPrimeroValor("Porcentaje").ToDecimal