-- actualización
This commit is contained in:
@@ -549,35 +549,33 @@ Public Class ClsVentas
|
|||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
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,
|
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, CveMetodoPago As Integer, FormaPago As Integer,
|
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 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 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 Double = -1,
|
Optional CveCliente As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional OrdenCompra As String = "-1", Optional RetIVA As Decimal = -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 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
|
Optional RequiereOS As Boolean = False, Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1) As Boolean
|
||||||
|
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_Vta_VentasUpdate")
|
DataAdapter("PA_Vta_VentasUpdate")
|
||||||
|
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
.Add("@SubTotal", SqlDbType.Float).Value = SubTotal
|
.Add("@SubTotal", SqlDbType.Money).Value = SubTotal
|
||||||
.Add("@Descuento", SqlDbType.Float).Value = Descuento
|
.Add("@Descuento", SqlDbType.Money).Value = Descuento
|
||||||
.Add("@IVA", SqlDbType.Float).Value = IVA
|
.Add("@IVA", SqlDbType.Money).Value = IVA
|
||||||
.Add("@IEPS", SqlDbType.Float).Value = IEPS
|
.Add("@IEPS", SqlDbType.Money).Value = IEPS
|
||||||
.Add("@Total", SqlDbType.Float).Value = Total
|
.Add("@Total", SqlDbType.Money).Value = Total
|
||||||
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
|
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
|
||||||
.Add("@TipoCambio", SqlDbType.Float).Value = TipoCambio
|
.Add("@TipoCambio", SqlDbType.Money).Value = TipoCambio
|
||||||
.Add("@RetIVA", SqlDbType.Float).Value = RetIVA
|
.Add("@RetIVA", SqlDbType.Money).Value = RetIVA
|
||||||
.Add("@RetISR", SqlDbType.Float).Value = RetISR
|
.Add("@RetISR", SqlDbType.Money).Value = RetISR
|
||||||
.Add("@Fecha", SqlDbType.Date).Value = Fecha
|
.Add("@Fecha", SqlDbType.Date).Value = Fecha
|
||||||
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
|
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
|
||||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||||
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
|
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
|
||||||
.Add("@CveMetodoPago", SqlDbType.Int).Value = CveMetodoPago
|
|
||||||
.Add("@CondicionesPago", SqlDbType.Int).Value = CondicionesPago
|
.Add("@CondicionesPago", SqlDbType.Int).Value = CondicionesPago
|
||||||
.Add("@FormaPago", SqlDbType.Int).Value = FormaPago
|
|
||||||
.Add("@AtencionA", SqlDbType.VarChar).Value = AtencionA
|
.Add("@AtencionA", SqlDbType.VarChar).Value = AtencionA
|
||||||
.Add("@Vigencia", SqlDbType.Date).Value = Vigencia
|
.Add("@Vigencia", SqlDbType.Date).Value = Vigencia
|
||||||
.Add("@PedidoContrato", SqlDbType.VarChar).Value = PedidoContrato
|
.Add("@PedidoContrato", SqlDbType.VarChar).Value = PedidoContrato
|
||||||
@@ -586,7 +584,7 @@ Public Class ClsVentas
|
|||||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||||
.Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
|
.Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
|
||||||
.Add("@OrdenCompra", SqlDbType.VarChar).Value = OrdenCompra
|
.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("@CveUsoCFDi", SqlDbType.SmallInt).Value = CveUsoCFDi
|
||||||
.Add("@ServicioDomicilio", SqlDbType.Bit).Value = ServicioDomicilio
|
.Add("@ServicioDomicilio", SqlDbType.Bit).Value = ServicioDomicilio
|
||||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||||
|
|||||||
@@ -446,16 +446,14 @@
|
|||||||
:</b></td>
|
:</b></td>
|
||||||
<td align="left">
|
<td align="left">
|
||||||
<div class="row align-items-start">
|
<div class="row align-items-start">
|
||||||
<div class="col-md-10">
|
<div class="col-md-12">
|
||||||
<asp:DropDownList ID="DdlSucursalCliente" runat="server" AutoPostBack="true" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="SucursalCliente" DataValueField="CveClienteSucursal">
|
<asp:DropDownList ID="DdlSucursalCliente" runat="server" Width="100%" AutoPostBack="true" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="SucursalCliente" DataValueField="CveClienteSucursal">
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2" style="padding: inherit;">
|
|
||||||
<asp:LinkButton ID="LnkAgregarSucursal" Visible="false" runat="server" CssClass="btn btn-primary btn-circle btn-xs" Text="<i class='fa fa-plus' aria-hidden='true'></i>" OnClick="LnkAgregarSucursal_Click"></asp:LinkButton>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td align="left">
|
<td align="left">
|
||||||
|
<asp:LinkButton ID="LnkAgregarSucursal" Visible="false" runat="server" CssClass="btn btn-primary btn-circle btn-xs" Text="<i class='fa fa-plus' aria-hidden='true'></i>" OnClick="LnkAgregarSucursal_Click"></asp:LinkButton>
|
||||||
<b>
|
<b>
|
||||||
<asp:Label ID="LtlTitleRFCSucursal" runat="server" Text=""></asp:Label></b>
|
<asp:Label ID="LtlTitleRFCSucursal" runat="server" Text=""></asp:Label></b>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -3392,7 +3392,7 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
|
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
|
||||||
If CveVenta <= 0 Then
|
If CveVenta <= 0 Then
|
||||||
EsVentaMedica = True
|
EsVentaMedica = True
|
||||||
CargaTiposVenta()
|
CargaTiposVenta()
|
||||||
@@ -21680,6 +21680,7 @@ Partial Class Ventas
|
|||||||
BtnEditarRemision.Visible = True
|
BtnEditarRemision.Visible = True
|
||||||
BtnPermisoEditarRemision.Visible = False
|
BtnPermisoEditarRemision.Visible = False
|
||||||
BtnCrearApartirDe.Visible = False
|
BtnCrearApartirDe.Visible = False
|
||||||
|
DdlSucursalCliente.Enabled = True
|
||||||
TxtObsFact.Enabled = True
|
TxtObsFact.Enabled = True
|
||||||
TxtOrdenCompra.Enabled = True
|
TxtOrdenCompra.Enabled = True
|
||||||
TxtPedidoContrato.Enabled = True
|
TxtPedidoContrato.Enabled = True
|
||||||
@@ -21690,7 +21691,6 @@ Partial Class Ventas
|
|||||||
UPCondicionesPago.Update()
|
UPCondicionesPago.Update()
|
||||||
If Me.PermiteCredito Then RBLPago.Enabled = True
|
If Me.PermiteCredito Then RBLPago.Enabled = True
|
||||||
DdlVendedor.Enabled = True
|
DdlVendedor.Enabled = True
|
||||||
|
|
||||||
ModalidadEdicion = True
|
ModalidadEdicion = True
|
||||||
|
|
||||||
ViewState("CveClienteAnterior") = CveCliente
|
ViewState("CveClienteAnterior") = CveCliente
|
||||||
@@ -21745,7 +21745,6 @@ Partial Class Ventas
|
|||||||
TxtPrecio.Enabled = True
|
TxtPrecio.Enabled = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
LbAgregar.Enabled = True
|
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 = '';")
|
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
|
LblSubTotal1.Text = TxtSubTotal.Text
|
||||||
@@ -21772,8 +21771,9 @@ Partial Class Ventas
|
|||||||
Dim ObjCGame As New ClsCGame(ObjVentas.IniciaTransacSQL())
|
Dim ObjCGame As New ClsCGame(ObjVentas.IniciaTransacSQL())
|
||||||
|
|
||||||
Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero()
|
Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero()
|
||||||
Dim TipoCambio As Double = TxtTipoCambio.Text.ToDouble
|
Dim TipoCambio As Decimal = TxtTipoCambio.Text.ToDecimal
|
||||||
EditoRemision = True
|
EditoRemision = True
|
||||||
|
CveClienteSucursal = DdlSucursalCliente.SelectedValue.ToEntero
|
||||||
Try
|
Try
|
||||||
'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS
|
'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS
|
||||||
If DdlMoneda.SelectedValue.ToEntero() <> 2 AndAlso ChkConvertirDolares.Checked Then
|
If DdlMoneda.SelectedValue.ToEntero() <> 2 AndAlso ChkConvertirDolares.Checked Then
|
||||||
@@ -21850,11 +21850,11 @@ Partial Class Ventas
|
|||||||
|
|
||||||
'Actualizo los parametros de la venta
|
'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,
|
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),
|
Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1),
|
||||||
PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(),
|
PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(),
|
||||||
CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:="Rem", CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal,
|
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.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(),
|
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
|
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedicoObservaciones.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimientoObservaciones.SelectedValue.ToEntero) Then
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
End If
|
End If
|
||||||
@@ -30290,7 +30290,7 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero()
|
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
|
If DdlMoneda.SelectedValue.ToEntero() <> 1 AndAlso ChkConvertirDoctoPesos.Checked Then
|
||||||
TipoCambio = 1
|
TipoCambio = 1
|
||||||
Moneda = 1
|
Moneda = 1
|
||||||
@@ -30377,15 +30377,14 @@ Partial Class Ventas
|
|||||||
Moneda = 1
|
Moneda = 1
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
'ACTUALIZA VENTA
|
'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,
|
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),
|
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(),
|
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,
|
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"
|
MensajeError = "Ocurrió un error al actualizar la información de la cotización"
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
End If
|
End If
|
||||||
|
|||||||
Reference in New Issue
Block a user