Correcion de envio de correo, actualizacion de uso CFDI, Permiso para generar remision
This commit is contained in:
@@ -462,7 +462,7 @@ 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 CveUsoCFDi As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_VentasUpdate")
|
||||
|
||||
@@ -493,6 +493,7 @@ Public Class ClsVentas
|
||||
.Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
|
||||
.Add("@OrdenCompra", SqlDbType.VarChar).Value = OrdenCompra
|
||||
.Add("@Kilometraje", SqlDbType.Float).Value = Kilometraje
|
||||
.Add("@CveUsoCFDi", SqlDbType.SmallInt).Value = CveUsoCFDi
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -3940,14 +3940,22 @@ Partial Class Ventas
|
||||
Case "PeC"
|
||||
DdlTipoComprobante.Items.Insert(5, New ListItem("Pedido de Consignación", "PeC"))
|
||||
Case "PA"
|
||||
BtnGenerarRemision.Visible = If(CveEstatus = 16, True, False)
|
||||
If UsuarioActual.TienePermisoProceso(199) Then
|
||||
BtnGenerarRemision.Visible = If(CveEstatus = 16, True, False)
|
||||
Else
|
||||
BtnGenerarRemision.Visible = False
|
||||
End If
|
||||
CvePedidoA = CveVenta
|
||||
DiasCredito = DbRowVenta("DiasCredito").ToString().ToEntero()
|
||||
EsDiasCreditoFijo = CBool(DbRowVenta("EsDiasCreditoFijo").ToString())
|
||||
Case "Pd2"
|
||||
CvePedido2 = CveVenta
|
||||
BtnGeneraAutorizacion.Visible = If(CveEstatus <> 21, True, False)
|
||||
BtnGenerarRemision.Visible = If(CveEstatus <> 21, True, False)
|
||||
If UsuarioActual.TienePermisoProceso(199) Then
|
||||
BtnGenerarRemision.Visible = If(CveEstatus <> 21, True, False)
|
||||
Else
|
||||
BtnGenerarRemision.Visible = False
|
||||
End If
|
||||
End Select
|
||||
|
||||
DdlTipoComprobante.SelectedValue = DbRowVenta("TipoDocto").ToString()
|
||||
@@ -4588,7 +4596,12 @@ Partial Class Ventas
|
||||
|
||||
'ACTIVA BOTONERA | DEBE TENER CONCEPTOS PENDIENTES DE FACTURAR
|
||||
If TmpDT.SUM("CantidadFacturadaCot") < TmpDT.SUM("Cantidad") AndAlso DdlTipoComprobante.SelectedValue.Contiene("Cot") Then
|
||||
BtnGenerarRemision.Visible = If(CveEstatus = 10, False, True)
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(199) Then
|
||||
BtnGenerarRemision.Visible = If(CveEstatus = 10, False, True)
|
||||
Else
|
||||
BtnGenerarRemision.Visible = False
|
||||
End If
|
||||
BtnsFacturar.Visible = True
|
||||
LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274)
|
||||
End If
|
||||
@@ -5615,7 +5628,6 @@ Partial Class Ventas
|
||||
BtnsFacturar.Visible = False
|
||||
LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274)
|
||||
Else
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Pd2") Then
|
||||
BtnGeneraAutorizacion.Visible = If(CveEstatus <> 21, True, False)
|
||||
End If
|
||||
@@ -5635,7 +5647,11 @@ Partial Class Ventas
|
||||
Else
|
||||
BtnGeneraAutorizacion.Visible = False
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Pd2") Then
|
||||
BtnGenerarRemision.Visible = If(CveEstatus <> 21, True, False)
|
||||
If UsuarioActual.TienePermisoProceso(199) Then
|
||||
BtnGenerarRemision.Visible = If(CveEstatus <> 21, True, False)
|
||||
Else
|
||||
BtnGenerarRemision.Visible = False
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
@@ -12667,6 +12683,10 @@ Partial Class Ventas
|
||||
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgError)
|
||||
End Try
|
||||
|
||||
If CveVenta > 0 Then
|
||||
ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False)
|
||||
End If
|
||||
|
||||
LocalSerieFolio = ObjFactura.SerieFolio
|
||||
LocalTipoDocto = ObjFactura.TipoDocto
|
||||
'End If
|
||||
@@ -12680,7 +12700,7 @@ Partial Class Ventas
|
||||
|
||||
Try
|
||||
' BytesPdfCotizacion(CveVenta)
|
||||
Dim Hilo As New System.Threading.Thread(Sub() MandaMails(CveVenta, DdlTipoComprobante.SelectedValue.ToString(), LocalSerieFolio, ChkEnviarFactura.Checked, ArchivoXML, ArchivoPDF))
|
||||
Dim Hilo As New System.Threading.Thread(Sub() MandaMails(UsuarioActual, CveVenta, DdlTipoComprobante.SelectedValue.ToString(), LocalSerieFolio, ChkEnviarFactura.Checked, ArchivoXML, ArchivoPDF))
|
||||
Hilo.Start()
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió error al mandar Mail", ex)
|
||||
@@ -12702,8 +12722,6 @@ Partial Class Ventas
|
||||
Dim LocalSerieFolio As String = String.Empty
|
||||
Dim LocalTipoDocto As String = String.Empty
|
||||
|
||||
If CveVenta > 0 Then CreaObjetosVenta()
|
||||
|
||||
'TIMBRADO NUEVO
|
||||
Try
|
||||
pdf = PdfFactura(ObjFactura)
|
||||
@@ -12711,6 +12729,10 @@ Partial Class Ventas
|
||||
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgError)
|
||||
End Try
|
||||
|
||||
If CveVenta > 0 Then
|
||||
ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False)
|
||||
End If
|
||||
|
||||
LocalSerieFolio = ObjFactura.SerieFolio
|
||||
LocalTipoDocto = ObjFactura.TipoDocto
|
||||
|
||||
@@ -12722,7 +12744,7 @@ Partial Class Ventas
|
||||
|
||||
Try
|
||||
' BytesPdfCotizacion(CveVenta)
|
||||
Dim Hilo As New System.Threading.Thread(Sub() MandaMails(CveVenta, DdlTipoComprobante.SelectedValue.ToString(), LocalSerieFolio, ChkEnviarFactura.Checked, ArchivoXML, ArchivoPDF))
|
||||
Dim Hilo As New System.Threading.Thread(Sub() MandaMails(UsuarioActual, CveVenta, DdlTipoComprobante.SelectedValue.ToString(), LocalSerieFolio, ChkEnviarFactura.Checked, ArchivoXML, ArchivoPDF))
|
||||
Hilo.Start()
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió error al mandar Mail", ex)
|
||||
@@ -12753,6 +12775,10 @@ Partial Class Ventas
|
||||
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgError)
|
||||
End Try
|
||||
|
||||
If CveVenta > 0 Then
|
||||
ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False)
|
||||
End If
|
||||
|
||||
LocalSerieFolio = ObjFactura.SerieFolio
|
||||
LocalTipoDocto = ObjFactura.TipoDocto
|
||||
|
||||
@@ -12761,7 +12787,7 @@ Partial Class Ventas
|
||||
|
||||
Try
|
||||
' BytesPdfCotizacion(CveVenta)
|
||||
Dim Hilo As New System.Threading.Thread(Sub() MandaMails(CveVenta, DdlTipoComprobante.SelectedValue.ToString(), LocalSerieFolio, ChkEnviarFactura.Checked, ArchivoXML, ArchivoPDF))
|
||||
Dim Hilo As New System.Threading.Thread(Sub() MandaMails(UsuarioActual, CveVenta, DdlTipoComprobante.SelectedValue.ToString(), LocalSerieFolio, ChkEnviarFactura.Checked, ArchivoXML, ArchivoPDF))
|
||||
Hilo.Start()
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió error al mandar Mail", ex)
|
||||
@@ -17820,7 +17846,7 @@ Partial Class Ventas
|
||||
#End Region
|
||||
|
||||
#Region " MANDA CORREO "
|
||||
Private Sub MandaMails(CveVenta As Integer, TipoDocto As String, SerieFolio As String, EnviarFactura As Boolean, XML As String, PDF As String)
|
||||
Private Sub MandaMails(UsuarioActual As Usuario, CveVenta As Integer, TipoDocto As String, SerieFolio As String, EnviarFactura As Boolean, XML As String, PDF As String)
|
||||
|
||||
Dim ObjMail As New ClsSisMail()
|
||||
Dim ObjVentas As New ClsVentas
|
||||
@@ -18383,7 +18409,7 @@ Partial Class Ventas
|
||||
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) Then
|
||||
OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero()) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
@@ -24925,7 +24951,7 @@ Partial Class Ventas
|
||||
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) Then
|
||||
TipoDocto:=DdlTipoComprobante.SelectedValue, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero()) Then
|
||||
MensajeError = "Ocurrió un error al actualizar la información de la cotización"
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user