Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -28,25 +28,61 @@
|
||||
<div class="portlet-title portlet-filterT smalltitle" style="min-height: 49px;">
|
||||
<div class="tools">
|
||||
<asp:Button Text="Consultar" ID="BtnConsultar" CssClass="btn btn-primary" OnClick="BtnConsultar_Click" runat="server" />
|
||||
</div>
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption ">
|
||||
|
||||
<div class="row" style="padding-top: 10px;">
|
||||
<label class="col-md-1 truncate">Sucursal:</label>
|
||||
<div class="col-md-2 ">
|
||||
<%-- <asp:DropDownList ID="DdlSucursal" runat="server" CssClass="select2me" DataTextField="Sucursal" DataValueField="CveSucursal" Width="200px" ValidationGroup="GrpGuardar"></asp:DropDownList>--%>
|
||||
|
||||
<div class="col-md-1">
|
||||
<asp:Label runat="server" ID="LblSubProyecto" class="truncate"></asp:Label>:
|
||||
</div>
|
||||
<div class="col-md-2 ">
|
||||
<asp:DropDownList ID="DdlSubProyecto" runat="server" CssClass="select2me" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="200px" ValidationGroup="GrpGuardar"></asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 truncate">Estatus:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlEstatus" runat="server" CssClass="select2me" Width="100px" ValidationGroup="GrpGuardar">
|
||||
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Activo" Value="1" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Text="Inactivo" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
|
||||
<asp:Label runat="server" ID="Label1" class="col-md-1 truncate">Cliente:</asp:Label>
|
||||
<div class="col-md-2 ">
|
||||
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width:100%;">
|
||||
</ADS:Dropdownlost>
|
||||
</div>
|
||||
|
||||
<asp:Label runat="server" ID="Label2" class="col-md-1 truncate">Vendedor:</asp:Label>
|
||||
<div class="col-md-2 ">
|
||||
<asp:DropDownList ID="DdlVendedor" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="select2me" runat="server" Width="100%"></asp:DropDownList>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none">
|
||||
|
||||
<div class="row">
|
||||
<label class="col-md-1 truncate">Estatus:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlEstatus" runat="server" CssClass="select2me" Width="100px" ValidationGroup="GrpGuardar">
|
||||
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Activo" Value="1" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Text="Inactivo" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<asp:Label runat="server" ID="Label3" class="col-md-1 truncate">Marca:</asp:Label>
|
||||
<div class="col-md-2 ">
|
||||
<asp:DropDownList ID="DdlMarca" DataTextField="Marca" DataValueField="CveMarca" CssClass="select2me" runat="server" Width="100%"></asp:DropDownList>
|
||||
</div>
|
||||
|
||||
|
||||
<asp:Label runat="server" ID="Label4" class="col-md-1 truncate">Producto:</asp:Label>
|
||||
<div class="col-md-2">
|
||||
<ADS:Dropdownlost runat="server" Enabled="true" ID="DdlPS" CssStyle="width: 100%;" CssClassDdl="select2me" DataTextField="PSCodigo" DataValueField="CvePS" />
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</asp:Panel>
|
||||
</ContentTemplate>
|
||||
@@ -69,6 +105,10 @@
|
||||
<asp:HyperLink runat="server" ID="HLPromocion" Text='<%# Eval("Promocion").ToString %>' NavigateUrl ='<%# Eval("CvePromocion", "/Ventas/Promociones.aspx?CvePromocion={0}") %>' CssClass="Texto"></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="NombreComercial" HeaderText="Cliente" />
|
||||
<asp:BoundField DataField="Vendedor" HeaderText="Vendedor" />
|
||||
<asp:BoundField DataField="Marca" HeaderText="Marca" />
|
||||
|
||||
<asp:BoundField DataField="FechaInicio" DataFormatString="{0:d}" HeaderText="F. Inicio" ItemStyle-Width="80px" />
|
||||
<asp:BoundField DataField="FechaFin" DataFormatString="{0:d}" HeaderText="F. Fin" ItemStyle-Width="80px" />
|
||||
<asp:BoundField DataField="SubProyecto" HeaderText="Sucursal" ItemStyle-Width="125px" />
|
||||
|
||||
@@ -22,21 +22,57 @@ Partial Class Ventas_CatPromociones
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
'ImgAddPromocion.Attributes.Add("OnClick", "window.location = '/Ventas/Promociones.aspx'")
|
||||
'CARGA SUCURSALES
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa)
|
||||
DdlSubProyecto.DataBind()
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
InicializaControles()
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub InicializaControles()
|
||||
|
||||
|
||||
|
||||
CargarCentrosDeCosto(Nothing, Nothing, Nothing, LblSubProyecto)
|
||||
|
||||
GvDatos.Columns(6).HeaderText = LblSubProyecto.Text
|
||||
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa)
|
||||
DdlSubProyecto.DataBind()
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
|
||||
DdlVendedor.DataBind()
|
||||
DdlVendedor.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then
|
||||
DdlMarca.DataSource = ObjPS.DtResultados
|
||||
End If
|
||||
ObjPS.Dispose()
|
||||
DdlMarca.DataBind()
|
||||
DdlMarca.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
DdlClientes.setEsWebService(True)
|
||||
|
||||
'CARGA PS
|
||||
DdlPS.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
|
||||
DdlPS.IncluyeTodos = True
|
||||
If Not DdlPS.UsaWebService AndAlso CType(DdlPS.DataSource, DataTable) Is Nothing Then
|
||||
DdlPS.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
|
||||
DdlPS.DataBind()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetPromociones(-1, MinFecha, -1, -1, DdlEstatus.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, CveUsuario:=UsuarioActual.CveUsuario) Then
|
||||
Dim CveCliente As Integer = If(DdlClientes.SelectedValue.ToEntero > 0, DdlClientes.SelectedValue.ToEntero, -1)
|
||||
Dim CvePS As Integer = If(DdlPS.SelectedValue.ToEntero > 0, DdlPS.SelectedValue.ToEntero, -1)
|
||||
|
||||
|
||||
If ObjVentas.GetPromociones(-1, MinFecha, DdlVendedor.SelectedValue.ToEntero, CveCliente, DdlEstatus.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, CveUsuario:=UsuarioActual.CveUsuario,
|
||||
CveMarca:=DdlMarca.SelectedValue.ToEntero, CvePS:=CvePS) Then
|
||||
DtDatos = ObjVentas.DtResultados
|
||||
Else
|
||||
DtDatos = Nothing
|
||||
|
||||
@@ -5643,7 +5643,7 @@ Partial Class Clientes
|
||||
TempDTSucursales.Columns.Add("CveAlmacenAsignado", Type.GetType("System.Int32"))
|
||||
TempDTSucursales.Columns.Add("CveUsoCFDI", Type.GetType("System.Int32"))
|
||||
TempDTSucursales.Columns.Add("CveFormaPago33", Type.GetType("System.Int32"))
|
||||
TempDTSucursales.Columns.Add("CveMetodoPago", Type.GetType("System.Int32"))
|
||||
TempDTSucursales.Columns.Add("CveMetodoPago33", Type.GetType("System.Int32"))
|
||||
TempDTSucursales.Columns.Add("Correo", Type.GetType("System.String"))
|
||||
TempDTSucursales.Columns.Add("CorreoCotizacion", Type.GetType("System.String"))
|
||||
TempDTSucursales.Columns.Add("LimiteCredito", Type.GetType("System.Decimal"))
|
||||
@@ -9422,7 +9422,9 @@ Partial Class Clientes
|
||||
TmpDT.Columns.Add("ClaveSATUnidadAduanaDescripcion", GetType(String))
|
||||
|
||||
TmpDT.Columns.Add("CveTamaño", GetType(Integer))
|
||||
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
|
||||
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
|
||||
TmpDT.Columns.Add("CvePromocionDetalle", GetType(Integer))
|
||||
TmpDT.Columns("CvePromocionDetalle").DefaultValue = -1
|
||||
|
||||
Return TmpDT
|
||||
End Function
|
||||
|
||||
@@ -2101,7 +2101,8 @@ Partial Class Ventas_ClientesAbonar
|
||||
TmpDT.Columns.Add("CveTamaño", GetType(Integer))
|
||||
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
|
||||
TmpDT.Columns.Add("CodigoObjetoImpuesto", GetType(String))
|
||||
|
||||
TmpDT.Columns.Add("CvePromocionDetalle", GetType(Integer))
|
||||
TmpDT.Columns("CvePromocionDetalle").DefaultValue = -1
|
||||
Return TmpDT
|
||||
End Function
|
||||
Private Function InicializaDTVentasNC() As DataTable
|
||||
|
||||
@@ -4703,6 +4703,9 @@ Partial Class PV
|
||||
|
||||
TmpDT.Columns.Add("AplicaSerie", GetType(Boolean))
|
||||
TmpDT.Columns.Add("CveMarca", GetType(Integer))
|
||||
TmpDT.Columns.Add("CvePromocionDetalle", GetType(Integer))
|
||||
TmpDT.Columns("CvePromocionDetalle").DefaultValue = -1
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -2501,7 +2501,7 @@ Partial Class Ventas_PVCobranza
|
||||
Msg = Msg & "<br/><a class='Texto' href='/Ventas/Ventas.aspx?CveDevolucion=" & CveVentaCancelacion & "&NuevaFactura=1'> Refacturar</a>"
|
||||
End If
|
||||
|
||||
Alert(Msg, TipoMensaje.MsgConfirmacion, "BtnEnviarMailCancelacion();", TextoConfirmacion:="Enviar", TextoSegundoBoton:="Cancelar")
|
||||
Alert(Msg, TipoMensaje.MsgConfirmacion, JSBtnAceptar:="BtnEnviarMailCancelacion()", TextoConfirmacion:="Enviar", TextoSegundoBoton:="Cancelar", ShowCloseButton:=False)
|
||||
Else
|
||||
Msg = resp.Mensaje
|
||||
|
||||
|
||||
@@ -101,9 +101,20 @@
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkDescargaCartaPorte" OnClick="LnkDescargaCartaPorte_Click" runat="server" Visible="false"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Descarga Carta Porte</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkGeneraXLS1" OnClick="LnkGeneraXLS1_Click" runat="server" Visible="false"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Generar XLS 1</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkGeneraXLS2" OnClick="LnkGeneraXLS2_Click" runat="server" Visible="false"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Generar XLS 2</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkDescargaCartaPorte" />
|
||||
<asp:PostBackTrigger ControlID="LnkGeneraXLS1" />
|
||||
<asp:PostBackTrigger ControlID="LnkGeneraXLS2" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
|
||||
@@ -153,6 +153,12 @@ Partial Class Ventas_RepVentas
|
||||
PrePersonalizacion()
|
||||
CargaPersonalizacion()
|
||||
|
||||
|
||||
If UsuarioActual.CveEmpresa = 199 Then
|
||||
LnkGeneraXLS1.Visible = True
|
||||
LnkGeneraXLS2.Visible = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -1058,4 +1064,41 @@ Partial Class Ventas_RepVentas
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Protected Sub LnkGeneraXLS1_Click(sender As Object, e As EventArgs)
|
||||
RepVentasBioSistemas(1)
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkGeneraXLS2_Click(sender As Object, e As EventArgs)
|
||||
RepVentasBioSistemas(2)
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub RepVentasBioSistemas(OpcionReporte As Integer)
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
Dim DTResultados As New DataTable
|
||||
|
||||
If ObjVentas.GetRepVentasBiosistemas(UsuarioActual.CveEmpresa, OpcionReporte) Then
|
||||
DTResultados = ObjVentas.DtResultados
|
||||
End If
|
||||
|
||||
|
||||
Dim NombreReporte As String = "Reporte 1"
|
||||
Dim TituloReporte As String = "Reporte 1"
|
||||
DTResultados.TableName = "Reporte1"
|
||||
|
||||
If OpcionReporte = 2 Then
|
||||
NombreReporte = "Reporte 2"
|
||||
TituloReporte = "Reporte1 2"
|
||||
DTResultados.TableName = "Reporte2"
|
||||
End If
|
||||
|
||||
|
||||
|
||||
DTResultados.ExportToExcelG(NombreReporte, TituloReporte, UsuarioActual, "")
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -9299,7 +9299,14 @@
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" ID="UPExist" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvExist" runat="server" AutoGenerateColumns="true" GridLines="None" BorderWidth="0" CssClass="table table-striped table-hover Widthall">
|
||||
<asp:GridView ID="GvExist" runat="server" AutoGenerateColumns="true" GridLines="None" BorderWidth="0" CssClass="table table-striped table-hover">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Producto">
|
||||
<ItemTemplate >
|
||||
<span style="width:400px; display:flex;"> <asp:Literal ID="LtlProducto" runat="server" Text='<%# Eval("Producto") %>'></asp:Literal> </span>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
@@ -10494,10 +10494,16 @@ Partial Class Ventas
|
||||
|
||||
Protected Sub EmitirImprimirNew(Optional TipoDoctoViejo As String = "")
|
||||
|
||||
OrdenarPS(Reeordenar:=False, RecargarGV:=False)
|
||||
|
||||
If Not ValidaVentaContratoObra() Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Not ValidaPorcentajeIVA() Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If ValidaPagosContado(TipoDoctoViejo:=TipoDoctoViejo) Then
|
||||
Exit Sub
|
||||
End If
|
||||
@@ -25322,6 +25328,21 @@ Partial Class Ventas
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Private Function ValidaPorcentajeIVA() As Boolean
|
||||
Dim Retorno As Boolean = True
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||
Dim DtIVA As DataTable = TmpDT.FiltraParametros("PorcentajeIVA > 0", "", {"PorcentajeIVA"})
|
||||
'SOLO DEBE TENER PORCENTAJE DE 8 o 16 no ambos
|
||||
If DtIVA.Rows.Count > 1 Then
|
||||
Retorno = False
|
||||
Alert("No se puede tener porcentajes de IVA de 8 y 16% en una sola factura", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#Region " SERIE ALMACEN "
|
||||
@@ -26525,7 +26546,7 @@ Partial Class Ventas
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OrdenarPS(Optional Reeordenar As Boolean = True)
|
||||
Private Sub OrdenarPS(Optional Reeordenar As Boolean = True, Optional RecargarGV As Boolean = True)
|
||||
|
||||
If Reeordenar Then
|
||||
For Each row As GridViewRow In GvPS.Rows
|
||||
@@ -26544,8 +26565,10 @@ Partial Class Ventas
|
||||
|
||||
TmpDT.AcceptChanges()
|
||||
|
||||
GvPS.DataSource = TmpDT
|
||||
GvPS.DataBind()
|
||||
If RecargarGV Then
|
||||
GvPS.DataSource = TmpDT
|
||||
GvPS.DataBind()
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub OrdenarGvPS(ByVal sender As Object, ByVal e As EventArgs)
|
||||
OrdenarPS()
|
||||
@@ -33904,7 +33927,7 @@ Partial Class Ventas
|
||||
Next
|
||||
Return Nothing
|
||||
End Function
|
||||
Private Function AgregaPSCotizacion(Optional RecalculaImpustosLocales As Boolean = True) As Boolean
|
||||
Private Function AgregaPSCotizacion(Optional RecalculaImpustosLocales As Boolean = True, Optional DtOrden As DataTable = Nothing) As Boolean
|
||||
'Dim ObjFactCotizacion As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa)
|
||||
|
||||
'Dim TotalCotizacion As Decimal = ObjFactCotizacion.Total 'TmpDT.SUM("TotalImporte").ToDecimal() + TmpDT.SUM("ImporteIVA").ToDecimal() + TmpDT.SUM("ImporteIEPS").ToDecimal() - TmpDT.SUM("ImporteRetIVA").ToDecimal() - TmpDT.SUM("ImporteRetISR").ToDecimal()
|
||||
@@ -33925,11 +33948,17 @@ Partial Class Ventas
|
||||
' Dr("PorcentajeIVA").ToString().ToDecimal, Dr("IVA").ToString().ToDecimal,
|
||||
' Dr("CveProyecto").ToString().ToEntero(), Dr("Proyecto").ToString(), Dr("CveSubProyecto").ToString().ToEntero(), Dr("SubProyecto").ToString(),
|
||||
' CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero(), CveVentaDetalleCotizacion:=Dr("CveVentaDetalle").ToString().ToEntero(), SeActualiza:=True)
|
||||
|
||||
|
||||
Dim OrdenManual As Integer = 0
|
||||
If DtOrden IsNot Nothing Then
|
||||
OrdenManual = DtOrden.FiltroPrimeroValor("Orden", $"CveVentaDetalle = {Dr("CveVentaDetalle")}").ToEntero()
|
||||
End If
|
||||
AgregarProductoServicio(tCantidad, Dr("CveUM").ToString().ToEntero(), Dr("UM").ToString(), Dr("CveClasificacion").ToString().ToEntero(), Dr("Clasificacion").ToString(),
|
||||
Dr("CvePS").ToString.ToEntero(), Dr("PS").ToString, Dr("Obs").ToString(), Dr("PU").ToString().ToDecimal, Dr("Descuento").ToString().ToDecimal,
|
||||
Dr("CveProyecto").ToString().ToEntero(), Dr("Proyecto").ToString, Dr("CveSubProyecto").ToString().ToEntero(), Dr("SubProyecto").ToString(),
|
||||
CveContratoDetalle:=Dr("CveContratoDetalle").ToString.ToEntero(), CveVentaDetalleCotizacion:=Dr("CveVentaDetalle").ToString().ToEntero(), SeActualiza:=True,
|
||||
PorcentajeIVAFijo:=Dr("PorcentajeIVA").ToString.ToDecimal, CvePromocionDetalle:=Dr("CvePromocionDetalle").ToString().ToEntero())
|
||||
PorcentajeIVAFijo:=Dr("PorcentajeIVA").ToString.ToDecimal, CvePromocionDetalle:=Dr("CvePromocionDetalle").ToString().ToEntero(), OrdenManual:=OrdenManual)
|
||||
Next
|
||||
'Dim TotalFactura = TmpDT.SUM("TotalImporte").ToDecimal() + TmpDT.SUM("ImporteIVA").ToDecimal() + TmpDT.SUM("ImporteIEPS").ToDecimal() - TmpDT.SUM("ImporteRetIVA").ToDecimal() - TmpDT.SUM("ImporteRetISR").ToDecimal()
|
||||
|
||||
@@ -33940,6 +33969,10 @@ Partial Class Ventas
|
||||
' LastRow("ImporteIVA") = LastRow("ImporteIVA").ToString().ToDecimal() - Diferencia
|
||||
'End If
|
||||
|
||||
If DtOrden IsNot Nothing Then
|
||||
OrdenarPS(Reeordenar:=False, RecargarGV:=False)
|
||||
End If
|
||||
|
||||
CalculaTotalesVenta(RecalculaImpuestosLocales:=RecalculaImpustosLocales)
|
||||
Return True
|
||||
Else
|
||||
@@ -33954,6 +33987,12 @@ Partial Class Ventas
|
||||
'LIMPIAMOS
|
||||
|
||||
'Dim TotalCotizacion As Decimal = TxtTotal.Text.Replace(",", "").ToDecimal()
|
||||
Dim DtOrden As DataTable = Nothing
|
||||
|
||||
'SI ES UNA VENTA EXISTENTE, CONSEVAR EL ORDEN
|
||||
If CveVenta > 0 Then
|
||||
DtOrden = TmpDT.FiltraParametros("", "Orden", {"CveVentaDetalle", "Orden"})
|
||||
End If
|
||||
|
||||
TmpDT.Rows.Clear()
|
||||
TxtSubTotal.Text = "0.00"
|
||||
@@ -33978,7 +34017,7 @@ Partial Class Ventas
|
||||
End If
|
||||
ObjClientes.Dispose()
|
||||
|
||||
If Not AgregaPSCotizacion(RecalculaImpustosLocales:=False) Then
|
||||
If Not AgregaPSCotizacion(RecalculaImpustosLocales:=False, DtOrden:=DtOrden) Then
|
||||
Alert("Ocurrió un error al agregar los conceptos de la cotización. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
@@ -34487,7 +34526,7 @@ Partial Class Ventas
|
||||
|
||||
Return Valido
|
||||
End Function
|
||||
Private Sub CargaConceptosRemisionPorFacturar(CveRemisiones As String, TipoCargas As Integer)
|
||||
Private Sub CargaConceptosRemisionPorFacturar(CveRemisiones As String, TipoCargas As Integer, Optional DtOrden As DataTable = Nothing)
|
||||
Dim ObjClientes As New ClsClientes
|
||||
If ObjClientes.GetVentasRemisionesTotales(CveCliente, CveRemisiones, TipoCargas, UsuarioActual.CveEmpresa) Then
|
||||
DtRemisionesPS = ObjClientes.DtResultados
|
||||
@@ -34530,11 +34569,16 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
tCantidad = If(ChkRemProductos.Checked, GvRemPS.Rows(IndiceGVDataKey(GvRemPS, "CveVentaDetalle", $"{Dr("CveVentaDetalle")}")).FCTextBox("TxtCantidadRem").Text, Dr("Cantidad")).ToString().ToDecimal
|
||||
Dim OrdenManual As Integer = 0
|
||||
If DtOrden IsNot Nothing Then
|
||||
OrdenManual = DtOrden.FiltroPrimeroValor("Orden", $"CveVentaDetalle = {Dr("CveVentaDetalle")}").ToEntero()
|
||||
End If
|
||||
|
||||
AgregarProductoServicio(tCantidad, Dr("CveUM").ToString().ToEntero(), Dr("UM").ToString(), Dr("CveClasificacion").ToString().ToEntero(), Dr("Clasificacion").ToString(),
|
||||
Dr("CvePS").ToString().ToEntero(), Dr("PS").ToString(), Dr("Obs").ToString(), Dr("PU").ToString().ToDecimal, Dr("Descuento").ToString().ToDecimal,
|
||||
CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
|
||||
CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero(),
|
||||
CveVentaDetalleRemision:=Dr("CveVentaDetalle").ToString().ToEntero(), CvePromocionDetalle:=Dr("CvePromocionDetalle").ToString().ToEntero(), RegeneraIEPS:=True)
|
||||
CveVentaDetalleRemision:=Dr("CveVentaDetalle").ToString().ToEntero(), CvePromocionDetalle:=Dr("CvePromocionDetalle").ToString().ToEntero(), RegeneraIEPS:=True, OrdenManual:=OrdenManual)
|
||||
Next
|
||||
|
||||
If DdlFiltroContrato.SelectedValue.ToEntero() > 0 Then
|
||||
@@ -34628,6 +34672,13 @@ Partial Class Ventas
|
||||
|
||||
Private Function PreparaFacturarRemision() As Boolean
|
||||
'LIMPIAMOS
|
||||
Dim DtOrden As DataTable = Nothing
|
||||
|
||||
'SI ES UNA VENTA EXISTENTE, CONSEVAR EL ORDEN
|
||||
If CveVenta > 0 Then
|
||||
DtOrden = TmpDT.FiltraParametros("", "Orden", {"CveVentaDetalle", "Orden"})
|
||||
End If
|
||||
|
||||
TmpDT.Rows.Clear()
|
||||
TxtSubTotal.Text = "0.00"
|
||||
TxtSubTotal2.Text = "0.00"
|
||||
@@ -34649,7 +34700,7 @@ Partial Class Ventas
|
||||
If RemisionesLista IsNot Nothing Then
|
||||
RemisionesLista.Clear()
|
||||
RemisionesLista.Add(CveVenta)
|
||||
CargaConceptosRemisionPorFacturar(CveVenta.ToString(), 1)
|
||||
CargaConceptosRemisionPorFacturar(CveVenta.ToString(), 1, DtOrden:=DtOrden)
|
||||
End If
|
||||
|
||||
If TmpDT.Rows.Count = 0 Then
|
||||
@@ -35281,8 +35332,6 @@ Partial Class Ventas
|
||||
End Function
|
||||
Private Sub EmitirDocumentoNuevo(TipoDoctoNuevo As String)
|
||||
|
||||
|
||||
|
||||
If DdlVendedor.SelectedValue.ToEntero() <= 0 AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso TipoDoctoNuevo = "Ing" Then
|
||||
Alert("Debe seleccionar un vendedor.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
@@ -35419,6 +35468,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
If FolioFijo = 0 Then CargaFolios(FacturarDocumentoNuevo:=True) 'RECARGA FOLIOS CON EL NUEVO TIPO DOCTO
|
||||
|
||||
EmitirImprimir(TipoDoctoViejo) 'MANDA A EMITIR - PROCESO VIEJO
|
||||
End If
|
||||
|
||||
@@ -39137,7 +39187,11 @@ Partial Class Ventas
|
||||
|
||||
Dim PuedeAplicarDevolucion As Boolean = False
|
||||
'código temporal RMF. para devoluciones de facturas cargadas de saldos iniciales.
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso TxtFecha.Text.ToDate.Year < 2025 Then SaldoAlmacen = -1
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso TxtFecha.Text.ToDate.Year < 2025 Then
|
||||
SaldoAlmacen = -1
|
||||
DevolucionAlmacen = 0
|
||||
End If
|
||||
|
||||
If SaldoAlmacen < 0 Then
|
||||
If DevolucionAlmacen = 0 Then
|
||||
PuedeAplicarDevolucion = True
|
||||
@@ -40776,9 +40830,9 @@ Partial Class Ventas
|
||||
GvExist.DataSource = DtExistencias
|
||||
GvExist.DataBind()
|
||||
|
||||
'GvExist.Columns(0).ItemStyle.Width = New Unit(200, UnitType.Pixel)
|
||||
'ORDENA HACIA LA DERECHA LAS CANTIDAD - OJO!! NO SE USO GV.COLUMNS.COUNT PORQUE LAS COLUMNAS GENERADAS EN BEHIND NO LAS RECONOCE
|
||||
For index As Integer = 1 To DtExistencias.Columns.Count - 1
|
||||
'EL GV TIENE UNA COLUMNA EXTRA DEBE TENER UN INDICE MAYOR
|
||||
For index As Integer = 1 To DtExistencias.Columns.Count
|
||||
For Each gvr As GridViewRow In GvExist.Rows
|
||||
gvr.Cells(index).HorizontalAlign = HorizontalAlign.Right
|
||||
Next
|
||||
@@ -40791,7 +40845,7 @@ Partial Class Ventas
|
||||
|
||||
Protected Sub GvExist_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvExist.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.Header OrElse e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.Cells(0).Attributes.Add("colspan", "3")
|
||||
e.Row.Cells(1).Visible = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user