Merge -- PV, PopUpVerFactura

This commit is contained in:
2022-01-20 16:03:53 -07:00
42 changed files with 15664 additions and 13438 deletions

View File

@@ -2770,6 +2770,10 @@
</div>
</div>
<div class="portlet-body form">
<asp:UpdatePanel runat="server" ID="UPPDatosUsado" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-4">
<label>Tipo Servicio:</label>
@@ -2832,7 +2836,8 @@
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>

View File

@@ -34,7 +34,7 @@ Partial Class PV
Private Property FolioXML As String
Private Property SubTotal As Decimal
Private Property Total As Decimal = 0
Private Property Descuentos As Decimal = 0
'Private Property Descuentos As Decimal = 0
Private Property EmisorRFC As String
Private Property ReceptorRFC As String
Private Property TrasladoIVA As Decimal = 0
@@ -83,6 +83,15 @@ Partial Class PV
End Set
End Property
Private Property DtPorcentajeMarcas As DataTable
Get
Return If(IsNothing(ViewState("DtPorcentajeMarcas")), Nothing, CType(ViewState("DtPorcentajeMarcas"), DataTable))
End Get
Set(value As DataTable)
ViewState("DtPorcentajeMarcas") = value
End Set
End Property
Private Property RemisionesLista As List(Of Integer)
Get
Return If(IsNothing(ViewState("RemisionesLista")), Nothing, CType(ViewState("RemisionesLista"), List(Of Integer)))
@@ -2576,6 +2585,12 @@ Partial Class PV
If Not String.IsNullOrEmpty(ObjCliente.Vendedor) Then
LbVendedor.Text = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Vendedor", $"CveVendedor = {ObjCliente.Vendedor}")
End If
' si es empresa acumuladores
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
CargaPorcentajeMarcas()
End If
Else
TrEsDistribuidor.Visible = False
End If
@@ -2697,6 +2712,14 @@ Partial Class PV
UPCondicionesPago.Update()
End Sub
Private Sub CargaPorcentajeMarcas()
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPorcentajeMarcas(CveCliente) Then
DtPorcentajeMarcas = ObjPS.DtResultados.Copy()
End If
ObjPS.Dispose()
End Sub
Private Sub CambiaSucursal()
CargaFormatoSucursal()
CargaFolios()
@@ -3985,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
@@ -4011,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
@@ -4023,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()
@@ -4040,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()
@@ -4101,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)
@@ -4138,6 +4165,180 @@ Partial Class PV
UpAddVenta.Update()
UPPDescuento.Update()
End Sub
Partial Class Descuentos
Public ImporteDescuento As Decimal = 0
Public CvePromocionDetalle As Integer = -1
Public PU As Decimal = 0
Public EsPUModificado As Boolean = False
Public ImporteProntoPago As Decimal = 0
End Class
Private Function CalcularDescuentos(CvePS As Integer, Cantidad As Decimal, PU As Decimal) As Descuentos
Dim Descuento As Decimal = HdnDescuento.Value.ToDecimal
If HdnTipoDescuento.Value = "0" Then
Descuento = HdnDescuento.Value.ToDecimal * Cantidad
End If
Dim ValidaCondicionesComerciales As Boolean = True
'AGREGA PROMOCION EN EL DESCUENTO
Dim TipoPromo As Integer = 0
Dim TotalPromocion As Decimal = 0
Dim PromocionPorcentaje As Decimal = 0
Dim PUModificado As Decimal = 0
Dim SeAjustoPU As Boolean = False
Dim PUPromocion As Decimal = 0
Dim CantMinima As Integer = 0
Dim CveMarcaPS As Integer = 0
Dim CveClasifPS As Integer = 0
Dim CveRinTamañoPS As Integer = 0
Dim CvePromocionDetalle As Integer = 0
Dim IncluyeImpuestos As Boolean = False
Dim TipoAplicacion As Integer = 1 ' 1 - descuento, 2 en PU
Dim ObjDescuento As New Descuentos
If DdlSubProyectoDatos.SelectedValue = "11842" Then '' E141, el subproyecto: Franquicia, no proceden las promociones
Return ObjDescuento
End If
Dim DrPS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If DrPS IsNot Nothing Then
CveMarcaPS = DrPS("CveMarca").ToString().ToEntero()
CveClasifPS = DrPS("CveClasificacion").ToString().ToEntero()
CveRinTamañoPS = DrPS("CveRinTamaño").ToString().ToEntero()
If CveClasifPS = 20636 Then
ValidaCondicionesComerciales = False
End If
End If
Dim dr As DataRow = Nothing
If DtPromociones IsNot Nothing AndAlso DtPromociones.Rows.Count > 0 Then
dr = DtPromociones.FiltroPrimero(String.Format("CvePS = {0} AND (CveSubProyecto = {1} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {2} OR CveRinTamaño IS NULL) AND ((TipoPromocion <> 3 AND (CantidadMinima <= {3} OR CantidadMinima IS NULL)) OR (TipoPromocion = 3 AND CantidadMinima <= {3} ))", CvePS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS, Cantidad), Orderby:="CantidadMinima desc ")
If dr Is Nothing Then
'verifica marca, si tiene asignada la promocion
dr = DtPromociones.FiltroPrimero(String.Format("CvePS IS NULL AND CveClasificacion = {0} AND (CveMarca = {1} OR CveMarca IS NULL) AND (CveSubProyecto = {2} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {3} OR CveRinTamaño IS NULL) AND ((TipoPromocion <> 3 AND (CantidadMinima <= {4} OR CantidadMinima IS NULL)) OR (TipoPromocion = 3 AND CantidadMinima <= {4} )) ", CveClasifPS, CveMarcaPS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS, Cantidad), Orderby:="CantidadMinima desc")
End If
End If
Dim Cant As Integer = 1
If dr IsNot Nothing Then
TipoPromo = dr("TipoPromocion").ToString().ToEntero()
CantMinima = dr("CantidadMinima").ToString().ToEntero()
IncluyeImpuestos = dr("IncluyeImpuestos").ToString() = "True"
PromocionPorcentaje = dr("Promocion").ToString().ToDecimal
PUPromocion = dr("PUPromocion").ToString().ToDecimal
CvePromocionDetalle = dr("CvePromocionDetalle").ToString().ToEntero()
TipoAplicacion = dr("TipoAplicacion").ToString().ToEntero()
If CantMinima > 0 Then
Cant = Math.Floor(Cantidad / CantMinima).ToEntero()
End If
End If
Dim PorcentajeIVA As Decimal = ViewState("SubProyectoPorcentajeIVA").ToString.ToDecimal ''Math.Round(ViewState("SubProyectoPorcentajeIVA").ToString.ToDecimal, 2).ToDecimal
TotalPromocion = Math.Round(PUPromocion * Cant / (1 + If(IncluyeImpuestos, PorcentajeIVA, 0)), 6)
If TipoPromo = 1 Then 'Promocion por Importe $
If TipoAplicacion = 2 Then
Descuento = 0
SeAjustoPU = True
PUModificado = Math.Round(PUPromocion / (1 + If(IncluyeImpuestos, PorcentajeIVA, 0)), 6)
Else
Descuento = Descuento + PU - TotalPromocion
End If
ElseIf TipoPromo = 2 Then 'Promocion por %
Descuento = Descuento + ((PU * PromocionPorcentaje / 100) * Cantidad)
ElseIf TipoPromo = 3 Then 'Promocion por Cantidad
If Cantidad >= CantMinima Then
Descuento = Descuento + TotalPromocion
Else
CvePromocionDetalle = -1
End If
End If
'VERIFICA SI APLICAN CONDICIONES COMERCIALES
If ValidaCondicionesComerciales AndAlso DtPorcentajeMarcas IsNot Nothing AndAlso DtPorcentajeMarcas.Rows.Count > 0 Then
'VERIFICA SI EL PRODUCTO TIENE ESPECIFICADA UNA MARCA
If Not String.IsNullOrEmpty(DrPS("CveMarca").ToString()) AndAlso DrPS("CveMarca").ToString().ToEntero() > 0 Then
Dim RowPorcentaje = DtPorcentajeMarcas.FiltroPrimero($"CveMarca={DrPS("CveMarca").ToString()}")
'REALIZA LOS DESCUENTOS DE ACUERDO AL PORCENTAJE POR MARCA
If RowPorcentaje IsNot Nothing Then
'(AHORA LOS DESCUENTOS SON ACUMULABLES)
'Descuento = 0
Dim PorcentajeProducto = RowPorcentaje("PorcentajeProducto").ToString().ToDecimal() / 100D
Dim PorcentajeProducto2 = RowPorcentaje("PorcentajeProducto2").ToString().ToDecimal() / 100D
Dim PorcentajeProducto3 = RowPorcentaje("PorcentajeProducto3").ToString().ToDecimal() / 100D
Dim TotalInicial As Decimal = (Cantidad * (PU)) '- Descuento
Dim TotalFinal = TotalInicial
'SI APLICA EL PRIMER DESCUENTO
If PorcentajeProducto > 0 Then
Dim Descuento1 As Decimal = (TotalInicial * PorcentajeProducto).RoundSQL(2)
Dim Total2 = (TotalInicial - Descuento1)
'SI APLICA EL SEGUNDO DESCUENTO
If PorcentajeProducto2 > 0 Then
Dim Descuento2 As Decimal = (Total2 * PorcentajeProducto2).RoundSQL(2)
Dim Total3 = (Total2 - Descuento2)
'SI APLICA EL TERCER DESCUENTO
If PorcentajeProducto3 > 0 Then
Dim Descuento3 As Decimal = (Total3 * PorcentajeProducto3).RoundSQL(2)
TotalFinal = Total3 - Descuento3
Else
TotalFinal = Total3
End If
Else
TotalFinal = Total2
End If
Else
TotalFinal = TotalInicial
End If
If PorcentajeProducto > 0 Then
Descuento += ((Cantidad * PU) - TotalFinal)
End If
'SI TIENE PRONTO PAGO CALCULA EL IMPORTE
If DdlTipoComprobante.SelectedValue = "Ing" AndAlso RowPorcentaje("ProntoPago").ToString().ToDecimal() > 0 Then
Dim TotalProntoPago As Decimal = (Cantidad * (PU)) - Descuento
Dim PorcentajeProntoPago = RowPorcentaje("ProntoPago").ToString().ToDecimal() / 100D
ObjDescuento.ImporteProntoPago = (TotalProntoPago * PorcentajeProntoPago).RoundSQL(2)
End If
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
ObjDescuento.ImporteDescuento = Descuento
ObjDescuento.CvePromocionDetalle = CvePromocionDetalle
If SeAjustoPU Then
ObjDescuento.PU = PUModificado
ObjDescuento.EsPUModificado = True
End If
Return ObjDescuento
End Function
Protected Sub DdlPS_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DdlPS.selectedindexchange
DdlPSIndexChange(DdlPS.SelectedValue.ToEntero, DdlPS)
End Sub
@@ -5127,13 +5328,27 @@ Partial Class PV
CvePSAmortizacion = DdlPS.SelectedValue.ToEntero.ToEntero
End If
Dim Descuento As Decimal = TxtDescuento.Text.ToDecimal()
Dim Descuento As Decimal = HdnDescuento.Value.ToDecimal
If HdnTipoDescuento.Value = "0" Then
Descuento = HdnDescuento.Value.ToDecimal * TxtCantidad.Text.ToDecimal
End If
Dim ObjDescuento As New Descuentos
If DrPS("CveClasificacion").ToString.ToEntero.Contiene(20516, 20515) Then
ObjDescuento.ImporteDescuento = ((Cantidad * PU) * ClasificacionesDescuentos(DrPS("CveClasificacion").ToString.ToEntero))
End If
ObjDescuento = CalcularDescuentos(CvePS, Cantidad, PU)
If ObjDescuento.EsPUModificado Then
PU = ObjDescuento.PU
End If
Dim CveProyecto As Integer = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("CveProyecto").ToString.ToEntero
Dim Proyecto As String = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("Proyecto").ToString
Dim Consec = AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero, DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text,
CvePS, "", TxtObsPS.Text.Trim, PU, Descuento,
CvePS, "", TxtObsPS.Text.Trim, PU, ObjDescuento.ImporteDescuento,
CveProyecto, Proyecto, DdlSubProyectoDatos.SelectedValue.ToEntero, DdlSubProyectoDatos.SelectedItem.Text,
Serie:="", TiempoEntrega:="", CuentaPredial:="", RegeneraIEPS:=ClienteDesglosaIEPS, CveVentaDetalle:=CveVentaDetalle, EsCargo:=EsCargo)
@@ -6784,12 +6999,12 @@ Partial Class PV
DdlBCIAjuste.DataSource = DTBCIUsados.FiltraParametros($"CveTamaño={CveTamanio}")
DdlBCIAjuste.DataBind()
DdlBCIAjuste.Items.Insert(0, New ListItem("Seleccione", "-1"))
CVAnio.Enabled = True
If CveTamanio = 16 Then 'motobaterias
DdlBCIAjuste.Items.Insert(0, New ListItem(" - ", "0"))
CVAnio.Enabled = False
End If
'UPPDatosUsado.Update() ''refresca el RFV
Else
DdlBCIAjuste.Items.Insert(0, New ListItem(" - ", "0"))
End If

View File

@@ -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 />

View File

@@ -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
@@ -1238,8 +1241,9 @@ Partial Class ProductosyServicios
If DdlSATPS.txtValue.Value.ToEntero > 0 Then
ValidaMaterialPeligroso(DdlSATPS.txtValue.Value.ToEntero)
If Not ValidaMaterialPeligrosoMensaje Then
ValidaMaterialPeligroso(DdlSATPS.txtValue.Value.ToEntero)
Exit Sub
End If
End If

View File

@@ -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)

View File

@@ -637,7 +637,7 @@
<td><b>Serie - Folio:</b></td>
<td>
<asp:Label ID="LblSerie" runat="server"></asp:Label>-
<asp:TextBox ID="TxtFolio" runat="server" BorderStyle="None" Text="000" MaxLength="7" Width="60px" ValidationGroup="GrpEmitirImprimir" Style="text-align: left"></asp:TextBox>
<asp:TextBox ID="TxtFolio" runat="server" BorderStyle="None" Text="000" MaxLength="7" Width="60px" ValidationGroup="GrpEmitirImprimir" Style="text-align: left" autopostback="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVFolio" runat="server" ControlToValidate="TxtFolio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEmitirImprimir"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender10" runat="server" HighlightCssClass="vco" TargetControlID="RFVFolio" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:CompareValidator ID="CVFolio" runat="server" ControlToValidate="TxtFolio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio''</b> no tiene el formato correcto, solo formato numérico." Operator="DataTypeCheck" Type="Integer" ValidationGroup="GrpEmitirImprimir"></asp:CompareValidator>

View File

@@ -30982,6 +30982,11 @@ Partial Class Ventas
TxtFolio.Text = FolioFijo.ToString()
End If
If EstablecioFolio AndAlso UsuarioActual.CveEmpresa = 140 Then ' CÓDIGO TEMPORAL 2022/01/17
FolioFijo = TxtFolio.Text.ToEntero()
ViewState("FolioActual") = FolioFijo
End If
Dim TipoDoctoViejo As String = DdlTipoComprobante.SelectedValue
DdlTipoComprobante.SelectedValue = TipoDoctoNuevo
TxtFecha.Text = Now.ToString()