Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -168,11 +168,7 @@
|
||||
<asp:DropDownList ID="DdlVendedores" runat="server" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;" id="Div3" runat="server" visible="false">
|
||||
<div class="col-md-2 truncate">Marca</div>
|
||||
<div class="col-md-4">
|
||||
<asp:DropDownList ID="DdlMarcas" runat="server" DataTextField="Marca" DataValueField="CveMarca" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
|
||||
</div>
|
||||
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
|
||||
<div class="col-md-2 truncate">Mes y Año</div>
|
||||
<div class="col-md-4">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 95px !important; padding: 0px;">
|
||||
@@ -185,6 +181,12 @@
|
||||
<ajax:CalendarExtender runat="server" ID="CEFechaI" TargetControlID="TxtFechaI" PopupButtonID="ImgFechaI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;" id="Div3" runat="server" visible="false">
|
||||
<div class="col-md-2 truncate">Marca</div>
|
||||
<div class="col-md-10">
|
||||
<asp:DropDownList ID="DdlMarcas" runat="server" DataTextField="Marca" DataValueField="CveMarca" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;" id="Div2" runat="server" visible="false">
|
||||
<div class="col-md-2">Clasificación Superior</div>
|
||||
<div class="col-md-10">
|
||||
|
||||
@@ -44,7 +44,6 @@ Partial Class CatMetasVendedores
|
||||
GvDatos.Columns(1).Visible = False
|
||||
GvDatos.Columns(2).Visible = False
|
||||
GvDatos.Columns(3).Visible = False
|
||||
GvDatos.Columns(4).Visible = False
|
||||
|
||||
DivLblSucursal.Visible = False
|
||||
DivSucursal.Visible = False
|
||||
@@ -109,13 +108,15 @@ Partial Class CatMetasVendedores
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkAgregar_Click() Handles LnkAgregar.Click
|
||||
BtnAgregarMetaVendedor.Text = "Agregar"
|
||||
ResetDatosSeleccionadosModal()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD"))
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarMetaVendedor_Click(sender As Object, e As EventArgs) Handles BtnAgregarMetaVendedor.Click
|
||||
|
||||
Dim CveVendedor As Integer = DdlVendedores.SelectedValue.ToEntero()
|
||||
Dim Fecha As Date = MinFecha
|
||||
Dim Fecha As Date = TxtFechaI.Text.ToDate()
|
||||
Dim CveMarca As Integer = -1
|
||||
Dim CveClasificacionSuperior As Integer = -1
|
||||
Dim CveClasificacion As Integer = -1
|
||||
@@ -128,14 +129,13 @@ Partial Class CatMetasVendedores
|
||||
Alert(String.Format("Falta Seleccionar {0}{1}{2}", If(DdlVendedores.SelectedValue.ToEntero > 0, "", "Vendedor, "), If(DdlMarcas.SelectedValue.ToEntero > 0, "", "Marca, "), If(TxtFechaI.Text <> "", "", "Fecha, ")))
|
||||
Exit Sub
|
||||
End If
|
||||
Fecha = TxtFechaI.Text.ToDate()
|
||||
CveClasificacionSuperior = DdlClasificacionSup.SelectedValue.ToEntero
|
||||
CveClasificacion = DdlClasificacion.SelectedValue.ToEntero
|
||||
CveMarca = DdlMarca.SelectedValue.ToEntero
|
||||
|
||||
Else
|
||||
If Not (DdlVendedores.SelectedValue.ToEntero > 0) Then
|
||||
Alert("Falta Seleccionar el vendedor")
|
||||
If Not (DdlVendedores.SelectedValue.ToEntero > 0 AndAlso TxtFechaI.Text <> "") Then
|
||||
Alert(String.Format("Falta Seleccionar {0}{1}", If(DdlVendedores.SelectedValue.ToEntero > 0, "", "Vendedor, "), If(TxtFechaI.Text <> "", "", "Fecha, ")))
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
@@ -176,12 +176,11 @@ Partial Class CatMetasVendedores
|
||||
BtnAgregarMetaVendedor.Text = "Actualizar"
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
CveMetaVendedor = GvRow.DataKey("CveMeta").ToEntero
|
||||
DdlVendedores.SelectedValue = GvRow.DataKey("CveVendedor")
|
||||
DdlVendedores.SelectedValue = GvRow.DataKey("CveVendedor")
|
||||
TxtFechaI.Text = GvRow.DataKey("MesAño")
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
|
||||
TxtFechaI.Text = GvRow.DataKey("MesAño")
|
||||
|
||||
DdlClasificacionSup.SelectedValueExist(GvRow.DataKey("CveClasificacionSup"))
|
||||
DdlClasificacion.SelectedValueExist(GvRow.DataKey("CveClasificacion"))
|
||||
|
||||
|
||||
@@ -281,6 +281,12 @@ Partial Class Ventas_Promociones
|
||||
'DdlPS.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso Request("CvePromocion") IsNot Nothing AndAlso Request("CvePromocion").ToString.ToEntero > 0 Then
|
||||
If DdlSubProyecto.Items.FindByValue("-1") Is Nothing Then
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
End If
|
||||
|
||||
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
|
||||
DdlVendedor.DataBind()
|
||||
DdlVendedor.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
@@ -3438,7 +3438,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet light xspadding bordered whitoutcol">
|
||||
<div class="portlet light xspadding bordered whitoutcol" id="DivComplementoSC" runat="server" visible="false">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
@@ -3455,16 +3455,17 @@
|
||||
<div class="portlet-body form-horizontal form-row-sepe formnombottom" style="display: none;">
|
||||
<div class="form-body">
|
||||
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
|
||||
<div class="col-md-4">
|
||||
NumPerLicoAut
|
||||
<div class="col-md-4" style="display: flex">
|
||||
No.Permiso
|
||||
<div style="color: red">*</div>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<asp:TextBox ID="TxtNumPerLicoAut" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
|
||||
<div class="col-md-4">
|
||||
Calle
|
||||
<div class="col-md-4" style="display: flex">
|
||||
Calle<div style="color: red">*</div>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<asp:TextBox ID="TxtSCCalle" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox>
|
||||
@@ -3511,16 +3512,16 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
|
||||
<div class="col-md-4">
|
||||
Municipio
|
||||
<div class="col-md-4" style="display: flex">
|
||||
Municipio<div style="color: red">*</div>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<asp:TextBox ID="TxtSCMunicipio" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
|
||||
<div class="col-md-4">
|
||||
Estado
|
||||
<div class="col-md-4" style="display: flex">
|
||||
Estado<div style="color: red">*</div>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<asp:DropDownList ID="DdlSCEstado" DataTextField="NombreEstado" DataValueField="CveEstado" runat="server" CssClass="form-control input-sm select2me" Width="100%">
|
||||
@@ -3528,8 +3529,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
|
||||
<div class="col-md-4">
|
||||
Código Postal
|
||||
<div class="col-md-4" style="display: flex">
|
||||
C.Postal<div style="color: red">*</div>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<asp:TextBox ID="TxtSCCP" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox>
|
||||
@@ -6943,6 +6944,8 @@
|
||||
<asp:Button ID="BtnRefacturacionConfirmarAceptacion" runat="server" ClientIDMode="Static" Text="Refacturacion Aceptacion Documento" Style="display: none;" />
|
||||
<asp:Button ID="BtnRefrescarPagina" runat="server" ClientIDMode="Static" Text="Refrescar" Style="display: none;" />
|
||||
<asp:Button ID="BtnAplicaNuevaNC" runat="server" ClientIDMode="Static" Text="AplicarNC" Style="display: none;" />
|
||||
<asp:Button ID="BtnCreaApartirDePrecioOriginal" runat="server" ClientIDMode="Static" Text="Crear" Style="display: none;" OnClick="BtnCreaApartirDePrecioOriginal_Click" />
|
||||
<asp:Button ID="BtnCreaApartirDePrecioNuevo" runat="server" ClientIDMode="Static" Text="Refrescar" Style="display: none;" OnClick="BtnCreaApartirDePrecioNuevo_Click" />
|
||||
|
||||
<asp:HiddenField ID="HdnCveVentaAcuse" runat="server" ClientIDMode="Static" Value="0" />
|
||||
<%--FLETES--%>
|
||||
@@ -11225,6 +11228,13 @@
|
||||
$('#BtnCargarPSAdicionales').click();
|
||||
}
|
||||
|
||||
function BtnCreaApartirDePrecioOriginal() {
|
||||
$('#BtnCreaApartirDePrecioOriginal').click();
|
||||
}
|
||||
function BtnCreaApartirDePrecioNuevo() {
|
||||
$('#BtnCreaApartirDePrecioNuevo').click();
|
||||
}
|
||||
|
||||
$('.DdlPS').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
|
||||
|
||||
$("body").on("mouseenter", ".select2-container.select2-container--default.select2-container--open .select2-dropdown li", function (event) {
|
||||
|
||||
@@ -2738,10 +2738,12 @@ Partial Class Ventas
|
||||
CargaDdlClientesSucursal()
|
||||
End If
|
||||
|
||||
DivComplementoSC.Visible = UsuarioActual.CveRol = 1
|
||||
|
||||
DdlSCEstado.DataSource = GlobalDTGralEstados("MEX")
|
||||
DdlSCEstado.DataBind()
|
||||
DdlSCEstado.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
UPComplementosSAT.Update()
|
||||
|
||||
'SI USUARIO USA AMORTIZACIÓN CONTABLE, se carga las tablas para usarlas mas adelante
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
|
||||
@@ -35909,7 +35911,14 @@ Partial Class Ventas
|
||||
|
||||
#Region " CREAR APARTIR DE "
|
||||
Protected Sub BtnCrearApartirDe_Click(sender As Object, e As System.EventArgs) Handles BtnCrearApartirDe.Click
|
||||
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||
Alert("Se va crear una nueva cotización. ¿Requiere que se actualicen a los precios actuales?", TipoMensaje.MsgDosBotones, "BtnCreaApartirDePrecioOriginal()", TextoConfirmacion:="No", TextoSegundoBoton:="Si", JSBtn2:="BtnCreaApartirDePrecioNuevo()", ShowCloseButton:=False)
|
||||
Else
|
||||
CreaAPartirDe(False)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CreaAPartirDe(Optional RecargaPrecios As Boolean = False)
|
||||
Dim FolioOriginal As String = TxtFolio.Text
|
||||
|
||||
HdnCveVenta.Value = ""
|
||||
@@ -36102,6 +36111,14 @@ Partial Class Ventas
|
||||
|
||||
GvFacturasRelacionadas.Columns(2).Visible = True
|
||||
|
||||
If RecargaPrecios Then
|
||||
Dim CvePrecioListaSugerido As Integer = Me.CvePrecioListaCliente
|
||||
If CvePrecioListaSugerido <= 0 Then
|
||||
CvePrecioListaSugerido = GlobalDTPrecioListas(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "Predeterminada = 'True'").ToEntero()
|
||||
End If
|
||||
RecalculaPrecios(False, AplicarPromociones:=False, AplicarDescuentoGlobal:=False, CvePrecioListaSugerido:=CvePrecioListaSugerido)
|
||||
End If
|
||||
|
||||
CalculaTotalesVenta()
|
||||
|
||||
Dim PorcentajeRetIVA = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100)
|
||||
@@ -36169,6 +36186,7 @@ Partial Class Ventas
|
||||
UpFacturasRelacionadas.Update()
|
||||
UpEmitirTransitorio.Update()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region " GENERAR FACTURA "
|
||||
@@ -41133,7 +41151,7 @@ Partial Class Ventas
|
||||
RegistraScript("MuestraAnticipos();", "AE")
|
||||
End Sub
|
||||
|
||||
Private Sub RecalculaPrecios(ByRef RecalculoPromociones As Boolean, Optional AplicarPromociones As Boolean = False, Optional AplicarDescuentoGlobal As Boolean = False)
|
||||
Private Sub RecalculaPrecios(ByRef RecalculoPromociones As Boolean, Optional AplicarPromociones As Boolean = False, Optional AplicarDescuentoGlobal As Boolean = False, Optional CvePrecioListaSugerido As Integer = -1)
|
||||
Dim PuedeRecalcular As Boolean = False
|
||||
|
||||
Dim DescuentoManual As Decimal = 0, DescuentoPorcentaje As Decimal = 0
|
||||
@@ -41168,8 +41186,6 @@ Partial Class Ventas
|
||||
Dim CodigoPS As String = Row("CodigoPS").ToString()
|
||||
Dim PUOriginal As Decimal = Row("PU").ToString().ToDecimal()
|
||||
|
||||
Dim CvePrecioListaSugerido As Integer = -1
|
||||
|
||||
Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = Nothing
|
||||
|
||||
If AplicarPromociones OrElse AplicarDescuentoGlobal Then
|
||||
@@ -41177,7 +41193,7 @@ Partial Class Ventas
|
||||
ObjPrecioSugerido.PrecioSugerido = PUOriginal
|
||||
ObjPrecioSugerido.CvePrecioLista = Row("CvePrecioLista").ToString().ToEntero()
|
||||
Else
|
||||
ObjPrecioSugerido = CalculaPrecioSugerido(CvePS, CveClasificacion)
|
||||
ObjPrecioSugerido = CalculaPrecioSugerido(CvePS, CveClasificacion, CvePrecioListaSugerido:=CvePrecioListaSugerido)
|
||||
End If
|
||||
|
||||
If ObjPrecioSugerido.PrecioSugerido > 0 Then
|
||||
@@ -42041,6 +42057,7 @@ Partial Class Ventas
|
||||
Where row.RowType = DataControlRowType.DataRow
|
||||
Select New With
|
||||
{
|
||||
.CveVentaDetalle = row.DataKey("CveVentaDetalle").ToEntero(),
|
||||
.Codigo = row.DataKey("Codigo").Trim(),
|
||||
.NumeroParte = row.DataKey("NumeroParte").Trim(),
|
||||
.Descripcion = row.DataKey("PS").Trim(),
|
||||
@@ -42049,13 +42066,32 @@ Partial Class Ventas
|
||||
.Precio = row.FCLiteral("LtlPU").Text.Trim().ToDecimal(),
|
||||
.SubImporte = row.DataKey("TotalImporte").ToDecimal(),
|
||||
.MargenUtilidad = row.FCLabel("LblCostoPorcentaje").Text.Replace("%", "").Replace(" ", "").Trim().ToDecimal(),
|
||||
.UltimoCosto = row.FCLabel("LblCosto").Text.Trim().ToDecimal()
|
||||
.UltimoCosto = row.FCLabel("LblCosto").Text.Trim().ToDecimal(),
|
||||
.PL1 = 0D,
|
||||
.PL2 = 0D
|
||||
}).QueryToDataTable(True)
|
||||
If DtExcel.Rows.Count < 1 Then
|
||||
Alert("No hay resultados en la busqueda.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim DtPreciosLista As DataTable = Nothing
|
||||
|
||||
If UsuarioActual.CveEmpresa = 189 Then
|
||||
Dim ObjVta As New ClsVentas
|
||||
If ObjVta.GetVentaDetallePreciosLista(Me.CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
DtPreciosLista = ObjVta.DtResultados.Copy()
|
||||
End If
|
||||
ObjVta.Dispose()
|
||||
|
||||
If DtPreciosLista IsNot Nothing Then
|
||||
For Each Row As DataRow In DtExcel.Rows
|
||||
Row("PL1") = DtPreciosLista.FiltroPrimeroValor("PL1", $"CveVentaDetalle={Row("CveVentaDetalle")}").ToDecimal()
|
||||
Row("PL2") = DtPreciosLista.FiltroPrimeroValor("PL2", $"CveVentaDetalle={Row("CveVentaDetalle")}").ToDecimal()
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim folio = LblSerie.Text + "-" + TxtFolio.Text
|
||||
|
||||
|
||||
@@ -42069,6 +42105,9 @@ Partial Class Ventas
|
||||
DtExcel.Columns("MargenUtilidad").ColumnName = "Margen de utilidad"
|
||||
DtExcel.Columns("UltimoCosto").ColumnName = "Último costo"
|
||||
|
||||
'QUITAR COLUMNA DE VENTA DETALLE, EL USUARIO NO DEBE VERLA
|
||||
DtExcel.Columns.Remove("CveVentaDetalle")
|
||||
|
||||
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||
|
||||
Dim FileExcel As New ExcelFile()
|
||||
@@ -42093,6 +42132,10 @@ Partial Class Ventas
|
||||
worksheet.Columns(7).Style.NumberFormat = "#,##0.00"
|
||||
'ULTIMO COSTO
|
||||
worksheet.Columns(8).Style.NumberFormat = "$#,##0.00_);($#,##0.00)"
|
||||
'PL1
|
||||
worksheet.Columns(9).Style.NumberFormat = "$#,##0.00_);($#,##0.00)"
|
||||
'PL2
|
||||
worksheet.Columns(10).Style.NumberFormat = "$#,##0.00_);($#,##0.00)"
|
||||
|
||||
Dim columnCount As Integer = worksheet.CalculateMaxUsedColumns()
|
||||
For i As Integer = 0 To columnCount
|
||||
@@ -42101,5 +42144,14 @@ Partial Class Ventas
|
||||
|
||||
FileExcel.Save(Response, $"{folio}.xlsx", SaveOptions.XlsxDefault)
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnCreaApartirDePrecioOriginal_Click(sender As Object, e As EventArgs)
|
||||
CreaAPartirDe(RecargaPrecios:=False)
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnCreaApartirDePrecioNuevo_Click(sender As Object, e As EventArgs)
|
||||
CreaAPartirDe(RecargaPrecios:=True)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user