Validacion de carta porte, regimen de sociedad en nombre del cliente, habilitar textbox de TC en E13 y E83, limpiar adjuntos en "crear a partir de"

This commit is contained in:
2022-06-22 01:32:13 -07:00
parent d27cf078d2
commit 10a60e8db2
2 changed files with 132 additions and 66 deletions

View File

@@ -10355,6 +10355,7 @@ Namespace Modelos
Public Property CveCliente As Integer
Public Property Nombre As String
Public Property NombreComercial As String
Public Property RegimenSociedad As String
Public Property Codigo As String
Public Property Direccion As String
Public Property NoExt As String

View File

@@ -2695,9 +2695,6 @@ Partial Class Ventas
End If
End If
'PERMISO PARA CANCELAR PEDIDO
If GvInv.Rows.Count = 0 Then
If DdlTipoComprobante.SelectedValue.Contiene("Ped") And Not CveEstatus = 14 Then
@@ -3276,70 +3273,69 @@ Partial Class Ventas
HlFacturasRelaciondas.Visible = False
End If
End If
''EN REALIDAD SE OCUPAN ESTAS COSAS DENTRO DEL POSTABCK ???
If Not CveVenta > 0 Then
'LbDescargarExcel.Visible = True
HlAgregarExcel.Visible = True
End If
If DdlTipoComprobante.SelectedValue.Contiene("Rem") Then
' IPP 15 Julio 2017 - ERA FALSE
ImgAntiPend.Visible = False
UpPS.Update()
End If
If UsuarioActual.Empresa.Funcionalidad(517) <> "" Then
TxtFolio.Enabled = False
TxtFecha.Enabled = False
If LblSeTimbro.Text = "No" And DdlTipoComprobante.SelectedValue.Contiene("Ing", "Egs", "Dev", "Ant") Then
TxtFecha.Text = Now.ToShortDateString
''EN REALIDAD SE OCUPAN ESTAS COSAS DENTRO DEL POSTABCK ???
If Not CveVenta > 0 Then
'LbDescargarExcel.Visible = True
HlAgregarExcel.Visible = True
End If
ImgFecha.Visible = False
End If
'condición temporal por implementación JAM. usuario FernandaRomo
If UsuarioActual.CveUsuario.Contiene(11703, 1719) Then
If DdlTipoComprobante.SelectedValue.Contiene("Rem") Then
' IPP 15 Julio 2017 - ERA FALSE
ImgAntiPend.Visible = False
UpPS.Update()
End If
If UsuarioActual.Empresa.Funcionalidad(517) <> "" Then
TxtFolio.Enabled = False
TxtFecha.Enabled = False
If LblSeTimbro.Text = "No" And DdlTipoComprobante.SelectedValue.Contiene("Ing", "Egs", "Dev", "Ant") Then
TxtFecha.Text = Now.ToShortDateString
End If
ImgFecha.Visible = False
End If
'condición temporal por implementación JAM. usuario FernandaRomo
If UsuarioActual.CveUsuario.Contiene(11703, 1719) Then
TxtFecha.Enabled = True
ImgFecha.Visible = True
End If
TxtFecha.Enabled = True
ImgFecha.Visible = True
BloqueaCondiconesPago()
BloqueaClasificaciones()
'NO PERMITIR AGREGAR PS DESDE VENTAS EN ECONOLLANTAS
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
BtnModalAddPS.Enabled = False
End If
MostrarOpcionesPaqueteria()
'If ViewState("CveCotizacion").ToString().ToEntero() > 0 Then
'If Not AjustarTotalCotizacionFacturada(ViewState("CveCotizacion").ToString().ToEntero(), TxtTotal.Text.ToDecimal) Then
' BtnEmitirImprimir.Visible = True
' Alert("Ocurrió un error al ajustar el importe", TipoMensaje.MsgError)
'End If
'End If
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
trRotacion.Visible = True
trRotacionlbl.Visible = True
trAlineacion.Visible = True
trAlineacionlbl.Visible = True
Dim FechaRotaAlinea As Date = TxtFecha.Text.ToDate
LblRotacion.Text = FechaRotaAlinea.AddMonths(6).ToShortDateString
LblAlineacion.Text = FechaRotaAlinea.AddMonths(6).ToShortDateString
UPObservaciones.Update()
End If
End If
TxtFecha.Enabled = True
BloqueaCondiconesPago()
BloqueaClasificaciones()
'NO PERMITIR AGREGAR PS DESDE VENTAS EN ECONOLLANTAS
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
BtnModalAddPS.Enabled = False
End If
MostrarOpcionesPaqueteria()
'If ViewState("CveCotizacion").ToString().ToEntero() > 0 Then
'If Not AjustarTotalCotizacionFacturada(ViewState("CveCotizacion").ToString().ToEntero(), TxtTotal.Text.ToDecimal) Then
' BtnEmitirImprimir.Visible = True
' Alert("Ocurrió un error al ajustar el importe", TipoMensaje.MsgError)
'End If
'End If
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
trRotacion.Visible = True
trRotacionlbl.Visible = True
trAlineacion.Visible = True
trAlineacionlbl.Visible = True
Dim FechaRotaAlinea As Date = TxtFecha.Text.ToDate
LblRotacion.Text = FechaRotaAlinea.AddMonths(6).ToShortDateString
LblAlineacion.Text = FechaRotaAlinea.AddMonths(6).ToShortDateString
UPObservaciones.Update()
End If
End Sub
Private Sub BloqueaClasificaciones()
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then
@@ -5239,8 +5235,11 @@ Partial Class Ventas
TxtFech3.ReadOnly = True : ImgFech3.Enabled = False
ChkConvertirDoctoPesos.Enabled = False
ChkConvertirDolares.Enabled = False
TxtTipoCambio.Enabled = False
TxtTipoCambioDlls.Enabled = False
TxtTipoCambio.Enabled = UsuarioActual.CveEmpresa.Contiene(13, 83)
TxtTipoCambioDlls.Enabled = UsuarioActual.CveEmpresa.Contiene(13, 83)
TxtTipoCambio.ReadOnly = Not UsuarioActual.CveEmpresa.Contiene(13, 83)
TxtTipoCambioDlls.ReadOnly = Not UsuarioActual.CveEmpresa.Contiene(13, 83)
'Condiciones de Pago
RBLPago.Enabled = False
@@ -8376,6 +8375,37 @@ Partial Class Ventas
Alert("La carta porte no tiene un destino definido.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If DdlChofer.SelectedValue.ToEntero() <= 0 Then
Alert("La carta porte no tiene un chofer definido.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If DdlUnidadCamion.SelectedValue.ToEntero() <= 0 Then
Alert("La carta porte no tiene un chofer definido.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If String.IsNullOrEmpty(TxtDistancia.Text.Trim) Then
Alert("La carta porte no tiene la distancia definida.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If String.IsNullOrEmpty(TxtFechaEntregaCP.Text.Trim) Then
Alert("La carta porte no tiene la F.Salida definida.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If String.IsNullOrEmpty(TxtFechaLlegadaCP.Text.Trim) Then
Alert("La carta porte no tiene la F.Llegada definida.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If DtMercancias Is Nothing OrElse DtMercancias.Rows.Count = 0 Then
Alert("La carta porte no tiene mercancía definida.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If DvConfiguracionVeiculo.Visible Then
If DdlConfigAuto.SelectedValue.ToEntero() <= 0 Then
Alert("La carta porte no tiene la configuración definida.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
End If
'CUANDO ES COTIZACION Y SE VA A FACTURAR SE HACE INGRESO
@@ -11572,7 +11602,7 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
Timbre.Receptor.Nombre = Obj.Cliente.Nombre
Else
Timbre.Receptor.Nombre = Obj.Cliente.NombreComercial
Timbre.Receptor.Nombre = Obj.Cliente.Nombre + " " + Obj.Cliente.RegimenSociedad
End If
Timbre.Receptor.DomicilioFiscalReceptor = Obj.Cliente.CP
End If
@@ -18103,7 +18133,7 @@ Partial Class Ventas
If CvePS.Contiene(402917, 402918) Then
PUPromocion = 40D
End If
PUModificado = Math.Round(PUPromocion / (1 + If(IncluyeImpuestos, PorcentajeIVA, 0)), 6)
PUModificado = Math.Round(PUPromocion / (1 + PorcentajeIVA), 6)
End If
End If
@@ -21681,6 +21711,15 @@ Partial Class Ventas
TxtTipoCambio.Text = GlobalTipoCambio(TxtFecha.Text.ToDate).ToString()
TrConversionTipoCambio.Visible = True
End Select
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
TxtTipoCambio.Enabled = True
TxtTipoCambioDlls.Enabled = True
TxtTipoCambio.ReadOnly = False
TxtTipoCambioDlls.ReadOnly = False
End If
UpPS.Update()
If CveCliente > 0 Then
@@ -31305,6 +31344,8 @@ Partial Class Ventas
' BtnCrearApartirDe.Visible = False
'End If
Dim FolioOriginal As String = TxtFolio.Text
HdnCveVenta.Value = ""
BtnCrearApartirDe.Visible = False '[IPP-2Novimebre2018] REEMPLAZA LO COMENTADO ARRIBA
@@ -31504,6 +31545,30 @@ Partial Class Ventas
HabilitarControlesCartaPorte(True)
End If
If DivAdjuntar.Visible Then
Dim FolioNuevo As String = TxtFolio.Text
If FolioNuevo <> FolioOriginal Then
If Adjunto <> "" Then
Adjunto = ""
BtnArchivoAdjunto.Text = ""
BtnArchivoAdjunto.Visible = False
BtnEliminarAdjunto.Visible = False
BtnAdjuntar.Visible = True
tdAdjuntar.Style.Item("display") = "block"
tdAdjunto.Style.Item("display") = "none"
Else
DivAdjuntar.Visible = True
End If
Else
DivAdjuntar.Visible = False
End If
UpAdjuntar.Update()
Else
DivAdjuntar.Visible = True
End If
UpnTools.Update()
UpCliente.Update()
UpParametros.Update()