Promiciones actualizacion PSultimo costo
This commit is contained in:
@@ -66,17 +66,23 @@ Partial Class ListadoContratos
|
|||||||
End If
|
End If
|
||||||
ObjContratos.Dispose()
|
ObjContratos.Dispose()
|
||||||
|
|
||||||
'Generamos Folio - NumeroContrato
|
|
||||||
Dim CveSubProyecto As Integer = GlobalDTSubProyectos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", "TipoSucursal = 1").ToEntero
|
UpTitulos.Update()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CargaFolio()
|
||||||
|
'Dim CveSubProyecto As Integer = GlobalDTSubProyectos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", "TipoSucursal = 1").ToEntero
|
||||||
|
|
||||||
Dim ObjFolio As New ClsGralFolios
|
Dim ObjFolio As New ClsGralFolios
|
||||||
If ObjFolio.GetFolios("Con", UsuarioActual.CveEmpresa, CveSubProyecto:=CveSubProyecto) Then
|
If ObjFolio.GetFolios("Con", UsuarioActual.CveEmpresa, CveSubProyecto:=-1) Then
|
||||||
If ObjFolio.DtResultados.Rows.Count > 0 Then
|
If ObjFolio.DtResultados.Rows.Count > 0 Then
|
||||||
Dim drr As DataRow = ObjFolio.DtResultados.FiltroPrimero("")
|
Dim drr As DataRow = ObjFolio.DtResultados.FiltroPrimero("")
|
||||||
LbFolio.Text = $"{drr("Serie").ToString}-{drr("FActual").ToString}"
|
LbFolio.Text = $"{drr("Serie").ToString}-{drr("FActual").ToString}"
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
ObjFolio.Dispose()
|
||||||
|
|
||||||
UpTitulos.Update()
|
UpModal.Update()
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
#Region "Contrato"
|
#Region "Contrato"
|
||||||
@@ -189,11 +195,12 @@ Partial Class ListadoContratos
|
|||||||
ErrorProceso = True
|
ErrorProceso = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If Not ErrorProceso Then
|
||||||
'Aumentamos Folio
|
'Aumentamos Folio
|
||||||
Dim ObjFolios As New ClsGralFolios(ObjContratos.IniciaTransacSQL())
|
Dim ObjFolios As New ClsGralFolios(ObjContratos.IniciaTransacSQL())
|
||||||
If Not ObjFolios.UpdateFolioActual(DdlSubProyectoModal.SelectedValue.ToEntero, "Con", True, UsuarioActual.CveEmpresa) Then
|
If Not ObjFolios.UpdateFolioActual(-1, "Con", True, UsuarioActual.CveEmpresa) Then
|
||||||
ErrorProceso = True
|
ErrorProceso = True
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
@@ -400,7 +407,74 @@ Partial Class ListadoContratos
|
|||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Protected Sub LnkAgregarContrato_Click(sender As Object, e As EventArgs)
|
Protected Sub LnkAgregarContrato_Click(sender As Object, e As EventArgs)
|
||||||
|
CargaFolio()
|
||||||
RegistraScript("$('#ModalAgregar').modal({ backdrop: 'static', keyboard: false });")
|
RegistraScript("$('#ModalAgregar').modal({ backdrop: 'static', keyboard: false });")
|
||||||
UpTitulos.Update()
|
UpTitulos.Update()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
'Private Sub CargaFolios(Optional FacturarDocumentoNuevo As Boolean = False)
|
||||||
|
|
||||||
|
|
||||||
|
' Dim ObjFolios As New ClsGralFolios()
|
||||||
|
' Dim TipoDoctoConsulta As String = ""
|
||||||
|
|
||||||
|
' If ObjFolios.GetFolios(TipoDoctoConsulta, UsuarioActual.CveEmpresa) Then
|
||||||
|
' Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" CveSubProyecto = {0} And Estado = 'Activo'", DdlSubProyectoDatos.SelectedValue))
|
||||||
|
' If DT.Rows.Count > 0 Then
|
||||||
|
' ViewState("CveFolio") = DT.Rows(0)("CveFolio").ToString().ToEntero()
|
||||||
|
' 'ViewState("NumAprobacion") = CLng(DT.Rows(0)("Aprobacion").ToString())
|
||||||
|
' 'ViewState("FechaAprobacion") = DT.Rows(0)("FechaAprobacion").ToString().ToDate
|
||||||
|
' ViewState("FolioActual") = DT.Rows(0)("FActual").ToString()
|
||||||
|
' If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CveVenta > 0 AndAlso Not EsCreaApartirDe AndAlso Not String.IsNullOrEmpty(SerieVenta) Then
|
||||||
|
' LblSerie.Text = SerieVenta
|
||||||
|
' Else
|
||||||
|
' LblSerie.Text = DT.Rows(0)("Serie").ToString()
|
||||||
|
' End If
|
||||||
|
' TxtFolio.Text = DT.Rows(0)("FActual").ToString()
|
||||||
|
|
||||||
|
' If Not FacturarDocumentoNuevo Then
|
||||||
|
' If Not CveEmpresaCRM > 0 Then
|
||||||
|
' 'SI ES UNA REMISION EXISTENTE, NO MOSTRAR LOS BOTONES
|
||||||
|
' If Not (CveVenta > 0 AndAlso DdlTipoComprobante.SelectedValue = "Rem") Then
|
||||||
|
' BtnCrearApartirDe.Enabled = EstatusCliente AndAlso TieneBloqueoPorCreditoVencimiento = 0
|
||||||
|
' BtnEmitirImprimir.Visible = EstatusCliente AndAlso TieneBloqueoPorCreditoVencimiento = 0
|
||||||
|
' TrVistaPrevia.Visible = EstatusCliente
|
||||||
|
' End If
|
||||||
|
' Else
|
||||||
|
' If TipoDoctoConsulta.Contiene("Ing", "Egs", "Ant", "Dev") Then
|
||||||
|
' BtnCrearApartirDe.Enabled = EstatusCliente AndAlso TieneBloqueoPorCreditoVencimiento = 0
|
||||||
|
' BtnEmitirImprimir.Visible = EstatusCliente AndAlso TieneBloqueoPorCreditoVencimiento = 0
|
||||||
|
' TrVistaPrevia.Visible = EstatusCliente
|
||||||
|
' Else
|
||||||
|
' BtnCrearApartirDe.Enabled = True
|
||||||
|
' BtnEmitirImprimir.Visible = True
|
||||||
|
' TrVistaPrevia.Visible = True
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' UpFacturar.Update()
|
||||||
|
' Else
|
||||||
|
|
||||||
|
' If DdlTipoComprobante.Items.Count > 0 Then
|
||||||
|
' Alert("No tiene registrados Folios para " & DdlTipoComprobante.SelectedItem.Text & " en esta sucursal.", TipoMensaje.MsgAdvertencia)
|
||||||
|
' Else
|
||||||
|
' Alert("No tiene permisos para generar ningun tipo de documento.", TipoMensaje.MsgAdvertencia)
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' TrEmitir.Visible = False
|
||||||
|
' TrVistaPrevia.Visible = False
|
||||||
|
' BtnCrearApartirDe.Enabled = False
|
||||||
|
' BtnEmitirImprimir.Visible = False
|
||||||
|
' UpFacturar.Update()
|
||||||
|
' End If
|
||||||
|
' DT.Dispose()
|
||||||
|
' End If
|
||||||
|
' ObjFolios.Dispose()
|
||||||
|
' 'End If
|
||||||
|
|
||||||
|
'End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -85,18 +85,18 @@ Partial Class Ventas_Promociones
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
|
||||||
Private Property DTPSUltimoCosto As DataTable
|
'Private Property DTPSUltimoCosto As DataTable
|
||||||
Get
|
' Get
|
||||||
If ViewState("DTPSUltimoCosto") Is Nothing Then
|
' If ViewState("DTPSUltimoCosto") Is Nothing Then
|
||||||
ViewState("DTPSUltimoCosto") = New DataTable
|
' ViewState("DTPSUltimoCosto") = New DataTable
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
Return CType(ViewState("DTPSUltimoCosto"), DataTable)
|
' Return CType(ViewState("DTPSUltimoCosto"), DataTable)
|
||||||
End Get
|
' End Get
|
||||||
Set(value As DataTable)
|
' Set(value As DataTable)
|
||||||
ViewState("DTPSUltimoCosto") = value
|
' ViewState("DTPSUltimoCosto") = value
|
||||||
End Set
|
' End Set
|
||||||
End Property
|
'End Property
|
||||||
|
|
||||||
Private Property PermisoAutorizPromocionPorcentaje As Boolean
|
Private Property PermisoAutorizPromocionPorcentaje As Boolean
|
||||||
Get
|
Get
|
||||||
@@ -159,7 +159,7 @@ Partial Class Ventas_Promociones
|
|||||||
PorMinMasCostoVentaFnc129 = UsuarioActual.Empresa.Funcionalidad(129).ToDecimal
|
PorMinMasCostoVentaFnc129 = UsuarioActual.Empresa.Funcionalidad(129).ToDecimal
|
||||||
PermisoAutorizPromocionPorcentaje = UsuarioActual.TienePermisoProceso(386)
|
PermisoAutorizPromocionPorcentaje = UsuarioActual.TienePermisoProceso(386)
|
||||||
|
|
||||||
EmpresaFnc382 = If(UsuarioActual.Empresa.Funcionalidad(352) = "1", True, False) 'Grupo díaz
|
EmpresaFnc382 = If(UsuarioActual.Empresa.Funcionalidad(382) = "1", True, False) 'Grupo díaz
|
||||||
'EmpresaFnc382 = True ''Para pruebas
|
'EmpresaFnc382 = True ''Para pruebas
|
||||||
|
|
||||||
CvePromocion = -1
|
CvePromocion = -1
|
||||||
@@ -345,20 +345,20 @@ Partial Class Ventas_Promociones
|
|||||||
|
|
||||||
Private Sub CargaDTUltimoCosto()
|
Private Sub CargaDTUltimoCosto()
|
||||||
|
|
||||||
If Not EmpresaFnc382 Then
|
If EmpresaFnc382 Then
|
||||||
Exit Sub
|
Dim DTPSUltimoCosto = New DataTable
|
||||||
|
|
||||||
|
Dim ObjInv As New ClsInventarios
|
||||||
|
|
||||||
|
If ObjInv.GetUltimoCosto(UsuarioActual.CveEmpresa) Then
|
||||||
|
DTPSUltimoCosto = ObjInv.DtResultados
|
||||||
|
End If
|
||||||
|
|
||||||
|
ObjInv.Dispose()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
DTPSUltimoCosto = New DataTable
|
|
||||||
|
|
||||||
Dim ObjInv As New ClsInventarios
|
|
||||||
|
|
||||||
If ObjInv.GetUltimoCosto(UsuarioActual.CveEmpresa) Then
|
|
||||||
DTPSUltimoCosto = ObjInv.DtResultados
|
|
||||||
End If
|
|
||||||
|
|
||||||
ObjInv.Dispose()
|
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
@@ -619,6 +619,16 @@ Partial Class Ventas_Promociones
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
Dim DTPSUltimoCosto = New DataTable
|
||||||
|
|
||||||
|
Dim ObjInv As New ClsInventarios
|
||||||
|
If ObjInv.GetUltimoCosto(UsuarioActual.CveEmpresa) Then
|
||||||
|
DTPSUltimoCosto = ObjInv.DtResultados
|
||||||
|
End If
|
||||||
|
ObjInv.Dispose()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If PorMinMasCostoVentaFnc129 > 0 Then
|
If PorMinMasCostoVentaFnc129 > 0 Then
|
||||||
|
|
||||||
For Each dRow As DataRow In TempDT.Rows
|
For Each dRow As DataRow In TempDT.Rows
|
||||||
@@ -1141,22 +1151,6 @@ Partial Class Ventas_Promociones
|
|||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
'Protected Sub DdlTipoPromocion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoPromocion.SelectedIndexChanged
|
|
||||||
' If DdlTipoPromocion.SelectedValue = "3" Then
|
|
||||||
' DivCantMinima.Visible = True
|
|
||||||
' Else
|
|
||||||
' DivCantMinima.Visible = False
|
|
||||||
' End If
|
|
||||||
'End Sub
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||||
|
|
||||||
@@ -1321,11 +1315,6 @@ Partial Class Ventas_Promociones
|
|||||||
ObjPS.Dispose()
|
ObjPS.Dispose()
|
||||||
|
|
||||||
|
|
||||||
'Dim ObjGral As New ClsGenerales
|
|
||||||
'If ObjGral.GetRinTamanios(UsuarioActual.CveEmpresa) Then
|
|
||||||
' DTRines = ObjGral.DtResultados
|
|
||||||
'End If
|
|
||||||
'ObjGral.Dispose()
|
|
||||||
DTRines = GlobalDTPSRinTamaños(UsuarioActual.CveEmpresa)
|
DTRines = GlobalDTPSRinTamaños(UsuarioActual.CveEmpresa)
|
||||||
|
|
||||||
Dim RegistroActual As Integer = 1
|
Dim RegistroActual As Integer = 1
|
||||||
@@ -1335,8 +1324,6 @@ Partial Class Ventas_Promociones
|
|||||||
|
|
||||||
Dim ClasificacionStr, CodigoStr, TipoPromocionStr, PromocionStr, CantidadMinimaStr, RinStr, IncluyeImpuestosStr As String
|
Dim ClasificacionStr, CodigoStr, TipoPromocionStr, PromocionStr, CantidadMinimaStr, RinStr, IncluyeImpuestosStr As String
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ClasificacionStr = dRow("Clasificacion").ToString.Trim
|
ClasificacionStr = dRow("Clasificacion").ToString.Trim
|
||||||
CodigoStr = dRow("Codigo").ToString.Trim
|
CodigoStr = dRow("Codigo").ToString.Trim
|
||||||
TipoPromocionStr = dRow("TipoPromocion").ToString.Trim
|
TipoPromocionStr = dRow("TipoPromocion").ToString.Trim
|
||||||
@@ -1414,7 +1401,6 @@ Partial Class Ventas_Promociones
|
|||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
|
||||||
If Errores.ToString.Length = 0 Then
|
If Errores.ToString.Length = 0 Then
|
||||||
DTPlantilla.AcceptChanges()
|
DTPlantilla.AcceptChanges()
|
||||||
Return True
|
Return True
|
||||||
@@ -1423,23 +1409,24 @@ Partial Class Ventas_Promociones
|
|||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Protected Sub DdlPS_selectedindexchange(sender As Object, e As EventArgs)
|
Protected Sub DdlPS_selectedindexchange(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
Dim DTPSUltimoCosto = New DataTable
|
||||||
|
|
||||||
|
Dim ObjInv As New ClsInventarios
|
||||||
|
If ObjInv.GetUltimoCosto(UsuarioActual.CveEmpresa) Then
|
||||||
|
DTPSUltimoCosto = ObjInv.DtResultados
|
||||||
|
End If
|
||||||
|
ObjInv.Dispose()
|
||||||
|
|
||||||
LblUltimoCosto.Text = DTPSUltimoCosto.FiltroPrimeroValor("UltimoCosto", $"CvePS = {DdlPS.SelectedValue}").FormatoNumero
|
LblUltimoCosto.Text = DTPSUltimoCosto.FiltroPrimeroValor("UltimoCosto", $"CvePS = {DdlPS.SelectedValue}").FormatoNumero
|
||||||
LblCostoPromedio.Text = DTPSUltimoCosto.FiltroPrimeroValor("CostoPromedio", $"CvePS = {DdlPS.SelectedValue}").FormatoNumero
|
LblCostoPromedio.Text = DTPSUltimoCosto.FiltroPrimeroValor("CostoPromedio", $"CvePS = {DdlPS.SelectedValue}").FormatoNumero
|
||||||
|
|
||||||
UpAgregar.Update()
|
UpAgregar.Update()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Protected Sub BtnProvbarEnvio_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnProvbarEnvio_Click(sender As Object, e As EventArgs)
|
||||||
MandaCorreoNotificacionPromocionBloqueo(CvePromocion, TxtPromocion.Text.Trim)
|
MandaCorreoNotificacionPromocionBloqueo(CvePromocion, TxtPromocion.Text.Trim)
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -242,7 +242,9 @@
|
|||||||
<asp:HyperLinkField ItemStyle-HorizontalAlign="Left" Target="_blank" HeaderText="Grupo" DataTextField="GPO" DataNavigateUrlFields="FechaI,FechaF,CveSubProyecto,CveCliente,CveVendedor,Grupo,GPO,CvePS,CveClasificacion,CveMarca,CveCategoria" DataNavigateUrlFormatString="RepVentasUtilidad.aspx?FechaI={0}&FechaF={1}&CveSubProyecto={2}&CveCliente={3}&CveVendedor={4}&Gpo={5}&CveGpo={6}&CvePS={7}&CveClasificacion={8}&CveMarca={9}&CveCategoria={10}" />
|
<asp:HyperLinkField ItemStyle-HorizontalAlign="Left" Target="_blank" HeaderText="Grupo" DataTextField="GPO" DataNavigateUrlFields="FechaI,FechaF,CveSubProyecto,CveCliente,CveVendedor,Grupo,GPO,CvePS,CveClasificacion,CveMarca,CveCategoria" DataNavigateUrlFormatString="RepVentasUtilidad.aspx?FechaI={0}&FechaF={1}&CveSubProyecto={2}&CveCliente={3}&CveVendedor={4}&Gpo={5}&CveGpo={6}&CvePS={7}&CveClasificacion={8}&CveMarca={9}&CveCategoria={10}" />
|
||||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Ventas" DataField="Ventas" DataFormatString="{0:N2}" />
|
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Ventas" DataField="Ventas" DataFormatString="{0:N2}" />
|
||||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Crédito" DataField="Credito" DataFormatString="{0:N2}" />
|
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Crédito" DataField="Credito" DataFormatString="{0:N2}" />
|
||||||
|
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="% Crédito" DataField="PorcentajeCredito" ItemStyle-Width="30px" />
|
||||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Contado" DataField="Contado" DataFormatString="{0:N2}" />
|
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Contado" DataField="Contado" DataFormatString="{0:N2}" />
|
||||||
|
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="% Contado" DataField="PorcentajeCredito" ItemStyle-Width="30px" />
|
||||||
|
|
||||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="%" DataField="ProcentajeVentas" DataFormatString="{0:N2}" ItemStyle-Width="30px" />
|
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="%" DataField="ProcentajeVentas" DataFormatString="{0:N2}" ItemStyle-Width="30px" />
|
||||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Descuento" DataField="Descuento" DataFormatString="{0:N2}" />
|
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Descuento" DataField="Descuento" DataFormatString="{0:N2}" />
|
||||||
|
|||||||
@@ -32,6 +32,11 @@ Partial Class Ventas_RepVentasUtilidadPadre
|
|||||||
|
|
||||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||||
If Not IsPostBack Then
|
If Not IsPostBack Then
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(382) <> "1" Then
|
||||||
|
GvDatos.Columns(3).Visible = False
|
||||||
|
GvDatos.Columns(5).Visible = False
|
||||||
|
End If
|
||||||
|
|
||||||
CargaCombos()
|
CargaCombos()
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
Reference in New Issue
Block a user