This commit is contained in:
2020-06-30 19:28:28 -07:00
11 changed files with 1264 additions and 280 deletions

View File

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

View File

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