editar campos de una venta
This commit is contained in:
@@ -460,7 +460,8 @@ Public Class ClsVentas
|
||||
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) As Boolean
|
||||
Optional RetISR As Double = -1, Optional Kilometraje As Double = 0, Optional CveVendedor As Integer = -1, Optional ObsAlm As String = "", Optional FormaPaqueteria As Integer = -1,
|
||||
Optional CorreoNot As String = "-1") As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_VentasUpdate")
|
||||
|
||||
@@ -491,6 +492,10 @@ Public Class ClsVentas
|
||||
.Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
|
||||
.Add("@OrdenCompra", SqlDbType.VarChar).Value = OrdenCompra
|
||||
.Add("@Kilometraje", SqlDbType.Float).Value = Kilometraje
|
||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||
.Add("@ObservacionesAlm", SqlDbType.NVarChar).Value = ObsAlm
|
||||
.Add("@FormaPaqueteria", SqlDbType.Int).Value = FormaPaqueteria
|
||||
.Add("@CorreoNotificacion", SqlDbType.NVarChar).Value = CorreoNot
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -3403,6 +3403,8 @@
|
||||
<asp:Button ID="BtnMandaMail" runat="server" Text="MandaMail" CssClass="btn myventasbutton btn-primary" Visible="false" />
|
||||
<asp:Button ID="BtnCrearApartirDe" runat="server" Text="Crear a partir de" CssClass="btn myventasbutton btn-primary" Visible="false" />
|
||||
|
||||
<asp:Button ID="BtnEditar" runat="server" Text="Editar" CssClass="btn myventasbutton btn-primary" Visible="false" />
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -2049,6 +2049,7 @@ Partial Class Ventas
|
||||
DdlSubProyectoDatos.Enabled = False
|
||||
BtnEmitirImprimir.Visible = False
|
||||
BtnCrearApartirDe.Visible = True
|
||||
BtnEditar.Visible = True
|
||||
'DdlEstatus.Enabled = True
|
||||
|
||||
DivFechaAnticipoCliente.Visible = True
|
||||
@@ -4450,36 +4451,41 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(280) = "1" Then
|
||||
RblPaqueteria.SelectedValue = If(DbRowVenta("FormaPaqueteria").ToString = "", "1", DbRowVenta("FormaPaqueteria").ToString)
|
||||
RblPaqueteria.Enabled = False
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveEmpresa = 48 Then
|
||||
TxtFecha.AutoPostBack = True
|
||||
End If
|
||||
|
||||
CargaCodigoUnico()
|
||||
|
||||
'SI ES COTIZACION PUEDE GENERAR UNA OC PARA MODIFICAR LOS IMPORTES
|
||||
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(583) = "1" Then
|
||||
Dim DtOCGeneradas As DataTable = Nothing
|
||||
If ObjVentas.GetVentasCotizacionesOC(Me.CveVenta, -1, UsuarioActual.CveEmpresa) Then
|
||||
DtOCGeneradas = ObjVentas.DtResultados.Copy()
|
||||
TxtFecha.AutoPostBack = True
|
||||
End If
|
||||
If DtOCGeneradas IsNot Nothing AndAlso DtOCGeneradas.Rows.Count > 0 Then
|
||||
LtGenerarOC.Visible = False
|
||||
Else
|
||||
LtGenerarOC.Visible = True
|
||||
|
||||
CargaCodigoUnico()
|
||||
|
||||
'SI ES COTIZACION PUEDE GENERAR UNA OC PARA MODIFICAR LOS IMPORTES
|
||||
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(583) = "1" Then
|
||||
Dim DtOCGeneradas As DataTable = Nothing
|
||||
If ObjVentas.GetVentasCotizacionesOC(Me.CveVenta, -1, UsuarioActual.CveEmpresa) Then
|
||||
DtOCGeneradas = ObjVentas.DtResultados.Copy()
|
||||
End If
|
||||
If DtOCGeneradas IsNot Nothing AndAlso DtOCGeneradas.Rows.Count > 0 Then
|
||||
LtGenerarOC.Visible = False
|
||||
Else
|
||||
LtGenerarOC.Visible = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
DdlTipoRetencion.SelectedValueExist(DbRowVenta("CveTipoRetencion").ToString())
|
||||
DdlTipoRetencion.SelectedValueExist(DbRowVenta("CveTipoRetencion").ToString())
|
||||
|
||||
CargaPS(-1, DdlPS)
|
||||
CargaPS(-1, DdlPS)
|
||||
|
||||
UpPS.Update()
|
||||
UpContado.Update()
|
||||
UpEstatus.Update()
|
||||
Retorno = True
|
||||
UpPS.Update()
|
||||
UpContado.Update()
|
||||
UpEstatus.Update()
|
||||
Retorno = True
|
||||
|
||||
Else
|
||||
ViewState("CveVenta") = -1
|
||||
Else
|
||||
ViewState("CveVenta") = -1
|
||||
Alert("El documento solicitado no existe, favor de revisar su búsqueda.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
@@ -25965,4 +25971,48 @@ Partial Class Ventas
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnEditar_Click() Handles BtnEditar.Click
|
||||
Dim Opcion As String = BtnEditar.Text
|
||||
If Opcion = "Editar" Then
|
||||
EditarHabilitarCampos()
|
||||
ElseIf Opcion = "Guardar" Then
|
||||
GuardarValoresEditados()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub EditarHabilitarCampos()
|
||||
'Datos de emisión
|
||||
DdlVendedor.Enabled = True
|
||||
|
||||
'Observaciones
|
||||
TxtObsFact.Enabled = True
|
||||
TxtOrdenCompra.Enabled = True
|
||||
TxtPedidoContrato.Enabled = True
|
||||
TxtObsAlmacen.Enabled = True
|
||||
RblPaqueteria.Enabled = True
|
||||
|
||||
'Acciones
|
||||
BtnEditar.Text = "Guardar"
|
||||
|
||||
UpParametros.Update()
|
||||
UPObservaciones.Update()
|
||||
UpFacturar.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub GuardarValoresEditados()
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
If ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal, TxtIVA.Text.ToDecimal, TxtIEPS.Text.ToDecimal, TxtTotal.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero(),
|
||||
TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim, UsuarioActual.CveEmpresa, CveVenta, DdlMetodoPago33.SelectedValue.ToEntero, DdlFormaPago33.SelectedValue.ToEntero,
|
||||
TipoDocto:=DdlTipoComprobante.SelectedValue, OrdenCompra:=TxtOrdenCompra.Text, PedidoContrato:=TxtPedidoContrato.Text, ObsAlm:=TxtObsAlmacen.Text, FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero,
|
||||
CorreoNot:=TxtCorreoNotificaciones.Text) Then
|
||||
CargaVenta()
|
||||
BtnEditar.Text = "Editar"
|
||||
Alert("Actualizado correctamente")
|
||||
UpParametros.Update()
|
||||
UPObservaciones.Update()
|
||||
UpFacturar.Update()
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user