Merge branch 'master' of http://jperez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -1991,7 +1991,10 @@ Public Class ClsVentas
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function AddPromocionesDetalle(CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double, PUPromocion As Double, AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean, AplicaJueves As Boolean, AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime, Optional CantidadMinima As Integer = 1) As Boolean
|
||||
Public Function AddPromocionesDetalle(CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double, PUPromocion As Double,
|
||||
AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean, AplicaJueves As Boolean,
|
||||
AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime, Optional CantidadMinima As Integer = 1,
|
||||
Optional CveClasificacion As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_PromocionesDetalleAdd")
|
||||
|
||||
@@ -2014,6 +2017,7 @@ Public Class ClsVentas
|
||||
.Add("@HoraInicio", SqlDbType.DateTime).Value = HoraInicio
|
||||
.Add("@HoraFin", SqlDbType.DateTime).Value = HoraFin
|
||||
.Add("@CantidadMinima", SqlDbType.Int).Value = CantidadMinima
|
||||
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
|
||||
End With
|
||||
|
||||
Try
|
||||
@@ -2025,7 +2029,10 @@ Public Class ClsVentas
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function UpdatePromocionesDetalle(CvePromocionDetalle As Integer, CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double, PUPromocion As Double, AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean, AplicaJueves As Boolean, AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime, Optional CantidadMinima As Integer = 1) As Boolean
|
||||
Public Function UpdatePromocionesDetalle(CvePromocionDetalle As Integer, CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double,
|
||||
PUPromocion As Double, AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean,
|
||||
AplicaJueves As Boolean, AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime,
|
||||
Optional CantidadMinima As Integer = 1, Optional CveClasificacion As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_PromocionesDetalleUpdate")
|
||||
|
||||
@@ -2049,6 +2056,7 @@ Public Class ClsVentas
|
||||
.Add("@HoraFin", SqlDbType.DateTime).Value = HoraFin
|
||||
.Add("@CvePromocionDetalle", SqlDbType.Int).Value = CvePromocionDetalle
|
||||
.Add("@CantidadMinima", SqlDbType.Int).Value = CantidadMinima
|
||||
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
|
||||
End With
|
||||
|
||||
Try
|
||||
@@ -2262,6 +2270,43 @@ Public Class ClsVentas
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
#Region "Firmas"
|
||||
|
||||
Public Function GetVentasRelacionadas(CveVenta As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_VentasRelacionadasGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener las ventas relacionadas. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function AddVentasRelacionadas(CveVenta As Integer, CveVentaRelacionada As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_VentasRelacionadasAdd")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||
.Add("@CveVentaRelacionada", SqlDbType.Int).Value = CveVentaRelacionada
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al agregar las ventas relacionadas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#Region " I M P U E S T O S L O C A L E S"
|
||||
Public Function AddImpuestosLocales(ImpuestoLocal As String, Porcentaje As Double, Orden As Integer, TipoImpuesto As Integer, Estatus As Integer, IdCtaContable As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
@@ -4233,7 +4278,7 @@ Public Class ClsVentas
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function UpdateVentaUsadoRecibido(CveVenta As Integer, CvePS As Integer, Recibido As Boolean) As Boolean
|
||||
Public Function UpdateVentaUsadoRecibido(CveVenta As Integer, CvePS As Integer, Recibido As Boolean, CveMovimiento As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Vta_VentasUsadosRecibidoUpdate", CommandType.StoredProcedure)
|
||||
@@ -4242,6 +4287,7 @@ Public Class ClsVentas
|
||||
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||
.Add("@CvePS", SqlDbType.Int).Value = CvePS
|
||||
.Add("@Recibido", SqlDbType.Bit).Value = Recibido
|
||||
.Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -2247,6 +2247,7 @@
|
||||
<asp:HyperLinkField HeaderText="Fecha" DataTextField="Fecha" Target="_blank" ItemStyle-Width="10%" ItemStyle-CssClass="Texto" DataTextFormatString="{0:d}" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
|
||||
<asp:HyperLinkField HeaderText="Sucursal" DataTextField="SubProyecto" Target="_blank" ItemStyle-Width="15%" ItemStyle-CssClass="Texto Izquierda" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
|
||||
<asp:HyperLinkField HeaderText="Cliente" DataTextField="Cliente" Target="_blank" ItemStyle-Width="35%" ItemStyle-CssClass="Texto Izquierda" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
|
||||
<asp:HyperLinkField HeaderText="Cantidad" DataTextField="Cantidad" Target="_blank" ItemStyle-Width="5%" ItemStyle-CssClass="Texto Derecha" DataTextFormatString="{0:###,##0.00##}" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
|
||||
<asp:HyperLinkField HeaderText="Total" DataTextField="Total" Target="_blank" ItemStyle-Width="20%" ItemStyle-CssClass="Texto Derecha" DataTextFormatString="{0:###,###,##0.00##}" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
@@ -604,6 +604,7 @@
|
||||
|
||||
<div class="modal-body">
|
||||
<div align="right">
|
||||
<asp:Label ID="LblVentasPUE" runat="server" Text="" Font-Italic="True"></asp:Label>
|
||||
<input type="text" id="TxtBusq" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusq','{0}')", GvVtaPUE.ClientID) %>" style="display: inline-block; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusq','{0}')", GvVtaPUE.ClientID) %>" style="margin-top: -3px; margin-left: -13px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
@@ -792,6 +793,7 @@
|
||||
|
||||
<div class="modal-body">
|
||||
<div style="text-align:right">
|
||||
<asp:Label ID="LblComprasPUE" runat="server" Text="" Font-Italic="True"></asp:Label>
|
||||
<input type="text" id="TxtBus" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBus','{0}')", GvCompPUE.ClientID) %>" style="display: inline-block; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBus','{0}')", GvCompPUE.ClientID) %>" style="margin-top: -3px; margin-left: -13px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
|
||||
@@ -203,7 +203,9 @@ Partial Class Inicio
|
||||
|
||||
Private Sub MuestraVentasPUE()
|
||||
Dim objVentas As New ClsVentas
|
||||
If objVentas.GetPUESinPago(Now.AddYears(-4), Now, -1, -1, -1, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
|
||||
Dim FechaInicio As Date = Now.AddYears(-2)
|
||||
LblVentasPUE.Text = "Facturas apartir de " & FechaInicio.ToShortDateString
|
||||
If objVentas.GetPUESinPago(FechaInicio, Now, -1, -1, -1, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
|
||||
If objVentas.DtResultados.Rows.Count > 0 Then
|
||||
GvVtaPUE.DataSource = objVentas.DtResultados
|
||||
|
||||
@@ -216,8 +218,10 @@ Partial Class Inicio
|
||||
End Sub
|
||||
|
||||
Private Sub MuestraComprasPUE()
|
||||
Dim objCompras As New ClsCompras
|
||||
If objCompras.GetPUESinPago(Now.AddYears(-4), Now, -1, -1, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
|
||||
Dim objCompras As New ClsCompras
|
||||
Dim FechaInicio As Date = Now.AddYears(-2)
|
||||
LblComprasPUE.Text = "Facturas apartir de " & FechaInicio.ToShortDateString
|
||||
If objCompras.GetPUESinPago(FechaInicio, Now, -1, -1, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
|
||||
If objCompras.DtResultados.Rows.Count > 0 Then
|
||||
GvCompPUE.DataSource = objCompras.DtResultados
|
||||
|
||||
|
||||
@@ -1140,7 +1140,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
Exit For
|
||||
End If
|
||||
|
||||
If CveVenta > 0 AndAlso Not ObjVentas.UpdateVentaUsadoRecibido(CveVenta, Dr("CvePS").ToString.ToEntero, True) Then
|
||||
If CveVenta > 0 AndAlso Not ObjVentas.UpdateVentaUsadoRecibido(CveVenta, Dr("CvePS").ToString.ToEntero, True, CveMovimiento) Then
|
||||
Mensaje = "Error al actualizar el recibo de los usados"
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
|
||||
@@ -180,6 +180,7 @@
|
||||
<asp:BoundField HeaderText="Promoción" DataField="Promocion" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,###.00##}" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="P.U. Promoción" DataField="PUPromocion" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,###.00##}" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="Condiciones" ItemStyle-HorizontalAlign="Center" DataField="AplicaRestriccionTexto" ItemStyle-Width="15%" />
|
||||
<asp:BoundField HeaderText="Clasificacion" ItemStyle-HorizontalAlign="Left" DataField="Clasificacion"/>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="ImgE" 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>" />
|
||||
@@ -233,7 +234,7 @@
|
||||
<div class="row">
|
||||
<label class="col-md-3 truncate">Producto:</label>
|
||||
<div class="col-md-9">
|
||||
<ADS:Dropdownlost runat="server" Enabled="true" ID="DdlPS" CssStyle="width: 100%;" CssClassDdl="select2me" DataTextField="PSCodigo" DataValueField="CvePS" />
|
||||
<ADS:Dropdownlost runat="server" Enabled="true" ID="DdlPS" CssStyle="width: 100%;" CssClassDdl="select2me" DataTextField="PSCodigo" DataValueField="CvePS"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
@@ -127,6 +127,8 @@ Partial Class Ventas_Promociones
|
||||
#Region " PS "
|
||||
Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
ChangeDdlProducto()
|
||||
DdlTipoPromocion.Items.FindByValue("1").Enabled = False
|
||||
DdlTipoPromocion.Items.FindByValue("3").Enabled = False
|
||||
End Sub
|
||||
Private Sub ChangeDdlProducto()
|
||||
If UsuarioActual.Empresa.Funcionalidad(105) = "" Then
|
||||
@@ -137,6 +139,10 @@ Partial Class Ventas_Promociones
|
||||
DdlPS.ddlWS.Attributes.Add("data-idClasificacion", DdlClasificacion.SelectedValue)
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub DdlPS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPS.selectedindexchange
|
||||
DdlTipoPromocion.Items.FindByValue("1").Enabled = True
|
||||
DdlTipoPromocion.Items.FindByValue("3").Enabled = True
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
@@ -219,8 +225,8 @@ Partial Class Ventas_Promociones
|
||||
|
||||
Protected Sub BtnAgregar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
If DdlPS.SelectedValue.ToEntero <= 0 Then
|
||||
Alert("Debe seleccionar un Producto/Servicio.", TipoMensaje.MsgAdvertencia)
|
||||
If DdlClasificacion.SelectedValue.ToEntero <= 0 Then
|
||||
Alert("Debe seleccionar una clasificacion", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
@@ -242,7 +248,7 @@ Partial Class Ventas_Promociones
|
||||
Dr("Clasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimeroValor("Clasificacion")
|
||||
End If
|
||||
|
||||
Dr("CvePS") = DdlPS.SelectedValue
|
||||
Dr("CvePS") = If(DdlPS.SelectedValue = "", "-1", DdlPS.SelectedValue)
|
||||
Dr("CodigoPS") = DdlPS.SelectedText
|
||||
Dr("PUAnterior") = LbPUActual.Text.ToDecimal
|
||||
|
||||
@@ -388,7 +394,8 @@ Partial Class Ventas_Promociones
|
||||
For Each Dr As DataRow In TempDT.Rows
|
||||
If Not ObjVentas.AddPromocionesDetalle(CvePromocion, Dr("CvePS").ToString.ToEntero, Dr("CveTipoPromocion").ToString.ToEntero, Dr("Promocion").ToString.ToDouble, Dr("PUAnterior").ToString.ToDouble, Dr("PUPromocion").ToString.ToDouble,
|
||||
CBool(Dr("AplicaRestriccion")), CBool(Dr("AplicaLunes")), CBool(Dr("AplicaMartes")), CBool(Dr("AplicaMiercoles")), CBool(Dr("AplicaJueves")), CBool(Dr("AplicaViernes")), CBool(Dr("AplicaSabado")), CBool(Dr("AplicaDomingo")),
|
||||
Dr("HoraInicio").ToString.ToDateTime, Dr("HoraFin").ToString.ToDateTime, Dr("CantidadMinima").ToString.ToEntero) Then
|
||||
Dr("HoraInicio").ToString.ToDateTime, Dr("HoraFin").ToString.ToDateTime, Dr("CantidadMinima").ToString.ToEntero,
|
||||
CveClasificacion:=If(Dr("CvePS").ToString = "", 20, Dr("CveClasificacion").ToString.ToEntero)) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -417,7 +424,7 @@ Partial Class Ventas_Promociones
|
||||
For Each Dr As DataRow In TempDT.FiltraParametros("Estatus = 0").Rows
|
||||
If Not ObjVentas.AddPromocionesDetalle(CvePromocion, Dr("CvePS").ToString.ToEntero, Dr("CveTipoPromocion").ToString.ToEntero, Dr("Promocion").ToString.ToDouble, Dr("PUAnterior").ToString.ToDouble, Dr("PUPromocion").ToString.ToDouble,
|
||||
CBool(Dr("AplicaRestriccion")), CBool(Dr("AplicaLunes")), CBool(Dr("AplicaMartes")), CBool(Dr("AplicaMiercoles")), CBool(Dr("AplicaJueves")), CBool(Dr("AplicaViernes")), CBool(Dr("AplicaSabado")), CBool(Dr("AplicaDomingo")),
|
||||
Dr("HoraInicio").ToString.ToDateTime, Dr("HoraFin").ToString.ToDateTime, Dr("CantidadMinima").ToString.ToEntero) Then
|
||||
Dr("HoraInicio").ToString.ToDateTime, Dr("HoraFin").ToString.ToDateTime, Dr("CantidadMinima").ToString.ToEntero, CveClasificacion:=If(Dr("CvePS").ToString = "-1", Dr("CveClasificacion").ToString.ToEntero, -1)) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -427,7 +434,7 @@ Partial Class Ventas_Promociones
|
||||
For Each Dr As DataRow In TempDT.FiltraParametros("Estatus = 1").Rows
|
||||
If Not ObjVentas.UpdatePromocionesDetalle(Dr("CvePromocionDetalle").ToString.ToEntero, CvePromocion, Dr("CvePS").ToString.ToEntero, Dr("CveTipoPromocion").ToString.ToEntero, Dr("Promocion").ToString.ToDouble, Dr("PUAnterior").ToString.ToDouble, Dr("PUPromocion").ToString.ToDouble,
|
||||
CBool(Dr("AplicaRestriccion")), CBool(Dr("AplicaLunes")), CBool(Dr("AplicaMartes")), CBool(Dr("AplicaMiercoles")), CBool(Dr("AplicaJueves")), CBool(Dr("AplicaViernes")), CBool(Dr("AplicaSabado")), CBool(Dr("AplicaDomingo")),
|
||||
Dr("HoraInicio").ToString.ToDateTime, Dr("HoraFin").ToString.ToDateTime, Dr("CantidadMinima").ToString.ToEntero) Then
|
||||
Dr("HoraInicio").ToString.ToDateTime, Dr("HoraFin").ToString.ToDateTime, Dr("CantidadMinima").ToString.ToEntero, CveClasificacion:=If(Dr("CvePS").ToString = "-1", Dr("CveClasificacion").ToString.ToEntero, -1)) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user