This commit is contained in:
rrene
2020-05-29 00:02:45 -07:00
4 changed files with 62 additions and 33 deletions

View File

@@ -3331,17 +3331,25 @@ Partial Class Bancos_IE
End Sub End Sub
#Region " NOTIFICACION PAGO " #Region " NOTIFICACION PAGO "
Private Sub NotificacionPago(CveIE As Integer, CorreoNotificarA As String) Private Sub NotificacionPago(CveIE As Integer, CorreoNotificarA As String)
Dim Param As New List(Of String)
If Not DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(9, 17) Then
Param.Add(CorreoNotificarA) 'Para
Param.Add("Notificaciones de pago") 'Asunto Dim Param As New List(Of String)
Param.Add(GeneraCorreo2(CveIE)) 'Body
Param.Add(CveIE.ToString) 'CveIE Param.Add(CorreoNotificarA) 'Para
Param.Add(If(ComprobanteIE <> "", String.Format("{0}IE\{1}", UsuarioActual.Empresa.Ruta, ComprobanteIE), "")) 'Archivo Adjunto Param.Add("Notificaciones de pago") 'Asunto
Param.Add(GeneraCorreo2(CveIE)) 'Body
Dim Hilo As New Threading.Thread(AddressOf MandaCorreo) Param.Add(CveIE.ToString) 'CveIE
Hilo.Start(Param) Param.Add(If(ComprobanteIE <> "", String.Format("{0}IE\{1}", UsuarioActual.Empresa.Ruta, ComprobanteIE), "")) 'Archivo Adjunto
Dim Hilo As New Threading.Thread(AddressOf MandaCorreo)
Hilo.Start(Param)
End If
End Sub End Sub
Private Sub MandaCorreo(data As Object) Private Sub MandaCorreo(data As Object)
Dim Parametros As List(Of String) = DirectCast(data, List(Of String)) Dim Parametros As List(Of String) = DirectCast(data, List(Of String))

View File

@@ -966,6 +966,16 @@ Partial Class Bancos_PagoElectronicoGrupos
RegistrosPago.Append("PSC") RegistrosPago.Append("PSC")
End If End If
If drow("CLABEDestino").ToString.Trim.Length.Contiene(10, 18) Then
RegistrosPago.Append(drow("CLABEDestino").ToString.PadLeft(18, CeroRelleno))
Else
ErrorLayout = True
MENSAJEError.AppendLine("ERROR EN CLABE cuenta destino")
Exit For
End If
If drow("CLABEOrigen").ToString.Trim.Length.Contiene(10, 18) Then If drow("CLABEOrigen").ToString.Trim.Length.Contiene(10, 18) Then
RegistrosPago.Append(drow("CLABEOrigen").ToString.PadLeft(18, CeroRelleno)) RegistrosPago.Append(drow("CLABEOrigen").ToString.PadLeft(18, CeroRelleno))
@@ -976,13 +986,7 @@ Partial Class Bancos_PagoElectronicoGrupos
Exit For Exit For
End If End If
If drow("CLABEDestino").ToString.Trim.Length.Contiene(10, 18) Then
RegistrosPago.Append(drow("CLABEDestino").ToString.PadLeft(18, CeroRelleno))
Else
ErrorLayout = True
MENSAJEError.AppendLine("ERROR EN CLABE cuenta destino")
Exit For
End If
RegistrosPago.Append(drow("Abreviatura").ToString) RegistrosPago.Append(drow("Abreviatura").ToString)
RegistrosPago.Append(drow("Abonado").ToString.ToDecimal.ToString("0000000000000.00")) RegistrosPago.Append(drow("Abonado").ToString.ToDecimal.ToString("0000000000000.00"))

View File

@@ -2680,22 +2680,26 @@ Partial Class Bancos_ProveedoresAbonar
#Region " NOTIFICACION PAGO " #Region " NOTIFICACION PAGO "
Private Sub NotificacionPago(CveIE As Integer, CorreoNotificarA As String) Private Sub NotificacionPago(CveIE As Integer, CorreoNotificarA As String)
'Dim Param As New List(Of String)
'Param.Add(CorreoNotificarA) 'Para If Not DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(9, 17) Then
'Param.Add("Notificaciones de pago") 'Asunto 'Dim Param As New List(Of String)
'Param.Add(GeneraCorreo(CveIE)) 'Body
'Param.Add(CveIE.ToString) 'CveIE
Dim Body As String = GeneraCorreo(CveIE)
Dim Comprobante = If(ComprobanteIE <> "", String.Format("{0}IE\{1}", UsuarioActual.Empresa.Ruta, ComprobanteIE), "") 'Archivo Adjunto
Dim File As Byte() = Nothing 'Param.Add(CorreoNotificarA) 'Para
If UsuarioActual.Empresa.Funcionalidad(545).ToEntero > 0 Then 'Param.Add("Notificaciones de pago") 'Asunto
File = NewGeneraBytesCxP(CveProveedor, UsuarioActual.Nombre) 'Param.Add(GeneraCorreo(CveIE)) 'Body
'Param.Add(CveIE.ToString) 'CveIE
Dim Body As String = GeneraCorreo(CveIE)
Dim Comprobante = If(ComprobanteIE <> "", String.Format("{0}IE\{1}", UsuarioActual.Empresa.Ruta, ComprobanteIE), "") 'Archivo Adjunto
Dim File As Byte() = Nothing
If UsuarioActual.Empresa.Funcionalidad(545).ToEntero > 0 Then
File = NewGeneraBytesCxP(CveProveedor, UsuarioActual.Nombre)
End If
Dim Hilo As New Threading.Thread(Sub() MandaCorreo(CorreoNotificarA, "Notificaciones de pago", Body, CveIE, Comprobante, File))
Hilo.Start()
End If End If
Dim Hilo As New Threading.Thread(Sub() MandaCorreo(CorreoNotificarA, "Notificaciones de pago", Body, CveIE, Comprobante, File))
Hilo.Start()
End Sub End Sub
Private Sub MandaCorreo(Para As String, Asunto As String, Body As String, CveIE As Integer, Comprobante As String, File As Byte()) Private Sub MandaCorreo(Para As String, Asunto As String, Body As String, CveIE As Integer, Comprobante As String, File As Byte())

View File

@@ -24764,14 +24764,27 @@ Partial Class Ventas
If UsuarioActual.CveEmpresa = 141 Then If UsuarioActual.CveEmpresa = 141 Then
Dim Total As Decimal = TxtTotal.Text.ToDecimal() Dim Total As Decimal = TxtTotal.Text.ToDecimal()
If Not PermiteCredito AndAlso ((DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) AndAlso Total > 0) Then Dim AmortizacionNC As Decimal = 0
Dim TienePagos As Boolean = ((Not (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0)) AndAlso (DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0)) OrElse AmortizacionNC > 0
'SI ES AMORTIZACION POR NOTA DE CREDITO DEBE SUMAR LA TOTALIDAD PARA COMPARAR EL PAGO
If DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then
For Each gvr As GridViewRow In GVAnticipos.Rows
If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked AndAlso gvr.DataKey("CveConceptoContable").ToEntero().Contiene(3) Then
AmortizacionNC += gvr.FCTextBox(String.Format("TxtAnticipo{0}", gvr.RowIndex)).Text.ToDecimal
End If
Next
End If
If Not PermiteCredito AndAlso Not TienePagos AndAlso Total > 0 Then
Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia) Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia)
Retorno = False Retorno = False
Return Retorno Return Retorno
End If End If
If Not PermiteCredito AndAlso DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 AndAlso Total > 0 Then If Not PermiteCredito AndAlso TienePagos AndAlso Total > 0 Then
Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() + AmortizacionNC
If TotalPago < Total Then If TotalPago < Total Then
Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia) Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia)