This commit is contained in:
@@ -76,6 +76,7 @@
|
||||
<asp:BoundField DataField="TipoAutorizacionTexto" HeaderText="Tipo" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
|
||||
<asp:BoundField DataField="DiasVencidos" ItemStyle-Width="5%" HeaderText="Dias Vencidos" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:N0}" />
|
||||
<asp:BoundField DataField="TipoDocumento" HeaderText="Tipo" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
<asp:HyperLinkField DataTextField="FacturaAplicada" Target="_blank" HeaderText="Factura" DataNavigateUrlFields="CveVentaAplicada" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%">
|
||||
<ItemTemplate>
|
||||
|
||||
@@ -64,7 +64,7 @@ Partial Class Ventas_CatAutorizacionLimites
|
||||
UpModal.Update()
|
||||
End Sub
|
||||
Private Sub CargaDatos()
|
||||
Dim CveCliente As Integer = -1
|
||||
Dim CveCliente As Integer = -1
|
||||
If DdlClienteFiltro.SelectedValue.ToEntero() <= 0 Then
|
||||
CveCliente = -1
|
||||
Else
|
||||
|
||||
@@ -568,12 +568,12 @@ Partial Class PV
|
||||
ViewState("Modalidad") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property Index As Integer
|
||||
Private Property GvPSRowIndexEdit As Integer
|
||||
Get
|
||||
Return ViewState("Index").ToString.ToEntero
|
||||
Return ViewState("GvPSRowIndexEdit").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("Index") = value
|
||||
ViewState("GvPSRowIndexEdit") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveVentaDetalle As Integer
|
||||
@@ -1095,7 +1095,7 @@ Partial Class PV
|
||||
DtPUFacturas = New DataTable
|
||||
|
||||
Modalidad = ""
|
||||
Index = -1
|
||||
GvPSRowIndexEdit = -1
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
ChkAjuste.Visible = True
|
||||
@@ -3793,7 +3793,7 @@ Partial Class PV
|
||||
Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33
|
||||
Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33
|
||||
Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT
|
||||
Timbre.Comprobante.Subtotal = Obj.SubTotal
|
||||
Timbre.Comprobante.SubTotal = Obj.SubTotal
|
||||
Timbre.Comprobante.Descuentos = Obj.Descuento
|
||||
Timbre.Comprobante.Moneda = Obj.MonedaSAT
|
||||
Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString)
|
||||
@@ -4008,20 +4008,20 @@ Partial Class PV
|
||||
DdlUnidadMedida.SelectedValueExist(drPS("CveUnidadMedida").ToString)
|
||||
|
||||
'SUGIERE PRECIO
|
||||
Dim PrecioSugerido = 0.0
|
||||
PrecioSugerido = drPS("Precio").ToString.ToDouble
|
||||
Dim PrecioSugerido As Decimal = 0
|
||||
PrecioSugerido = drPS("Precio").ToString.ToDecimal
|
||||
If UsuarioActual.CveEmpresa.Contiene(80, 119) Then
|
||||
Dim CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("CvePrecioLista", $"CveCliente = {CveCliente}").ToEntero
|
||||
If CvePrecioListaPS > 0 Then
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSParametro) Then
|
||||
|
||||
PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDouble
|
||||
PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDecimal
|
||||
If PrecioSugerido = 0 Then
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
Dim CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero)
|
||||
ObjInventarios.Dispose()
|
||||
Dim PorcentajePrecio = ObjPS.DtResultados.FiltroPrimeroValor("Porcentaje").ToDouble
|
||||
Dim PorcentajePrecio = ObjPS.DtResultados.FiltroPrimeroValor("Porcentaje").ToDecimal
|
||||
If CostoPS > 0 And PorcentajePrecio > 0 Then
|
||||
PrecioSugerido = ((PorcentajePrecio / 100) + 1) * CostoPS
|
||||
End If
|
||||
@@ -4034,7 +4034,7 @@ Partial Class PV
|
||||
If UsuarioActual.CveEmpresa.Contiene(1) Then
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
If ObjPS.GetPorcentajeProductos(CveCliente) Then
|
||||
Dim PrecioAplicado = ObjPS.DtResultados.FiltraParametros($"CvePS = {CvePSParametro}").FiltroPrimeroValor("PrecioA").ToDouble
|
||||
Dim PrecioAplicado As Decimal = ObjPS.DtResultados.FiltraParametros($"CvePS = {CvePSParametro}").FiltroPrimeroValor("PrecioA").ToDecimal
|
||||
If PrecioAplicado > 0 Then
|
||||
PrecioSugerido = PrecioAplicado
|
||||
End If
|
||||
@@ -4046,7 +4046,7 @@ Partial Class PV
|
||||
Dim TipoPrecioLista As Integer = UsuarioActual.Empresa.Funcionalidad(404).ToEntero
|
||||
' si es 10. primero el cliente
|
||||
Dim CvePrecioListaPS As Integer
|
||||
Dim PorcentajePrecio As Double = 0
|
||||
Dim PorcentajePrecio As Decimal = 0
|
||||
|
||||
If TipoPrecioLista = 10 Then
|
||||
CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("CvePrecioLista").ToEntero()
|
||||
@@ -4063,15 +4063,15 @@ Partial Class PV
|
||||
If CvePrecioListaPS > 0 Then
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSParametro) Then
|
||||
PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDouble
|
||||
PorcentajePrecio = ObjPS.DtResultados.FiltroPrimeroValor("Porcentaje").ToDouble
|
||||
PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDecimal
|
||||
PorcentajePrecio = ObjPS.DtResultados.FiltroPrimeroValor("Porcentaje").ToDecimal
|
||||
End If
|
||||
ObjPS.Dispose()
|
||||
End If
|
||||
|
||||
If PrecioSugerido = 0 Then
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
Dim CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1)
|
||||
Dim CostoPS As Decimal = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1)
|
||||
'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal
|
||||
If CostoPS = 0 Then CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1)
|
||||
ObjInventarios.Dispose()
|
||||
@@ -4124,9 +4124,13 @@ Partial Class PV
|
||||
|
||||
End If
|
||||
'Descuento por clasificación
|
||||
If drPS("CveClasificacion").ToString.ToEntero.Contiene(20516, 20515) Then
|
||||
TxtDescuento.Text = (PrecioSugerido * ClasificacionesDescuentos(drPS("CveClasificacion").ToString.ToEntero)).ToString("F2")
|
||||
Dim ObjDescuento As New Descuentos
|
||||
|
||||
ObjDescuento = CalcularDescuentos(CvePSParametro, TxtCantidad.Text.Trim.ToDecimal, PrecioSugerido)
|
||||
If ObjDescuento.EsPUModificado Then
|
||||
PrecioSugerido = ObjDescuento.PU
|
||||
End If
|
||||
TxtDescuento.Text = ObjDescuento.ImporteDescuento.ToString("N2")
|
||||
|
||||
HdnDescuentoOriginal.Value = TxtDescuento.Text.ToDecimal().ToString()
|
||||
LblDescuentoIncluido.Text = TxtDescuento.Text.ToDecimal().FormatoNumero(2)
|
||||
@@ -4317,6 +4321,15 @@ Partial Class PV
|
||||
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
If DrPS("CveClasificacion").ToString.ToEntero.Contiene(20516, 20515) Then
|
||||
Descuento = PU * ClasificacionesDescuentos(DrPS("CveClasificacion").ToString.ToEntero)
|
||||
End If
|
||||
End If
|
||||
|
||||
''condicion final, si es cambio de Vigencia, no aplica descuento
|
||||
If DrPS("CveClasificacion").ToString.ToEntero.Contiene(20637) Then
|
||||
Descuento = 0
|
||||
End If
|
||||
|
||||
ObjDescuento.ImporteDescuento = Descuento
|
||||
@@ -4785,13 +4798,7 @@ Partial Class PV
|
||||
ElseIf Modalidad = "U" Then
|
||||
Dim Contador As Integer = 0
|
||||
If CveVentaDetalle <= 0 Then
|
||||
For Each Dr As DataRow In TmpDT.Rows
|
||||
If Dr("Consec").ToString.ToEntero = Index Then
|
||||
Exit For
|
||||
End If
|
||||
Contador = Contador + 1
|
||||
Next
|
||||
Row = TmpDT.Rows(Contador)
|
||||
Row = TmpDT.Rows(GvPSRowIndexEdit)
|
||||
Else
|
||||
Row = TmpDT.Select($"CveVentaDetalle={CveVentaDetalle}")(0)
|
||||
End If
|
||||
@@ -4859,9 +4866,9 @@ Partial Class PV
|
||||
Row("ClaveSATUnidadAduanaDescripcion") = DrPS("ClaveSATUnidadAduanaDescripcion")
|
||||
|
||||
If Modalidad = "A" Then
|
||||
Row("Consec") = TmpDT.Rows.Count + 1
|
||||
Row("Consec") = TmpDT.MAX("Consec").ToEntero() + 1
|
||||
If Not EsCargo Then
|
||||
ConsecutivoVenta = TmpDT.Rows.Count + 1
|
||||
ConsecutivoVenta = TmpDT.MAX("Consec").ToEntero() + 1
|
||||
End If
|
||||
ElseIf Modalidad = "U" Then
|
||||
If Not EsCargo Then
|
||||
@@ -5201,10 +5208,10 @@ Partial Class PV
|
||||
Public Sub Edit_Click(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
Modalidad = "U"
|
||||
Index = GvRow.DataKey("Consec").ToEntero
|
||||
GvPSRowIndexEdit = GvRow.RowIndex
|
||||
ConsecutivoVenta = GvRow.DataKey("Consec").ToEntero
|
||||
CveVentaDetalle = GvRow.DataKey("CveVentaDetalle").ToEntero
|
||||
|
||||
Dim EsCargo = CBool(GvRow.DataKey("EsCargo"))
|
||||
LnkAgregarPS.Text = "Actualizar"
|
||||
DdlClasificacion.SelectedValueExist(GvRow.DataKey("CveClasificacion"))
|
||||
CargaPS(DdlClasificacion.SelectedValue.ToEntero, DdlPS)
|
||||
@@ -5249,7 +5256,27 @@ Partial Class PV
|
||||
Ajuste()
|
||||
AddPolizaVirtual(DdlPS.SelectedValue.ToEntero())
|
||||
|
||||
'BUSCA EN TMPDT LOS DATOS DE USADOS
|
||||
If TmpDT.Rows.Count > 0 AndAlso TmpDTRecepcionUsados IsNot Nothing AndAlso TmpDTRecepcionUsados.Rows.Count > 0 Then
|
||||
If Not EsCargo Then
|
||||
Dim RowUsado As DataRow = TmpDTRecepcionUsados.Select($"ConsecRelacionado={ConsecutivoVenta}").FirstOrDefault()
|
||||
If RowUsado IsNot Nothing Then
|
||||
DdlRecepcionUsados.SelectedValueExist(RowUsado("CvePS"))
|
||||
DdlRecepcionUsados_SelectedIndexChanged(DdlRecepcionUsados, EventArgs.Empty)
|
||||
|
||||
DdlBCIUsado.SelectedValueExist(RowUsado("CveBCIUsado"))
|
||||
DdlModeloAuto.SelectedValueExist(RowUsado("CveModeloAuto"))
|
||||
|
||||
TxtAnioVehiculo.Text = RowUsado("AnioVehiculo").ToString()
|
||||
TxtFechaVigencia.Text = RowUsado("FechaUsado").ToString().ToDate().ToString("dd/MM/yyyy")
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
UpVenta.Update()
|
||||
UpAddVenta.Update()
|
||||
|
||||
RegistraScript("$('#DivAddVenta').modal({backdrop: 'static', keyboard: false});", "EdicionVenta")
|
||||
End Sub
|
||||
Protected Sub LnkAgregarPS_Click(sender As Object, e As EventArgs)
|
||||
@@ -6906,7 +6933,7 @@ Partial Class PV
|
||||
Dim Contador As Integer = 1
|
||||
Dim PUFactura As Decimal = 0
|
||||
For Each Dr As DataRow In DtPUFacturas.Rows
|
||||
If Index = Contador Then
|
||||
If GvPSRowIndexEdit = Contador Then
|
||||
PUFactura = Dr("PU").ToString.ToDecimal
|
||||
End If
|
||||
Contador += 1
|
||||
@@ -7337,7 +7364,7 @@ Partial Class PV
|
||||
End If
|
||||
Next
|
||||
If Elimino Then
|
||||
TmpDTRecepcionUsados.AcceptChanges()
|
||||
TmpDTPolizaVirtual.AcceptChanges()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -7424,12 +7451,15 @@ Partial Class PV
|
||||
TmpDTRecepcionUsados = New DataTable
|
||||
TmpDTRecepcionUsados.Columns.Add("CvePS", GetType(Integer))
|
||||
TmpDTRecepcionUsados.Columns.Add("CvePSRelacionado", GetType(Integer))
|
||||
TmpDTRecepcionUsados.Columns.Add("ConsecRelacionado", GetType(Integer))
|
||||
TmpDTRecepcionUsados.Columns.Add("Cantidad", GetType(Decimal))
|
||||
TmpDTRecepcionUsados.Columns.Add("AnioVehiculo", GetType(String))
|
||||
TmpDTRecepcionUsados.Columns.Add("CveUM", GetType(Integer))
|
||||
TmpDTRecepcionUsados.Columns.Add("CveVentaDetalle", GetType(Integer))
|
||||
TmpDTRecepcionUsados.Columns.Add("PU", GetType(Double))
|
||||
TmpDTRecepcionUsados.Columns.Add("CveBCIUsado", GetType(Integer))
|
||||
TmpDTRecepcionUsados.Columns.Add("CveModeloAuto", GetType(Integer))
|
||||
TmpDTRecepcionUsados.Columns.Add("FechaUsado", GetType(DateTime))
|
||||
TmpDTRecepcionUsados.Columns.Add("EliminarDB", GetType(Boolean))
|
||||
TmpDTRecepcionUsados.Columns("EliminarDB").DefaultValue = False
|
||||
End Sub
|
||||
@@ -7503,6 +7533,10 @@ Partial Class PV
|
||||
Row("PU") = DrTamanio("Cargo").ToString().ToDecimal
|
||||
Row("CveBCIUsado") = DdlBCIUsado.SelectedValue.ToEntero
|
||||
Row("CveModeloAuto") = DdlModeloAuto.SelectedValue.ToEntero
|
||||
Row("ConsecRelacionado") = ConsecPSPadre
|
||||
Row("FechaUsado") = TxtFechaVigencia.Text.ToDateTime()
|
||||
Row("AnioVehiculo") = TxtAnioVehiculo.Text
|
||||
|
||||
TmpDTRecepcionUsados.Rows.Add(Row)
|
||||
|
||||
End If
|
||||
|
||||
@@ -105,18 +105,18 @@
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
<div class="row">
|
||||
<div class="form-group form-md-line-input input-iconright col-xs-3">
|
||||
<div class="form-group form-md-line-input input-iconright col-xs-4">
|
||||
<asp:TextBox ID="TxtCodigo" CssClass="form-control " runat="server" MaxLength="50"></asp:TextBox>
|
||||
<label class="truncate" style="padding-left: 16px;" for="<%= TxtCodigo.ClientID.ToString()%>">Número de Parte / Código:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright col-xs-3">
|
||||
<div class="form-group form-md-line-input input-iconright col-xs-4">
|
||||
<asp:TextBox ID="TxtCodigoBarras" CssClass="form-control " runat="server" MaxLength="50"></asp:TextBox>
|
||||
<label class="truncate" style="padding-left: 16px;" for="<%= TxtCodigoBarras.ClientID.ToString()%>">Código Barras:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright col-xs-3" id="divCodigo2" runat="server" visible ="false">
|
||||
<div class="form-group form-md-line-input input-iconright col-xs-4" id="divCodigo2" runat="server" visible ="false">
|
||||
<asp:TextBox ID="TxtCodigo2" CssClass="form-control " runat="server" MaxLength="50" ></asp:TextBox>
|
||||
<label class="truncate" style="padding-left: 16px;" for="<%= TxtCodigo2.ClientID.ToString()%>">Código CPK:</label>
|
||||
<i></i>
|
||||
@@ -263,6 +263,12 @@
|
||||
<label class="truncate" style="padding-left: 16px;" for="<%= TxtVentaMinima.ClientID.ToString()%>">Venta Mínima:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright col-xs-3" id="divLitraje" visible="false" runat="server">
|
||||
<asp:TextBox ID="TxtLitraje" CssClass="form-control " runat="server" ReadOnly="true"></asp:TextBox>
|
||||
<%--<ajax:FilteredTextBoxExtender ID="FTBETVentaMinima" TargetControlID="TxtVentaMinima" FilterType="Numbers" runat="server" ValidChars=".," />--%>
|
||||
<label class="truncate" style="padding-left: 16px;" for="<%= TxtLitraje.ClientID.ToString()%>">Litraje:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
|
||||
@@ -245,6 +245,8 @@ Partial Class ProductosyServicios
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
DivPSAdicionalVigencia.Visible = True
|
||||
divCodigo2.Visible = True
|
||||
divLitraje.Visible = True
|
||||
|
||||
CargaPSAdicionalesVigencias()
|
||||
End If
|
||||
|
||||
@@ -846,6 +848,7 @@ Partial Class ProductosyServicios
|
||||
TxtCodigo2.Text = ObjProductosServicios.Codigo2
|
||||
TxtCodigoBarras.Text = ObjProductosServicios.CodigoBarras
|
||||
CodigoBarrasCargado = ObjProductosServicios.CodigoBarras
|
||||
TxtLitraje.Text = ObjProductosServicios.DtResultados.Rows(0)("Litraje").ToString
|
||||
|
||||
TxtPS.Text = ObjProductosServicios.PS
|
||||
TxtPrecio.Text = ObjProductosServicios.Precio.ToString("F4") 'no usa N4, porque pone comma
|
||||
|
||||
@@ -319,6 +319,16 @@
|
||||
<asp:ListItem Text="Venta Mostrador" Value="2"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1 truncate" id="divgarantia1" runat="server" visible="false">
|
||||
Garantía?:
|
||||
</div>
|
||||
<div class="col-md-2" id="divgarantia2" runat="server" visible="false">
|
||||
<asp:Dropdownlist runat="server" ID="DdlGarantia" CssStyle="width: 100%;" CssClass="form-control input-small input-sm select2me" Width="100%">
|
||||
<asp:ListItem Text="Todos" Value="-1" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Text="Si" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="No" Value="0"></asp:ListItem>
|
||||
</asp:Dropdownlist>
|
||||
</div>
|
||||
<label class="col-md-1 truncate">Lectura administrativa:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:CheckBox ID="ChkLecturaAdmin" runat="server" Checked="false" CssClass="input-sm" />
|
||||
|
||||
@@ -65,6 +65,9 @@ Partial Class Ventas_RepProductosServicios
|
||||
If UsuarioActual.Empresa.Funcionalidad(531).ToEntero = 1 Then
|
||||
LblLitraje.Visible = True
|
||||
DvLitraje.Visible = True
|
||||
'garantia
|
||||
divgarantia1.Visible = True
|
||||
divgarantia2.Visible = True
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -275,7 +278,7 @@ Partial Class Ventas_RepProductosServicios
|
||||
DdlSubProyectoEjecucion.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, "-1",
|
||||
UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoDocto:=TipoComprobante,
|
||||
CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, TipoCambio:=TipoCambio, TCEspecifico:=TCEspecifico, CveProveedorCompra:=CveProveedorCompra,
|
||||
CveMarca:=DdlMarcaPSDes.SelectedValue.ToEntero, MostrarLitraje:=ChkLitraje.Checked, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, ModalidadContable:=ModalidadContable) Then
|
||||
CveMarca:=DdlMarcaPSDes.SelectedValue.ToEntero, MostrarLitraje:=ChkLitraje.Checked, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, EsGarantia:=DdlGarantia.SelectedValue.ToEntero, ModalidadContable:=ModalidadContable) Then
|
||||
GvDatos.DataSource = ObjVentas.DtResultados
|
||||
DtVentas = ObjVentas.DtResultados
|
||||
Else
|
||||
|
||||
@@ -305,7 +305,7 @@ Partial Class Ventas_RepProductosServiciosDetalle
|
||||
|
||||
CveCliente = If(Request("CveCliente") IsNot Nothing AndAlso Request("CveCliente").ToEntero() > 0, Request("CveCliente").ToEntero(), -1).ToString.ToEntero
|
||||
CveSubProyectoEjecucion = If(Request("CveSubProyectoEjecucion") IsNot Nothing AndAlso Request("CveSubProyectoEjecucion").ToEntero() > 0, Request("CveSubProyectoEjecucion").ToEntero(), -1).ToString
|
||||
CveVendedor = If(Request("CveVendedor") IsNot Nothing AndAlso Request("CveVendedor").ToEntero() > 0, Request("CveVendedor").ToEntero(), -1).ToString.ToEntero
|
||||
CveVendedor = If(Request("CveVendedor") IsNot Nothing AndAlso Request("CveVendedor").ToEntero() >= 0, Request("CveVendedor").ToEntero(), -1).ToString.ToEntero
|
||||
CveEstatus = If(Request("CveEstatus") IsNot Nothing AndAlso Request("CveEstatus").ToEntero() > 0, Request("CveEstatus").ToEntero(), -1).ToString
|
||||
CveUsuario = If(Request("CveUsuario") IsNot Nothing AndAlso Request("CveUsuario").ToEntero() > 0, Request("CveUsuario").ToEntero(), -1).ToString
|
||||
TipoDocto = If(Request("TipoDocto") IsNot Nothing AndAlso Request("TipoDocto").ToString() <> "-1", Request("TipoDocto").ToString(), "-1").ToString
|
||||
@@ -421,6 +421,7 @@ Partial Class Ventas_RepProductosServiciosDetalle
|
||||
|
||||
'DdlClientes.SelectedValueExist(CveCliente)
|
||||
DdlSubProyectoEjecucion.SelectedValueExist(CveSubProyectoEjecucion)
|
||||
If CveVendedor = 0 Then DdlVendedor.Items.Insert(0, New ListItem("Sin Asignar", "0"))
|
||||
DdlVendedor.SelectedValueExist(CveVendedor)
|
||||
DdlUsuario.SelectedValueExist(CveUsuario)
|
||||
DdlTipoComprobante.SelectedValuesIfExistM(TipoDocto)
|
||||
|
||||
@@ -179,7 +179,7 @@
|
||||
<asp:Dropdownlist runat="server" ID="DdlMarcas" CssStyle="width: 100%;" CssClass="form-control input-small input-sm select2me" Width="100%" DataTextField="Marca" DataValueField="CveMarca" />
|
||||
</div>
|
||||
<div class="col-md-1 truncate" id="divgarantia1" runat="server" visible="false">
|
||||
Garantía:
|
||||
Garantía?:
|
||||
</div>
|
||||
<div class="col-md-2" id="divgarantia2" runat="server" visible="false">
|
||||
<asp:Dropdownlist runat="server" ID="DdlGarantia" CssStyle="width: 100%;" CssClass="form-control input-small input-sm select2me" Width="100%">
|
||||
|
||||
@@ -6427,17 +6427,20 @@
|
||||
<asp:RequiredFieldValidator ID="RFVNCPS" runat="server" InitialValue="-1" ControlToValidate="DdlNCPS" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModalAplicarNC"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCENCPS" runat="server" HighlightCssClass="vco" TargetControlID="RFVNCPS" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-3">
|
||||
<asp:Label ID="LblNCSaldoAnticipo" runat="server" Text=""></asp:Label>
|
||||
<asp:CheckBox ID="ChkAplicaNCAnticipo" runat="server" Text="Aplicar a Anticipo" Visible="false" />
|
||||
</div>
|
||||
<div class="col-md-3" id="DivBtnRemNC" runat="server" visible="false" >
|
||||
<asp:Button ID="BtnModalAplicarRemisionesNC" Text="Aplicar Remisiones" runat="server" OnClick="BtnModalAplicarRemisionesNC_Click" class="btn btn-primary" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col-md-2">
|
||||
Observaciones:
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<asp:TextBox ID="TxtNCObservaciones" Text="" Rows="3" TextMode="MultiLine" CssClass="Widthall form-control input-sm" runat="server" />
|
||||
<asp:TextBox ID="TxtNCObservaciones" Text="" Rows="2" TextMode="MultiLine" CssClass="Widthall form-control input-sm" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
@@ -6488,22 +6491,12 @@
|
||||
<asp:RangeValidator ID="RVNCPorcentaje" runat="server" Type="Double" MinimumValue="0.01" MaximumValue="100.00" ErrorMessage="El campo <b>''Porcentaje''</b> debe estar entre 1 y el porcentaje máximo de la factura(Saldo)." ControlToValidate="TxtNCPorcentaje" Display="None" ValidationGroup="GrpModalAplicarNC"></asp:RangeValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCENCPorcentaje" runat="server" HighlightCssClass="vco" TargetControlID="RVNCPorcentaje" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div id="DivBtnRemNC" runat="server" visible="false" class="row form-group">
|
||||
<div class="col-md-2">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:Button ID="BtnModalAplicarRemisionesNC" Text="Aplicar Remisiones" runat="server" OnClick="BtnModalAplicarRemisionesNC_Click" class="btn btn-primary" />
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
|
||||
</div>
|
||||
<div class="row" style="margin-right: 10px; margin-top: 5px;" align="right">
|
||||
<input type="text" id="TxtBusqueda10" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda10','{0}')", GvCxC.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda10','{0}')", GvCxC.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<div class="row" id="DivGvCxC" style="max-height: 10px" runat="server" visible="false">
|
||||
<br />
|
||||
<div class="row" id="DivGvCxC" style="max-height: 5px" runat="server" visible="false">
|
||||
<div class="col-md-12" style="height: 440px; overflow: auto">
|
||||
<asp:GridView ID="GvCxC" runat="server" AutoGenerateColumns="False" OnRowDataBound="GvCxC_RowDataBound"
|
||||
DataKeyNames="CveVenta,CveMetodoPago33,CveFormaPago33" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
|
||||
|
||||
@@ -6614,7 +6614,7 @@ Partial Class Ventas
|
||||
'RMF. validacion temporal
|
||||
'verifica si tiene autorizaciones de Nota de crédito autorizadas
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, -1, CveEstatus:=1) Then
|
||||
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, -1, "Ing", CveEstatus:=1) Then
|
||||
Dim RowAutorizacion As DataRow = ObjVentas.DtResultados.FiltroPrimero($"CveVenta IS NULL AND CveTipoDocumento='Egs'", Orderby:="TipoAutorizacion")
|
||||
If RowAutorizacion IsNot Nothing Then
|
||||
DdlTipoComprobante.SelectedValueExistInsert("Egs", "Egresos")
|
||||
@@ -7957,7 +7957,7 @@ Partial Class Ventas
|
||||
Dim CveVendedor As Integer = DdlVendedor.SelectedValue.ToEntero()
|
||||
Dim ObjVentas As New ClsVentas
|
||||
Try
|
||||
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, CveVendedor, CveEstatus:=1) Then
|
||||
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, CveVendedor, DdlTipoDocto.SelectedValue, CveEstatus:=1) Then
|
||||
Dim RowAutorizacion As DataRow = Nothing
|
||||
'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO
|
||||
If TieneDiasVencidos Then
|
||||
@@ -8312,11 +8312,11 @@ Partial Class Ventas
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If ValidaPagosContado() Then
|
||||
If ValidaPagosContado(TipoDoctoViejo:=TipoDoctoViejo) Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
CreaObjetosVenta()
|
||||
CreaObjetosVenta(TipoDoctoViejo:=TipoDoctoViejo)
|
||||
|
||||
'Verifica versión 3.3.()
|
||||
If ObjFactura.Version = "3.3" AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("Ped", "PeC") Then
|
||||
@@ -9733,6 +9733,8 @@ Partial Class Ventas
|
||||
|
||||
If NCDescuento Then
|
||||
|
||||
factura.Num3 = 1000 ' MARCADA PARA AUMENTAR EL FOLIO
|
||||
|
||||
If DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0 Then
|
||||
DtVentasNC.Rows(IndexNC)("Importe") = factura.Total
|
||||
DtVentasNC.Rows(IndexNC)("TC") = factura.TipoCambio
|
||||
@@ -9893,7 +9895,7 @@ Partial Class Ventas
|
||||
End Function
|
||||
|
||||
|
||||
Private Sub CreaObjetosVenta(Optional VistaPrevia As Boolean = False, Optional EsCancelacion As Boolean = False)
|
||||
Private Sub CreaObjetosVenta(Optional VistaPrevia As Boolean = False, Optional EsCancelacion As Boolean = False, Optional TipoDoctoViejo As String = "")
|
||||
|
||||
If Me.CveVenta > 0 AndAlso NuevaFactura <> 1 Then
|
||||
ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=EsCancelacion)
|
||||
@@ -9923,6 +9925,11 @@ Partial Class Ventas
|
||||
'si es cancelacion, debe de conservar el folio actual
|
||||
If Not EsCancelacion Then ObjFactura.Folio = If(EstablecioFolio Or VistaPrevia Or (CveVenta > 0 And (NuevaFactura.Contiene(0, 2))), TxtFolio.Text.Trim.ToEntero(), -1)
|
||||
|
||||
'SI ES FACTURACION DE REMISION O COTIZACION NO TOMAR EL FOLIO QUE SE MUESTRA
|
||||
If Not EsCancelacion AndAlso ObjFactura.Folio > 0 AndAlso TipoDoctoViejo.Contiene("Rem", "Cot") Then
|
||||
ObjFactura.Folio = -1
|
||||
End If
|
||||
|
||||
'ObjFactura.Folio = If(ExFolioFactura, FolioXML.ToEntero(), -1)
|
||||
ObjFactura.Serie = If(VistaPrevia, "VistaPrevia", LblSerie.Text)
|
||||
|
||||
@@ -10712,6 +10719,7 @@ Partial Class Ventas
|
||||
ObjFacturaDevolucion.Num1 = TxtNum1.Text.Trim.ToDouble
|
||||
ObjFacturaDevolucion.Num2 = TxtNum2.Text.Trim.ToDouble
|
||||
ObjFacturaDevolucion.Num3 = If(ObjFacturaDevolucion.TipoDocto = "OP", DdlOrdenPago.SelectedValue.ToDouble, TxtNum3.Text.Trim.ToDouble)
|
||||
|
||||
ObjFacturaDevolucion.FechaPago = TxtFechaPago.Text.ToDate
|
||||
|
||||
ObjFacturaDevolucion.CveCorte = CveCorte
|
||||
@@ -11764,15 +11772,15 @@ Partial Class Ventas
|
||||
Exit For
|
||||
Else
|
||||
'VERIFICAR QUE EL DESCUENTO NO PASE EL 40%
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso Row("CveClasificacion").ToString().ToEntero() <> 20519 AndAlso (Not Row("Obs").ToString().Contains("Descuento por garantía")) Then
|
||||
Dim TotalDetalle = Math.Round((Row("Total").ToString().ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)) * (1 + Row("PorcentajeIVA").ToString().ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)))), 6)
|
||||
Dim DescuentoDetalle = Row("Descuento").ToString().ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1))
|
||||
Dim PorcentajeDescuento As Double = (DescuentoDetalle / TotalDetalle) * 100D
|
||||
If PorcentajeDescuento > 40 Then
|
||||
ErrorList.Add(String.Format("El descuento del producto/servicio {0} no puede ser mayor al 40%. Porcentaje Actual: {1}%", Row("CodigoPS"), PorcentajeDescuento.RoundSQL(2)))
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
'If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso Row("CveClasificacion").ToString().ToEntero() <> 20519 AndAlso (Not Row("Obs").ToString().Contains("Descuento por garantía")) Then
|
||||
' Dim TotalDetalle = Math.Round((Row("Total").ToString().ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)) * (1 + Row("PorcentajeIVA").ToString().ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)))), 6)
|
||||
' Dim DescuentoDetalle = Row("Descuento").ToString().ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1))
|
||||
' Dim PorcentajeDescuento As Double = (DescuentoDetalle / TotalDetalle) * 100D
|
||||
' If PorcentajeDescuento > 40 Then
|
||||
' ErrorList.Add(String.Format("El descuento del producto/servicio {0} no puede ser mayor al 40%. Porcentaje Actual: {1}%", Row("CodigoPS"), PorcentajeDescuento.RoundSQL(2)))
|
||||
' Exit For
|
||||
' End If
|
||||
'End If
|
||||
'Agregamos el gasto de contrato
|
||||
If CveContrato > 0 AndAlso factura.TipoDocto = "Rem" AndAlso AplicaGastoContrato Then
|
||||
|
||||
@@ -21614,7 +21622,7 @@ Partial Class Ventas
|
||||
Private Sub RBLPago_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RBLPago.SelectedIndexChanged
|
||||
LimpiaEscondeContado()
|
||||
End Sub
|
||||
Private Function ValidaPagosContado(Optional MostrarAlertas As Boolean = True) As Boolean
|
||||
Private Function ValidaPagosContado(Optional MostrarAlertas As Boolean = True, Optional TipoDoctoViejo As String = "") As Boolean
|
||||
Dim Retorno = False
|
||||
|
||||
Dim AmortizacionNC As Decimal = 0
|
||||
@@ -21657,7 +21665,8 @@ Partial Class Ventas
|
||||
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso RBLPago.SelectedValue = "2" AndAlso CveVenta <= 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant") Then
|
||||
'VALIDA PAGOS EN FACTURAS DE ING,ANT NUEVAS O FACTURACION DE REM O COTIZACIONES
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso RBLPago.SelectedValue = "2" AndAlso ((CveVenta <= 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant")) OrElse TipoDoctoViejo.Contiene("Rem", "Cot")) Then
|
||||
|
||||
If Not TienePagos AndAlso TxtTotal.Text.ToDecimal > 0 Then
|
||||
If MostrarAlertas Then
|
||||
@@ -26930,15 +26939,47 @@ Partial Class Ventas
|
||||
Protected Sub BtnAplicarNC_Click(sender As Object, e As EventArgs)
|
||||
'SOLO APLICA SI NO HAY DOCUMENTOS QUE SELECCIONAR
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
If GvCxC.Rows.Count = 0 OrElse GvCxC.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("ChkCxC").Checked) = 0 Then
|
||||
If ClienteEsDistribuidor AndAlso TxtImportesRemisionesNC.Text.ToDecimal() > 0 Then
|
||||
Alert("No se puede generar una nota de crédito para devolución de efectivo si el cliente es distribuidor.", TipoMensaje.MsgAdvertencia)
|
||||
|
||||
Dim Verificacion As Boolean = False
|
||||
|
||||
If ListaRemisionesNC IsNot Nothing AndAlso ListaRemisionesNC.Count > 0 Then ' si hay opciones seleccionadas, se activa el generar las NCs
|
||||
Verificacion = True
|
||||
Else
|
||||
If UsuarioActual.TienePermisoProceso(175) Then ' si es una nc, que se va a generar directa, el permiso de generar NC directas
|
||||
Verificacion = True
|
||||
Else
|
||||
Alert("No se ha seleccionado ninguna factura, en caso de no seleccionar ninguna se creará una nueva nota de crédito. ¿Está seguro de realizar esta acción?", TipoMensaje.MsgConfirmacion, JSBtnAceptar:="BtnAplicaNuevaNC();", TextoConfirmacion:=" Si ", TextoCancelacion:=" No ")
|
||||
'verificar autorizaciones
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, -1, "Egs", CveEstatus:=1) Then
|
||||
Dim RowAutorizacion As DataRow = ObjVentas.DtResultados.FiltroPrimero($"CveVenta IS NULL ", Orderby:="TipoAutorizacion")
|
||||
If RowAutorizacion IsNot Nothing Then
|
||||
Verificacion = True
|
||||
End If
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
' si es una nc, que se va a generar directa, debe de revisar que tenga una autorización, o el permiso de generar NC directas
|
||||
End If
|
||||
End If
|
||||
|
||||
If GvCxC.Rows.Count = 0 OrElse GvCxC.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("ChkCxC").Checked) = 0 Then
|
||||
If Verificacion Then
|
||||
If ClienteEsDistribuidor AndAlso TxtImportesRemisionesNC.Text.ToDecimal() > 0 Then
|
||||
Alert("No se puede generar una nota de crédito para devolución de efectivo si el cliente es distribuidor.", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
Alert("No se ha seleccionado ninguna factura, en caso de no seleccionar ninguna se creará una nueva nota de crédito. ¿Está seguro de realizar esta acción?", TipoMensaje.MsgConfirmacion, JSBtnAceptar:="BtnAplicaNuevaNC();", TextoConfirmacion:=" Si ", TextoCancelacion:=" No ")
|
||||
End If
|
||||
Else
|
||||
Alert("No se puede Generar notas de crédito directas", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
Else
|
||||
AplicarNotaCreditoDesdeVenta()
|
||||
' si viene de remisiones, puede seguir adelante
|
||||
If Verificacion Then
|
||||
AplicarNotaCreditoDesdeVenta()
|
||||
Else
|
||||
Alert("No se puede Generar notas de crédito directas", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End If
|
||||
Else
|
||||
AplicarNotaCreditoDesdeVenta()
|
||||
@@ -31534,6 +31575,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
ListaRemisionesNC.Add(RemNC)
|
||||
BtnAplicarNC.Enabled = True
|
||||
|
||||
If TerminarCiclo Then
|
||||
Exit For
|
||||
@@ -31577,6 +31619,10 @@ Partial Class Ventas
|
||||
TxtImportesRemisionesNC.Text = TotalRemNCAplicado.FormatoNumero
|
||||
'TxtNCImporte.Text = TotalRemNCAplicado.FormatoNumero
|
||||
|
||||
If ListaRemisionesNC.Count > 0 Then ' si hay opciones seleccionadas, se activa el generar las NCs
|
||||
BtnAplicarNC.Enabled = True
|
||||
End If
|
||||
|
||||
UpModalRemisionesNC.Update()
|
||||
UpAplicarNC.Update()
|
||||
|
||||
@@ -32043,7 +32089,7 @@ Partial Class Ventas
|
||||
End Sub
|
||||
Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura)
|
||||
Try
|
||||
If UsuarioActual.CveUsuario.Contiene(3033, 3491) Then
|
||||
If UsuarioActual.CveUsuario.Contiene(3491) Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
Reference in New Issue
Block a user