diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 1a8ab4888..5fc629f5c 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -549,35 +549,33 @@ Public Class ClsVentas Return Retorno End Function - Public Function UpdateVentas(SubTotal As Double, Descuento As Double, IVA As Double, IEPS As Double, Total As Double, CveMoneda As Integer, TipoCambio As Double, - Fecha As Date, Observaciones As String, CveEmpresa As Integer, CveVenta As Integer, CveMetodoPago As Integer, FormaPago As Integer, + Public Function UpdateVentas(SubTotal As Decimal, Descuento As Decimal, IVA As Decimal, IEPS As Decimal, Total As Decimal, CveMoneda As Integer, TipoCambio As Decimal, + Fecha As Date, Observaciones As String, CveEmpresa As Integer, CveVenta As Integer, Optional TipoDocto As String = "Cot", Optional Vigencia As Date = MinFecha, Optional CondicionesPago As Integer = -1, - Optional AtencionA As String = "-1", Optional PedidoContrato As String = "-1", Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1, - Optional CveCliente As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional OrdenCompra As String = "-1", Optional RetIVA As Double = -1, - Optional RetISR As Double = -1, Optional Kilometraje As Double = 0, Optional CveUsoCFDi As Integer = -1, Optional ServicioDomicilio As Boolean = False, Optional CveVendedor As Integer = -1, + Optional AtencionA As String = "", Optional PedidoContrato As String = "", Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1, + Optional CveCliente As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional OrdenCompra As String = "-1", Optional RetIVA As Decimal = -1, + Optional RetISR As Decimal = -1, Optional Kilometraje As Decimal = 0, Optional CveUsoCFDi As Integer = -1, Optional ServicioDomicilio As Boolean = False, Optional CveVendedor As Integer = -1, Optional RequiereOS As Boolean = False, Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasUpdate") With SqlAdapter.SelectCommand.Parameters - .Add("@SubTotal", SqlDbType.Float).Value = SubTotal - .Add("@Descuento", SqlDbType.Float).Value = Descuento - .Add("@IVA", SqlDbType.Float).Value = IVA - .Add("@IEPS", SqlDbType.Float).Value = IEPS - .Add("@Total", SqlDbType.Float).Value = Total + .Add("@SubTotal", SqlDbType.Money).Value = SubTotal + .Add("@Descuento", SqlDbType.Money).Value = Descuento + .Add("@IVA", SqlDbType.Money).Value = IVA + .Add("@IEPS", SqlDbType.Money).Value = IEPS + .Add("@Total", SqlDbType.Money).Value = Total .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda - .Add("@TipoCambio", SqlDbType.Float).Value = TipoCambio - .Add("@RetIVA", SqlDbType.Float).Value = RetIVA - .Add("@RetISR", SqlDbType.Float).Value = RetISR + .Add("@TipoCambio", SqlDbType.Money).Value = TipoCambio + .Add("@RetIVA", SqlDbType.Money).Value = RetIVA + .Add("@RetISR", SqlDbType.Money).Value = RetISR .Add("@Fecha", SqlDbType.Date).Value = Fecha .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveVenta", SqlDbType.Int).Value = CveVenta .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto - .Add("@CveMetodoPago", SqlDbType.Int).Value = CveMetodoPago .Add("@CondicionesPago", SqlDbType.Int).Value = CondicionesPago - .Add("@FormaPago", SqlDbType.Int).Value = FormaPago .Add("@AtencionA", SqlDbType.VarChar).Value = AtencionA .Add("@Vigencia", SqlDbType.Date).Value = Vigencia .Add("@PedidoContrato", SqlDbType.VarChar).Value = PedidoContrato @@ -586,7 +584,7 @@ Public Class ClsVentas .Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal .Add("@OrdenCompra", SqlDbType.VarChar).Value = OrdenCompra - .Add("@Kilometraje", SqlDbType.Float).Value = Kilometraje + .Add("@Kilometraje", SqlDbType.Money).Value = Kilometraje .Add("@CveUsoCFDi", SqlDbType.SmallInt).Value = CveUsoCFDi .Add("@ServicioDomicilio", SqlDbType.Bit).Value = ServicioDomicilio .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index be622b490..81e288727 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -446,16 +446,14 @@ :
-
- +
+ -
-
- -
+
+ diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index b9c4ee556..4205a02d6 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -3392,7 +3392,7 @@ Partial Class Ventas End If End If - If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then + If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then If CveVenta <= 0 Then EsVentaMedica = True CargaTiposVenta() @@ -21680,6 +21680,7 @@ Partial Class Ventas BtnEditarRemision.Visible = True BtnPermisoEditarRemision.Visible = False BtnCrearApartirDe.Visible = False + DdlSucursalCliente.Enabled = True TxtObsFact.Enabled = True TxtOrdenCompra.Enabled = True TxtPedidoContrato.Enabled = True @@ -21690,7 +21691,6 @@ Partial Class Ventas UPCondicionesPago.Update() If Me.PermiteCredito Then RBLPago.Enabled = True DdlVendedor.Enabled = True - ModalidadEdicion = True ViewState("CveClienteAnterior") = CveCliente @@ -21745,7 +21745,6 @@ Partial Class Ventas TxtPrecio.Enabled = True End If - LbAgregar.Enabled = True ImgDescTotal.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '2'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = ''; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = 'none'; $get('BtnAplicarDescG').style.display = ''; $get('TrMotivoDescuento').style.display = '';") LblSubTotal1.Text = TxtSubTotal.Text @@ -21772,8 +21771,9 @@ Partial Class Ventas Dim ObjCGame As New ClsCGame(ObjVentas.IniciaTransacSQL()) Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero() - Dim TipoCambio As Double = TxtTipoCambio.Text.ToDouble + Dim TipoCambio As Decimal = TxtTipoCambio.Text.ToDecimal EditoRemision = True + CveClienteSucursal = DdlSucursalCliente.SelectedValue.ToEntero Try 'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS If DdlMoneda.SelectedValue.ToEntero() <> 2 AndAlso ChkConvertirDolares.Checked Then @@ -21850,11 +21850,11 @@ Partial Class Ventas 'Actualizo los parametros de la venta If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal, TxtIVA.Text.ToDecimal, TxtIEPS.Text.ToDecimal, TxtTotal.Text.ToDecimal, Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim, - UsuarioActual.CveEmpresa, CveVenta, 0, 0, + UsuarioActual.CveEmpresa, CveVenta, Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1), PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), - CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:="Rem", CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, - OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), + CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:=DdlTipoComprobante.SelectedValue, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, + OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDecimal, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedicoObservaciones.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimientoObservaciones.SelectedValue.ToEntero) Then OcurrioError = True End If @@ -30290,7 +30290,7 @@ Partial Class Ventas End If Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero() - Dim TipoCambio As Double = TxtTipoCambio.Text.Trim.ToDecimal + Dim TipoCambio As Decimal = TxtTipoCambio.Text.Trim.ToDecimal If DdlMoneda.SelectedValue.ToEntero() <> 1 AndAlso ChkConvertirDoctoPesos.Checked Then TipoCambio = 1 Moneda = 1 @@ -30377,15 +30377,14 @@ Partial Class Ventas Moneda = 1 End If - 'ACTUALIZA VENTA - If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDouble(), LblDescuentos.Text.ToDouble(), TxtIVA.Text.ToDouble(), TxtIEPS.Text.ToDouble(), TxtTotal.Text.ToDouble(), + If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal(), TxtIVA.Text.ToDecimal(), TxtIEPS.Text.ToDecimal(), TxtTotal.Text.ToDecimal(), Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim, - UsuarioActual.CveEmpresa, CveVenta, 0, 0, + UsuarioActual.CveEmpresa, CveVenta, Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1), PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, - TipoDocto:=DdlTipoComprobante.SelectedValue, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero()) Then + TipoDocto:=DdlTipoComprobante.SelectedValue, Kilometraje:=TxtKilometraje.Text.ToDecimal, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero()) Then MensajeError = "Ocurrió un error al actualizar la información de la cotización" OcurrioError = True End If