diff --git a/AF/AF.aspx b/AF/AF.aspx
index 2234d7bf7..33c02cd41 100644
--- a/AF/AF.aspx
+++ b/AF/AF.aspx
@@ -154,6 +154,21 @@
+
diff --git a/Compras/RepNotasCredito.aspx.vb b/Compras/RepNotasCredito.aspx.vb
index 7647c7aa0..286f7dc18 100644
--- a/Compras/RepNotasCredito.aspx.vb
+++ b/Compras/RepNotasCredito.aspx.vb
@@ -4,6 +4,7 @@ Option Strict On
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
+Imports Stimulsoft.Report.Check
Partial Class Compras_RepNotasCredito
Inherits ClsPaginas
@@ -11,15 +12,34 @@ Partial Class Compras_RepNotasCredito
#Region "PROPIEDADES"
Private Property DtDatos As DataTable
Get
- DtDatos = CType(ViewState("DtDatos"), DataTable)
+ If ViewState("DtDatos") Is Nothing Then
+ ViewState("DtDatos") = New DataTable
+ End If
+
+ Return CType(ViewState("DtDatos"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtDatos") = value
End Set
End Property
+
+ Private Property DtDatosRemisiones As DataTable
+ Get
+ If ViewState("DtDatosRemisiones") Is Nothing Then
+ ViewState("DtDatosRemisiones") = New DataTable
+ End If
+ Return CType(ViewState("DtDatosRemisiones"), DataTable)
+ End Get
+ Set(value As DataTable)
+ ViewState("DtDatosRemisiones") = value
+ End Set
+ End Property
+
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
+ ConfiguraTabs()
+
DdlProveedores.setEsWebService(True)
DdlProveedores.Attributes.Add("data-metodo", "getproveedores")
DdlProveedores.SelectedText = "Todos"
@@ -27,10 +47,33 @@ Partial Class Compras_RepNotasCredito
TxtFechaSaldar.Text = NowADS().ToShortDateString
CargaDatos()
+
+
+
End If
End Sub
+ Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
+
+ If Tab.ActiveTabIndex = 0 Then
+ CargaDatos()
+ Else
+ CargaDatosRemisiones()
+ End If
+
+ End Sub
+
+ Private Sub ConfiguraTabs()
+ Tab.ActiveTabIndex = 0
+ If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 Then
+ TabRemisionesNotasCredito.Visible = True
+ End If
+ End Sub
+
+
+#Region "NOTAS DE CREDITO"
Private Sub CargaDatos()
+ DtDatos = New DataTable
Dim ObjCompras As New ClsCompras
Dim FechaI, FechaF As String
@@ -56,12 +99,95 @@ Partial Class Compras_RepNotasCredito
End If
End Sub
- Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
- CargaDatos()
+ Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
+ Dim Orden As String = ""
+ Dim Campo As String = ""
+ Dim Literal As Literal = Nothing
+ Const OrdenInicial As String = ""
+ Dim Arg(2) As String
+
+ Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
+ Campo = Arg(0)
+ Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(", ", "_")), Literal)
+
+ If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
+ ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
+ Literal.Text = String.Format("
")
+ Else
+ ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
+ Literal.Text = String.Format("
")
+ End If
+ Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
+ ViewState("Orden") = Orden
+ CargaGrid(Orden)
End Sub
+ Protected Sub CargaGrid(Orden As String)
+ Dim DV As DataView = Nothing
+ DV = New DataView(DtDatos, "", Orden, DataViewRowState.CurrentRows)
+ If Orden <> String.Empty Then
+ GvDatos.DataSource = DV.ToTable()
+ Else
+ GvDatos.DataSource = DtDatos
+ End If
+
+ GvDatos.DataBind()
+ UpDatos.Update()
+ DV.Dispose()
+ End Sub
+
+
+#End Region
+
+
+
+#Region "REMISIONES"
+ Private Sub CargaDatosRemisiones()
+ DtDatosRemisiones = New DataTable
+ GvRemisiones.DataSource = Nothing
+ Dim ObjCompras As New ClsCompras
+ Dim FechaI, FechaF As String
+
+ If txtFechaI.Text <> "" Then FechaI = txtFechaI.Text Else FechaI = "-1"
+ If txtFechaF.Text <> "" Then FechaF = txtFechaF.Text Else FechaF = "-1"
+
+
+ If ObjCompras.GetNotasCreditoRep(DdlProveedores.SelectedValue.ToEntero, DdlOpcion.SelectedValue.ToEntero, FechaI, FechaF, UsuarioActual.CveEmpresa, 2) Then
+ DtDatosRemisiones = ObjCompras.DtResultados
+ GvRemisiones.DataSource = DtDatosRemisiones
+ Else
+ Alert("Ocurrió un error al obtener las remisiones", Extensiones.TipoMensaje.MsgError)
+ End If
+
+ ObjCompras.Dispose()
+
+ GvRemisiones.DataBind()
+
+ UpDatosRemsiones.Update()
+
+ End Sub
+
+ Protected Sub GvRemisiones_RowDataBound(sender As Object, e As GridViewRowEventArgs)
+ If e.Row.RowType = DataControlRowType.DataRow Then
+ e.Row.FCHyperLink("HLRazonSocial").NavigateUrl = String.Format("/Compras/Proveedores.aspx?CveProveedor={0}", e.Row.DBCampo("CveProveedor"))
+ e.Row.FCHyperLink("HLSerieFolio").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DBCampo("CveCompra"))
+
+ End If
+ End Sub
+
+
+#End Region
+
+
+
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
- GvDatos.ExportToExcel("RepNotasCredito." & NowADS().ToShortDateString)
+
+ If Tab.ActiveTabIndex = 0 Then
+ GvDatos.ExportToExcel("RepNotasCredito." & NowADS().ToShortDateString)
+ Else
+ GvRemisiones.ExportToExcel("RepRemisionesNotasCredito." & NowADS().ToShortDateString)
+ End If
+
End Sub
@@ -219,44 +345,5 @@ Partial Class Compras_RepNotasCredito
End Sub
-#Region "O R D E N A M I E N T O"
- Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
- Dim Orden As String = ""
- Dim Campo As String = ""
- Dim Literal As Literal = Nothing
- Const OrdenInicial As String = ""
- Dim Arg(2) As String
-
- Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
- Campo = Arg(0)
- Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(", ", "_")), Literal)
-
- If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
- ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
- Literal.Text = String.Format("
")
- Else
- ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
- Literal.Text = String.Format("
")
- End If
- Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
- ViewState("Orden") = Orden
- CargaGrid(Orden)
- End Sub
-
- Protected Sub CargaGrid(Orden As String)
- Dim DV As DataView = Nothing
- DV = New DataView(DtDatos, "", Orden, DataViewRowState.CurrentRows)
- If Orden <> String.Empty Then
- GvDatos.DataSource = DV.ToTable()
- Else
- GvDatos.DataSource = DtDatos
- End If
-
- GvDatos.DataBind()
- UpDatos.Update()
- DV.Dispose()
- End Sub
-#End Region
-
End Class
diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb
index f92674eb2..607b43dc6 100644
--- a/General/SaldosIniciales.aspx.vb
+++ b/General/SaldosIniciales.aspx.vb
@@ -1579,8 +1579,8 @@ Partial Class General_SaldosIniciales
For Each Row As DataRow In dt.FiltraParametros("RFC <> ''").Rows
Dim Sucursal As String = dtsubp.FiltroPrimeroValor("CveSubProyecto", $"SubProyecto = '{Row("Sucursal").ToString()}'")
RFC = Row("RFC").ToString().Trim
- Dim Serie As String = Row("Serie").ToString()
- Dim Folio As String = Row("Folio").ToString()
+ Dim Serie As String = Row("Serie").ToString().Trim
+ Dim Folio As String = Row("Folio").ToString().Trim
Dim Fecha As Date = Row("Fecha").ToString().ToDate
Dim SubTotal As Decimal = Row("SubTotal").ToString().ToDecimal
Dim IVA As Decimal = Row("IVA").ToString().ToDecimal.RoundSQL
diff --git a/Ventas/FacturacionGlobal.aspx.vb b/Ventas/FacturacionGlobal.aspx.vb
index 44508a862..fc174e83d 100644
--- a/Ventas/FacturacionGlobal.aspx.vb
+++ b/Ventas/FacturacionGlobal.aspx.vb
@@ -202,6 +202,7 @@ Partial Class Ventas_FacturacionGlobal
Exit Sub
End If
+ CveCliente = UsuarioActual.Empresa.Funcionalidad(714).ToEntero()
If CveCliente <= 0 Then
Alert("No se pudo cargar el cliente", TipoMensaje.MsgError)
Exit Sub
diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx
index 826b0006e..9f12d88c4 100644
--- a/Ventas/Ventas.aspx
+++ b/Ventas/Ventas.aspx
@@ -1005,7 +1005,7 @@
-
![]()
+
@@ -1365,15 +1365,24 @@
-
-
-
-
-
+
+
<%--10--%>
@@ -7965,15 +7974,15 @@
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 38fdec9d3..c7b10cc0c 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -3697,12 +3697,8 @@ Partial Class Ventas
Private Sub CargaListasPrecios()
DivPrecioLista.Visible = True
- Using ObjVta As New ClsVentas
- If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then
- DdlPrecioLista.DataSource = ObjVta.DtResultados
- DdlPrecioLista.SelectedValue = ObjVta.DtResultados.FiltroPrimeroValor("CvePrecioLista", "Predeterminada = 'True'")
- End If
- End Using
+ DdlPrecioLista.DataSource = GlobalDTPrecioListas(UsuarioActual.CveEmpresa)
+ DdlPrecioLista.SelectedValue = GlobalDTPrecioListas(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "Predeterminada = 'True'")
DdlPrecioLista.DataBind()
'DdlPrecioLista.Items.Insert(0, New ListItem("Seleccione", "-1"))
@@ -8343,6 +8339,14 @@ Partial Class Ventas
End If
End If
+ If UsuarioActual.Empresa.Funcionalidad(360) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
+ e.Row.FCHtmlGenericControl("DivPrecioLista").Visible = True
+ e.Row.FCDropDownList("DdlPrecioListaEdit").DataSource = GlobalDTPrecioListas(UsuarioActual.CveEmpresa)
+ e.Row.FCDropDownList("DdlPrecioListaEdit").DataBind()
+
+ e.Row.FCDropDownList("DdlPrecioListaEdit").SelectedValueExist(e.Row.DBCampo("CvePrecioLista"))
+ End If
+
'Si es facturacion de OC o Contrato
If CveContrato > 0 AndAlso Not CveVenta > 0 AndAlso Not CveCicloComercial > 0 Then
e.Row.FCLinkButton("imgClone").Visible = False
@@ -8827,13 +8831,21 @@ Partial Class Ventas
TmpDT.Rows.Remove(TmpDT.Rows(e.RowIndex))
CalculaUsados()
+
+ Dim CvePrecioLista As Integer = -1
+ Dim PrecioLista As String = ""
+ If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(360) = "1" Then
+ CvePrecioLista = GvPS.Rows(e.RowIndex).FCDropDownList("DdlPrecioListaEdit").SelectedValue.ToEntero()
+ PrecioLista = GvPS.Rows(e.RowIndex).FCDropDownList("DdlPrecioListaEdit").SelectedItem.Text
+ End If
+
AgregarProductoServicio(Cantidad, DdlUM.SelectedValue.ToEntero(), DdlUM.SelectedItem.Text, DdlCla.SelectedValue.ToEntero(), DdlCla.SelectedItem.Text,
GvPS.Rows(e.RowIndex).FCDropDownLost("DdlPS").SelectedValue.ToEntero(), GvPS.Rows(e.RowIndex).FCDropDownLost("DdlPS").SelectedText,
GvPS.Rows(e.RowIndex).FCTextBox("TxtObsPS").Text.Trim, PU, ObjDescuento.ImporteDescuento,
GvPS.Rows(e.RowIndex).FCDropDownList("DdlProyecto").SelectedValue.ToEntero(), GvPS.Rows(e.RowIndex).FCDropDownList("DdlProyecto").SelectedItem.Text,
GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero(), GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedItem.Text,
CuentaPredial:=CuentaPredial, CveVentaDetalle:=GvPS.Rows(e.RowIndex).DataKey("CveVentaDetalle").ToString().ToEntero(), SeActualiza:=True, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle,
- ObjDescuento:=ObjDescuento, NumTurnos:=NumTurnos)
+ ObjDescuento:=ObjDescuento, NumTurnos:=NumTurnos, CvePrecioLista:=CvePrecioLista, PrecioLista:=PrecioLista)
' TmpDT.Rows(e.RowIndex)("CveUM") = Ddl.SelectedValue
' TmpDT.Rows(e.RowIndex)("UM") = Ddl.SelectedItem.Text
@@ -8918,6 +8930,16 @@ Partial Class Ventas
TmpDT.Rows(e.RowIndex)("Proyecto") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlProyecto").SelectedItem.Text
End If
+ Dim CvePrecioLista As Integer = -1
+ Dim PrecioLista As String = ""
+
+ If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(360) = "1" Then
+ CvePrecioLista = GvPS.Rows(e.RowIndex).FCDropDownList("DdlPrecioListaEdit").SelectedValue.ToEntero()
+ PrecioLista = GvPS.Rows(e.RowIndex).FCDropDownList("DdlPrecioListaEdit").SelectedItem.Text
+
+ TmpDT.Rows(e.RowIndex)("CvePrecioLista") = CvePrecioLista
+ TmpDT.Rows(e.RowIndex)("PrecioLista") = PrecioLista
+ End If
If GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").Items.Count = 0 Then
TmpDT.Rows(e.RowIndex)("SubProyecto") = "Sin SubProyecto Asignado"
@@ -17639,10 +17661,18 @@ Partial Class Ventas
End If
+ 'SI ESTA AGREGANDO TOMAR DEL SELECCIONADO
If DivPrecioLista.Visible AndAlso CvePrecioListaSugerido > 0 Then
CvePrecioListaPS = CvePrecioListaSugerido
End If
+ 'SI ES EDICION DE PS
+ If CvePrecioListaSugerido > 0 AndAlso (UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(360) = "1") Then
+ If GvPS.EditIndex >= 0 Then
+ CvePrecioListaPS = CvePrecioListaSugerido
+ End If
+ End If
+
Dim CvePrecioListaPredeterminada = -1
Dim AplicaPredeterminado As Boolean = False
@@ -17721,13 +17751,44 @@ Partial Class Ventas
If (GvRow.RowState = DataControlRowState.Edit OrElse GvRow.RowState = 5) Then
Dim CvePSParametro = ddlPSEdit.SelectedValue.ToEntero()
+ Dim DdlPrecioListaEdit = GvRow.FCDropDownList("DdlPrecioListaEdit")
+
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("")
If DrPS IsNot Nothing Then
'SUGIERE PRECIO
Dim PrecioSugerido As Decimal = 0
Dim tPrecioSugerido As Decimal = 0
tPrecioSugerido = DrPS("Precio").ToString().ToDecimal
- Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = CalculaPrecioSugerido(CvePSParametro, DrPS("CveClasificacion").ToString().ToEntero())
+ Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = CalculaPrecioSugerido(CvePSParametro, DrPS("CveClasificacion").ToString().ToEntero(), CvePrecioListaSugerido:=DdlPrecioListaEdit.SelectedValue.ToEntero())
+
+ PrecioSugerido = ObjPrecioSugerido.PrecioSugerido
+
+ If PrecioSugerido <= 0 Then PrecioSugerido = tPrecioSugerido
+
+ GvRow.FCTextBox("TxtPrecio").Text = PrecioSugerido.ToString("#,###.####") ' que muestre hasta los 4 digitos si lo requiere
+ End If
+ End If
+ End If
+ End If
+
+ End Sub
+
+ Protected Sub DdlPrecioListaEdit_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
+ If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(360) = "1" Then
+ If GvPS.EditIndex >= 0 Then
+ Dim DdlPrecioListaEdit = DirectCast(sender, DropDownList)
+ Dim GvRow = DirectCast(DdlPrecioListaEdit.NamingContainer, GridViewRow)
+
+ If (GvRow.RowState = DataControlRowState.Edit OrElse GvRow.RowState = 5) Then
+ Dim CvePSParametro = GvRow.FCDropDownLost("DdlPS").SelectedValue.ToEntero()
+
+ Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("")
+ If DrPS IsNot Nothing Then
+ 'SUGIERE PRECIO
+ Dim PrecioSugerido As Decimal = 0
+ Dim tPrecioSugerido As Decimal = 0
+ tPrecioSugerido = DrPS("Precio").ToString().ToDecimal
+ Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = CalculaPrecioSugerido(CvePSParametro, DrPS("CveClasificacion").ToString().ToEntero(), CvePrecioListaSugerido:=DdlPrecioListaEdit.SelectedValue.ToEntero())
PrecioSugerido = ObjPrecioSugerido.PrecioSugerido